« Catégorie:ZoteroPage » : différence entre les versions

De alcolois
Aller à la navigation Aller à la recherche
Création de la catégorie
 
Page blanchie
Balise : Blanchiment
Ligne 1 : Ligne 1 :
<?xml version="1.0" encoding="UTF-8"?>
<!-- =====================================================================
    Place this content **inside the page**  [[Category:ZoteroPage]]
    (i.e., edit the category page itself).  PageSchemas will pick it up
    automatically because schemas live on Category pages.               
    ===================================================================== -->
<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>

Version du 3 juin 2025 à 16:35