Servis-Rhino 4211B Guia do Utilizador Página 71

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 298
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 70
Adapter Implementation
An adapter is implemented by a set of artifacts. To be specific:
An adapter configuration file in XML Within this file, a description of each of the
procedures supplied by that adapter is defined.
A JavaScript file. Within this file one will find an implementation of each of the procedures
offered by the adapter.
Zero or more XSL files used to convert back-end data to JSON.
An adapter is the aggregation of each of the above and is packaged into a ZIP file with a file type of
".adapter".
The XML configuration file has the following general format
<adapter name="AdapterName" platformVersion="?">
<description>
<debugPort>
<runOnNode>
<connectivity>
</connectivity>
<procedure name="ProcedureName" >
</procedure>
...
</adapter>
Each <procedure> element can have a number of attributes.
name – The name of the procedure
platformVersion
connectAs – Security identity used to connect to the back-end system. Choices are:
server
endUser
responseTimeoutInSeconds – How long to wait for a back-end response before
timing out. The default is 30 seconds.
audit – Should this adapter be audited? Values are "true" and "false".
securityTest – A test that can be performed to protect the adapter.
debugPort
runOnNode
Although the XML configuration file can be edited within a text editor or an XML editor,
Worklight studio provides a first class professional editor that provides entry assist as well as
assurance of correctness of the file.
After building an adapter, the adapter can be copied to other Worklight projects by copying its
folder found just beneath the "adapters" folder to the corresponding location in the target project.
Adapter JavaScript implementation
When an adapter is created, a JavaScript file called <AdapterName>-impl.js is also created. This is
where we implement the JavaScript code that implements the core function of the adapter. This is
Page 71
Vista de página 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 297 298

Comentários a estes Manuais

Sem comentários