Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add collaboration type #521

Merged
merged 3 commits into from
Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion docs/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ A full blown example would look like this (needs to be utf-8 encoded):
<type>link</type>
</navigation>
</navigations>
<collaboration>
<plugins>
<plugin type="collaborator-search" share-type="SHARE_TYPE_CIRCLE">OCA\Circles\Collaboration\v1\CollaboratorSearchPlugin</plugin>
</plugins>
</collaboration>
</info>

The following tags are validated and used in the following way:
Expand Down Expand Up @@ -482,7 +487,17 @@ navigations/navigation/type
* can be either link or settings
* link means that the entry is added to the default app menu
* settings means that the entry is added to the right-side menu which also contains the personal, admin, users, help and logout entry

collaboration
* optional
* can contain plugins for collaboration search (e.g. supplying share dialog)
collaboration/plugins
* optional
* must contain at least one plugin
collaboration/plugins/plugin
* required
* the PHP class name of the plugin
* must contain **type** attribute (currently only *collaboration-search*). The class must implement OCP\Collaboration\Collaborators\ISearchPlugin.
* must contain **share-type** attribute, according to the specific \OCP\Share constants

The following character maximum lengths are enforced:

Expand Down
44 changes: 44 additions & 0 deletions nextcloudappstore/api/v1/release/info.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
maxOccurs="1"/>
<xs:element name="contactsmenu" type="contactsmenu" minOccurs="0"
maxOccurs="1"/>
<xs:element name="collaboration" type="collaboration" minOccurs="0"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:unique name="uniqueNameL10n">
Expand Down Expand Up @@ -432,6 +434,48 @@
</xs:sequence>
</xs:complexType>

<xs:complexType name="collaboration">
<xs:sequence>
<xs:element name="plugins" type="collaboration-plugins" minOccurs="0" maxOccurs="1">
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="collaboration-plugins">
<xs:sequence>
<xs:element name="plugin" type="collaboration-plugins-plugin" minOccurs="1" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="collaboration-plugins-plugin">
<xs:simpleContent>
<xs:extension base="php-class">
<xs:attribute name="type" type="collaboration-plugin-type" use="required"/>
<xs:attribute name="share-type" type="share-type" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="collaboration-plugin-type">
<xs:restriction base="xs:string">
<xs:enumeration value="collaborator-search"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="share-type">
<xs:restriction base="xs:string">
<xs:enumeration value="SHARE_TYPE_USER"/>
<xs:enumeration value="SHARE_TYPE_GROUP"/>
<xs:enumeration value="SHARE_TYPE_LINK"/>
<xs:enumeration value="SHARE_TYPE_EMAIL"/>
<xs:enumeration value="SHARE_TYPE_CONTACT"/>
<xs:enumeration value="SHARE_TYPE_REMOTE"/>
<xs:enumeration value="SHARE_TYPE_CIRCLE"/>
<xs:enumeration value="SHARE_TYPE_GUEST"/>
</xs:restriction>
</xs:simpleType>

<!-- dependencies -->
<xs:complexType name="dependencies">
<xs:sequence>
Expand Down
1 change: 1 addition & 0 deletions nextcloudappstore/api/v1/release/pre-info.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<xsl:apply-templates select="activity"/>
<xsl:apply-templates select="navigations"/>
<xsl:copy-of select="contactsmenu"/>
<xsl:copy-of select="collaboration" />

<!-- copy invalid elements to fail if they are present -->
<xsl:copy-of select="standalone"/>
Expand Down
59 changes: 59 additions & 0 deletions nextcloudappstore/api/v1/tests/data/infoxmls/collaboration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0"?>
<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../release/info.xsd">
<id>circles</id>
<name>Circles</name>
<summary>Bring cloud-users closer together.</summary>
<description><![CDATA[Circles allows your users to create their own groups of users/colleagues/friends.
Those groups of users (or 'circles') can then be used by any other app for sharing purpose (files, social feed, status update, messaging, ...).
]]>
</description>
<version>0.12.5</version>
<licence>agpl</licence>
<author>Maxence Lange</author>
<documentation>
<admin>https://github.com/nextcloud/circles/wiki</admin>
</documentation>
<category>tools</category>
<category>social</category>
<website>https://github.com/nextcloud/circles</website>
<bugs>https://github.com/nextcloud/circles/issues</bugs>
<repository>https://github.com/nextcloud/circles.git</repository>
<screenshot>https://raw.githubusercontent.com/nextcloud/circles/master/screenshots/0.12.0.png
</screenshot>
<dependencies>
<nextcloud min-version="12" max-version="13"/>
</dependencies>

<repair-steps>
<post-migration>
<step>OCA\Circles\Migration\UpdateShareTimeToTimestamp</step>
<step>OCA\Circles\Migration\ImportOwncloudCustomGroups</step>
<step>OCA\Circles\Migration\GenerateUniqueIdOnCreatedCircle</step>
<step>OCA\Circles\Migration\UsingShortenUniqueIdInsteadOfCircleId</step>
</post-migration>
</repair-steps>

<commands>
<command>OCA\Circles\Command\Clean</command>
</commands>

<activity>
<settings>
<setting>OCA\Circles\Activity\SettingAsModerator</setting>
<setting>OCA\Circles\Activity\SettingAsMember</setting>
</settings>
<filters>
<filter>OCA\Circles\Activity\Filter</filter>
</filters>
<providers>
<provider>OCA\Circles\Activity\Provider</provider>
</providers>
</activity>

<collaboration>
<plugins>
<plugin type="collaborator-search" share-type="SHARE_TYPE_CIRCLE">OCA\Circles\Collaboration\v1\CollaboratorSearchPlugin</plugin>
</plugins>
</collaboration>
</info>
7 changes: 7 additions & 0 deletions nextcloudappstore/api/v1/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ def test_parse_settings_and_activity_and_nav(self):
self.config.pre_info_xslt,
self.config.info_xslt)

def test_parse_collaboration(self):
xml = self._get_contents(
'data/infoxmls/collaboration.xml')
parse_app_metadata(xml, self.config.info_schema,
self.config.pre_info_xslt,
self.config.info_xslt)

def test_parse_pre_release(self):
xml = self._get_contents('data/infoxmls/prerelease.xml')
result = parse_app_metadata(xml, self.config.info_schema,
Expand Down