Catégorie:ZoteroPage

Version datée du 3 juin 2025 à 16:35 par Marc (discussion | contributions) (Création de la catégorie)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

<?xml version="1.0" encoding="UTF-8"?>

The (incorrect) XML definition for this template is:

<PageSchema xmlns="https://www.semantic-mediawiki.org/xml/PageSchema/1.4">
  <!-- =====================================================================
       PageSchemas schema for pages created from Zotero items               
       ---------------------------------------------------------------------
       • Category  : ZoteroPage      (this Category page *is* the schema)
       • Template  : ZoteroPage      (stores PageName + ZoteroKey)
       • Form      : ZoteroPageCreation (entry form that queries Zotero)
       ===================================================================== -->

  <!-- ========================= TEMPLATE ================================= -->
  <Template name="ZoteroPage">
    <Field name="PageName">
      <type>Text</type>
      <pageforms_InputType>hidden</pageforms_InputType>
    </Field>

    <Field name="ZoteroKey">
      <type>Text</type>
      <pageforms_InputType>hidden</pageforms_InputType>
    </Field>
  </Template>

  <!-- =========================== FORM =================================== -->
  <pageforms_Form name="ZoteroPageCreation">
    <Layout>
      <!-- User enters the target page name (Title, Reference) -->
      <Part type="full_line">
        <Label>Nom de la page (Titre, Référence neutre ou CanLII)</Label>
        <InputField>PageName</InputField>
      </Part>

      <!-- Zoneto API query + radio selection. Written as raw wikitext so 
           PageForms will embed it directly in the form. -->
      <Part type="free_text">
        <Label>Recherche Zotero et sélection</Label>
        <Text><![CDATA[
{{#get_web_data:
  url=https://api.zotero.org/groups/4893620/items?q={{#urlencode:{{#explode:{{{PageName}}}|,|1}}}}&itemType=case&limit=10&include=data
  |format=json
  |use jsonpath=true
  |data=key=$[*].key, title=$[*].data.caseName, date=$[*].data.dateDecided, court=$[*].data.court, url=$[*].data.url
}}
{{#if_external_data:
'''Sélectionnez l’item à importer :'''
{| class="wikitable sortable"
! Choisir !! Titre !! Date !! Cour !! Lien
{{#for_external_table:
 |-
 | <input type="radio" name="ZoteroPage[ZoteroKey]" value="{{{key}}}" required="required"> 
 | {{{title}}}
 | {{{date}}}
 | {{{court}}}
 | [{{{url}}} Voir]
}}
|}
|'''Aucun résultat Zotero trouvé pour « {{#explode:{{{PageName}}}|,|1}} ».'''
}}
]]></Text>
      </Part>
    </Layout>

    <BuiltInButtons>
      <SaveButton/>
      <CancelButton/>
    </BuiltInButtons>

    <pageforms_Template name="ZoteroPage">
      <pageforms_Field name="PageName" />
      <pageforms_Field name="ZoteroKey" />
    </pageforms_Template>
  </pageforms_Form>
</PageSchema>