Gebruiksaanwijzing extensie External Data: verschil tussen versies

Uit MediaWikiGids
Ga naar: navigatie, zoeken
Regel 61: Regel 61:
 
categorie=object_category,
 
categorie=object_category,
 
object nummer=object_number,
 
object nummer=object_number,
priref=priref,
 
 
reproductiereferentie=reproduction.reference,
 
reproductiereferentie=reproduction.reference,
 
titel=title,  
 
titel=title,  
Regel 68: Regel 67:
 
|cache seconds=1500
 
|cache seconds=1500
 
}}</pre>
 
}}</pre>
 +
 +
Opmerking: het attribuut / label (attribute, tag) '''priref''' is weggelaten, omdat het dubbel voorkomt. Het gebruik Xpath kan hiervoor een oplossing bieden.
  
 
{{#get_web_data:
 
{{#get_web_data:
Regel 80: Regel 81:
 
categorie=object_category,
 
categorie=object_category,
 
object nummer=object_number,
 
object nummer=object_number,
priref=priref,
 
 
reproductiereferentie=reproduction.reference,
 
reproductiereferentie=reproduction.reference,
 
titel=title,  
 
titel=title,  
Regel 96: Regel 96:
 
! Categorie
 
! Categorie
 
! Object nummer
 
! Object nummer
! Priref
 
 
! Reproductiereferentie
 
! Reproductiereferentie
 
! Titel
 
! Titel
Regel 109: Regel 108:
 
{{!}} {{{categorie}}}
 
{{!}} {{{categorie}}}
 
{{!}} {{{object nummer}}}
 
{{!}} {{{object nummer}}}
{{!}} {{{priref}}}
 
 
{{!}} {{{reproductiereferentie}}}
 
{{!}} {{{reproductiereferentie}}}
 
{{!}} {{{titel}}}
 
{{!}} {{{titel}}}

Versie van 13 mei 2017 om 17:51

Je vindt hier de officiële gebruiksaanwijzing van de Extension:External_Data.

External Data biedt verschillende manieren om externe gegevens binnen je wiki te gebruiken:

<!-- Vanaf een webpagina, inclusief API -->
{{#get_web_data: }}
{{#get_soap_data: }}

<!-- Vanuit een locale file -->
{{#get_file_data: }}

<!-- Vanuit een database -->
{{#get_db_data: }}

<!-- Vanuit een LDAP-server -->
{{#get_ldap_data: }}

Externe data vanaf een webpagina

{{#get_web_data:
url=data source URL
|format={CSV|CSV with header|GFF|JSON|XML}
|delimiter=delimiter
|data=local_variable_name1=external_variable_name1, etc.
|filters=external_variable_name1=filter_value1, etc.
|use xpath
|post data=additional data
|cache seconds=number of seconds
}}

SOAP

{{#get_soap_data:
url=data source URL
|request=the function used to request data
|requestData=parameter1=value1, etc.
|response=the function used to retrieve data
|data=local_variable_name1=external_variable_name1, etc.
}}

Externe data vanuit een database

Externe data vanuit een LDAP server

Testcase 1 - Gebruik External Data via de API van adlib

Documentatie adlib: [1]

Voorbeeld: Search all records: return all records from collect.inf

Specificatie API-verzoek:
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all

Code External Data:

{{#get_web_data:
url=http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all
|format=XML
|delimiter=10
|data=creatie=created,
modificatie=modification,
geselecteerd=selected,
administratie naam=administration_name,
maker=creator,
categorie=object_category,
object nummer=object_number,
reproductiereferentie=reproduction.reference,
titel=title, 
taal=lang,
invariant=invariant
|cache seconds=1500
}}

Opmerking: het attribuut / label (attribute, tag) priref is weggelaten, omdat het dubbel voorkomt. Het gebruik Xpath kan hiervoor een oplossing bieden.


Creatie Modificatie Geselecteerd Administratienaam Maker Categorie Object nummer Reproductiereferentie Titel Taal

2007-02-07T13:40:36 2016-08-25T08:33:57 False PDP Ghirlandaio, Domenico (Domenico Bigordi) painting M.54 M.54.jpg The Nativity nl-NL
2007-02-07T13:40:36 2016-08-25T08:33:49 False PDP Bert Degenhart Drenth painting 99 99.jpg The Transfiguration nl-NL
2007-02-07T13:40:36 2016-08-25T08:34:09 False PDP Batoni, Pompeo Girolamo painting PD.4-1950 PD.4-1950.jpg The 7th Earl of Northampton nl-NL
2007-02-07T13:40:36 2016-08-25T08:34:09 False PDP Constable, John painting PD.207-1948 PD.207-1948.jpg Hampstead Heath nl-NL
2007-02-07T13:40:36 2016-08-25T08:34:09 False PDP Rosa, Salvator painting PD.53-1958 PD.53-1958.jpg L'Umana Fragilit nl-NL
2007-02-07T13:40:36 2016-08-25T08:34:09 False PDP Elmore, Alfred painting PD.108-1975 PD.108-1975.jpg à nl-NL
2007-02-07T13:40:36 2016-08-25T08:33:57 False PDP Sellaio, Jacopo del painting M.75 M.75.jpg On the Brink (1865) nl-NL
2007-02-07T13:40:36 2017-01-27T15:46:11 False PDP Rossetti, Dante Gabriel drawing 2151 2151.jpg The Story of Cupid and Psyche nl-NL
2007-02-07T13:40:36 2016-08-25T08:33:41 False PDP Turner, Joseph Mallord William drawing 2476 2476.jpg Mary Magdalene at the Door of Simon the Pharisee nl-NL
2007-02-07T13:40:36 2017-06-20T21:51:58 False PDP Sickert, Walter Richard painting 2458 2458.jpg The field of Waterloo nl-NL
The Old Bedford nl-NL
The boy I love is up in the gallery nl-NL
Cupid in the gallery