Technical documentation of the Documents widget

Description

On this page you will find the technical descriptions of the wholesale library. It also describes how you can integrate the library into your system. This allows you to, for example, call up documents and search the content within the document. Below you will find the table of contents for this page:

Contents

Integration via “xs-loader” widget

All widgets are integrated via the “xs-loader”.

Parameters “xs-documents“

This widget starts a search with the passed parameters and displays the hits in sales documents as single pages. Only PDF documents are taken into account.

Input

Input

Parameter

Mandatory

Description

Example value

channelid

Yes

Channelid to be used as the basis for the search.

2

searchRequest

No

Either the searchRequest parameter or the combination of searchterm and manufacturerid must be transferred

Structure for transferring supplier-specific search terms.

  • At least one object must be contained in searchRequest.

  • Within this object, the searchTerm attribute is mandatory.

  • If the attribute manufacturerid is also used in it, it must contain at least one ID.

 

{ "searchRequest": [{ "searchTerms": [ "Suchbegriff 1" ], "manufacturerid": [ "Lieferant 1", "Lieferant 2" ] }, { "searchTerms": [ "Suchbegriff 2", "Suchbegriff 3" ], "manufacturerid": [ "Lieferant 2" ] } ] }

searchterm

No

Either the searchRequest or searchterm parameter must be passed.

Search term used to search through the documents in the channel.

test

manufacturerid

No

If the searchRequest parameter is used, this parameter must not be used.

List of manufacturer IDs to limit the search. If no IDs are specified, all documents are searched for the “searchterm” within the channel.

[“COSMO”,”Oventrop”]

manufactureridtype

No

The ID type that is used for a request. The field only needs to be set if the manufacturerid is to be used by another system. All manufacturerids must be of the same type.

This functionality is only available if an IDHUB integration has been ordered.

If this parameter is not transferred, the transferred manufacturerid is used by the requested system.

The manufactureridtype refers both to the manufacturerid parameter and to the manufacturerid property in the object of the searchRequest parameter.

odc

maxsize

No

Maximum number of individual pages to be displayed.

100

maxpagesperdocument

No

Maximum number of individual pages that are returned per document. If not specified, 5 is used as the default value.

5

style

No

JSON object for defining the primary and secondary color of the widget. The object has two fields:

  • primarycolor: Primary color. A hexadecimal string is expected as the value (Example: "#616161").

  • secondarycolor: Secondary color. A hexadecimal string is expected as the value (Example: "#D3D3D3").

"style":{ "primarycolor": "#616161", "secondarycolor": "#D3D3D3" }

pdfviewer

No

The object serves as a configuration object for the PDF viewer

There is currently only one top category

  • position

    • top

    • right

    • bottom

    • left

All values are implemented as pixel values. A unit does not necessarily have to be specified.

"pdfviewer":{ "position":{ "top": "150px", "right": "20px", "bottom": "50px", "left": "20px" } }

downloadinnewtab

No

If the parameter is set to true, a new tab opens when the download button is clicked and the file is downloaded.en

 

downloadinnewtabtarget

No

To be used in conjunction with “downloadinnewtab”. Only used if “downloadinnewtab” is set to true

Specifies the target that the download URL should open

By default or if no value is set, “_blank” is used

 

showArchivedDocs

No

Depending on which string is passed, the parameter determines whether only archived or no archived items or all are displayed.

The following values can be specified:

  • “archived“ ← only displays archived documents and no non-archived documents

  • “notArchived“ ← does not display any archived documents, only non-archived documents

  • “all“ ←shows all documents, i.e. archived and not archived

Note: The value “all“ is not mandatory, as this value is set by default if the parameter is not passed or is passed empty

widgetstate

No

All GET parameters of the XS-Documents widget as a Base64 string.

This allows a specific view to be loaded immediately when the deep search is opened.

Can be used in combination with the “pdflinkextended” event

disableMetaTag

No

The XS-Documents widget includes a meta tag. This meta tag is defined as follows:

The tag is essential for displaying the widget on mobile devices. The tag can lead to problems when integrating the widget into apps.

This parameter can be used to control whether the meta tag is created. The meta tag can then be provided by the embedded website, for example.

Please note that if the tag is switched off, no guarantee can be given for correct display on mobile devices.

The default value is false.

true

Ausgang

status

Yes

This event is always output during initialization.

  • error

  • complete

  • found

  • not_found

 

shopsearch

No

This event is only output if this function has been switched on for the corresponding channel.

The event contains the following two pieces of information.

  • searchterm

    • String / Can be empty

  • manufacturerid

    • String / Can be empty

  • callback

    • thumbnailurl: String, URL to the thumbnail of the document. The OAuth2 token must be included in the header of the request.

    • uploaddescription: String, Upload description of the document

    • widgetstate: String, Status of the widget for return. Must be transferred to the widget in the parameters when returning in order to restore the status.

 

shopcart

No

This event is only output if this function has been switched on for the corresponding channel.

  • thumbnailurl: String, URL to the thumbnail of the document. The OAuth2 token must be included in the header of the request.

  • uploaddescription: String, Upload description of the document

  • widgetstate: String, Status of the widget for return. Must be transferred to the widget in the parameters when returning in order to restore the status.

 

 

dialogstatus

No

This event is output when a dialog is opened and closed. Values:

  • open

  • close

 

pdflink

No

This event is displayed in a PDF document when you click on an external link.

Output of the value specified in the PDF document for the external link as a string

pdflinkextended

No

This event is triggered in addition to the “pdflink” event and contains a callback attribute that can be used to return to the widget.

The attributes in the callback event are:

  • searchterm

  • manufacturerid

  • thumbnailurl

  • uploaddescription

  • widgetstate

Sample output of the event:

Eingangsevents

closeAlldialogs

 

This event can be emitted to the widget. The widget catches the event and then closes all dialog windows that are currently open.

Example call:

Logic Search

Case 1 only searchterm parameter specified:

  • The search term is split at spaces and merged using the or operator.

  • Documents found contain at least one of the partial search terms.

Case 2 Parameters searchterm and manufacturerid specified:

  • The search term is prepared as in case 1.

  • The manufacturerid field serves as an additional filter. The individual IDs are linked with an or.

  • manufacturerid and searchterm are linked using the and operator.

  • Documents found contain at least one of the partial search terms and come from one of the specified suppliers.

Case 3 Parameter searchRequest specified:

  • Preparation of the individual search terms in searchTerms as in case 1

  • The prepared search terms are linked using the or operator.

  • The manufacturerid field serves as an additional filter. The individual IDs are linked with an or.

  • manufacturerid and searchterm are linked using the and operator.

  • The search requests in the searchRequest array are linked with an or.

  • Documents found that match at least one of the search requests.

 

Example image

0f00b229-1e84-4de7-80b3-9f50f2a882f9.png
48c97fda-1dfe-44f4-880b-c6a382a5917e.png
PDF-Viewer

Example parameters

Example integration

Embed the following code snippet into the HTML DOM.

Widget-Loader V1.x.x

Widget-Loader V2.x.x

Example event “status”

Folgendes Codebeispiel wartet auf das Rückgabevent “status” von dem Documents Widget.

Sample code (PHP)

Widget-Loader V1.x.x

Widget-Loader V2.x.x