Simple types

After installing the SharePoint schemas, these can be used within the onion.net Editor..
Three simple types are available for this purpose.

  • web
  • list
  • listItem

These types can be allocated to an element or an attribute in an XML schema. In order to use the types, importing the namespace “http://onion.net/sharepointintegration/editor” is necessary. In the following example, the three possible types are used in a schema.

<xs:schema xmlns:references="http://onionworks.net/2004/references" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:onion="http://onionworks.net/2004/schema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sharepoint="http://onion.net/sharepointintegration" elementFormDefault="qualified" onion:schemaLocation="http://www.example.com/test/container">
<xs:import schemaLocation="http://onion.net/sharepointintegration/editor" namespace="http://onion.net/sharepointintegration" />
<xs:element name="container">
<xs:complexType>
<xs:sequence>
<xs:element name="testElement1" type="sharepoint:list" />
<xs:element name="testElement2" type="sharepoint:listItem" />
</xs:sequence>
<xs:attribute name="testAttribute" type="sharepoint:web" />
</xs:complexType>
</xs:element>
</xs:schema>

Further restrictions

The simple types can be restricted by setting certain attributes on the XML schema. The attributes “webs” and “languages” can be set on each type. Using these attributes the displayed websites, lists and list entries can be restricted.

The attribute “web” enables the blank-separated transfer of website GUIDs, which is to be displayed.

The attribute “languages” restricts by languages and expects the blank-separated input of so-called “TwoLetterISOLanguageNames”. If the default language of the web is not permitted, then this is still displayed but cannot be saved.

In addition to the general restrictions, the simple types “list” and “listItems” can be restricted further.

The type “list” can be restricted with the attribute “listTypes”. The transfer of blank-separated list names is possible in this attribute. Since SharePoint only differentiates between the list types (e.g. SPList, SPPictureLibrary) to a limited extent, an alias list type can be specified for lists for a granular differentiation of the lists in the web.config of the onion.net Render Engine. It will be described how these aliases are configured in the section SharePoint Render Engine configuration.

The following code shows an example of the relevant section while defining a alias list type "Glossary".

<source xlinkPrefix="sharepoint" type="Onion.RenderEngine.DataSources.SharePointIntegration.Client.SharePointRepository, Onion.RenderEngine.DataSources.SharePointIntegration.Client">
<server uri="tcp://localhost:8081/onion/sharepointintegration" />
<typedLists>
<type name="Glossary" listGuids="00000000-0000-0000-0000-000000000000" />
</typedLists>
</source>

The simple type “listItems” can be restricted using the attribute “listItemTypes”. The attribute expects blank-separated ContentTypes of list entries.

Example

An application of the restriction is shown in the following example.

<xs:schema xmlns:references="http://onionworks.net/2004/references" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:onion="http://onionworks.net/2004/schema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sharepoint="http://onion.net/sharepointintegration" elementFormDefault="qualified" onion:schemaLocation="http://www.example.com/test/container">
<xs:import schemaLocation="http://onion.net/sharepointintegration/editor" namespace="http://onion.net/sharepointintegration" />
<xs:element name="container">
<xs:complexType>
<xs:sequence>
<xs:element name="test1" type="sharepoint:web" sharepoint:languages="de en" />
<xs:element name="test2" type="sharepoint:web" sharepoint:webs="1afa5b78-83b4-44b9-b3d8-65da514dfffa" />
<xs:element name="test3" type="sharepoint:list" sharepoint:listTypes="Glossary" />
</xs:sequence>
<xs:attribute name="test4" type="sharepoint:listItem" sharepoint:listItemTypes="BlogComment WhatsNew" />
</xs:complexType>
</xs:element>
</xs:schema>