Import secured resource

Goal

This extension will import or update data from a data universe with its security.

Packaging task configuration

<?xml version="1.0" encoding="UTF-8"?>
<packaging>
    <name>1000-workplace</name>
    <version>1.0</version>
    <install>
        <extension name="com.axemble.vdoc.update.resource.ImportSecuredResourceExtension" critical="true">
            <param name="file" value="workplace-middle-office-data-application.xml"/>
        </extension>
    </install>
</packaging>
Parameter Mandatory Description
file true Name of the XML file describing the resources. This file is searched for in the resources and custom/resources directories.

XML file describing the resources

Examples

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
    <resource>
        <action>CREATE</action>
        <resource-definition-uri>uril://vdoc/resourceDefinition/DefaultOrganization/MoovappsWorkplace/MiddleOffice:4/Application</resource-definition-uri>
        <reference>app-a54f7d6</reference>
        <properties>
            <property>
                <name>sys_Title</name>
                <type>TEXT</type>
                <values>
                    <value>Configuration</value>
                </values>
            </property>
            <property>
                <name>link</name>
                <type>TEXT</type>
                <values>
                    <value>${siteUrl}/middleoffice/middleoffice-home</value>
                </values>
            </property>
            <property>
                <name>highlighted</name>
                <type>BOOLEAN</type>
                <multiple>false</multiple>
                <values>
                    <value>true</value>
                </values>
            </property>
        </properties>
        <permissions>
            <permission>
                <action>BREAK</action>
                <subject>
                    <type>PROTOCOL-URI</type>
                    <value>uril://vdoc/resourceDefinition/DefaultOrganization/MoovappsWorkplace/MiddleOffice:4/Application</value>
                </subject>
            </permission>
            <permission>
                <action>ADD</action>
                <subject>
                    <type>PROTOCOL-URI</type>
                    <value>uril://vdoc/group/Internal/WP_ADMIN_MIDDLE_OFFICE_APPLICATION</value>
                </subject>
                <permission-level>OWNER</permission-level>
            </permission>
        </permissions>
    </resource>
</resources>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
    <resource>
        <action>UPDATE</action>
        <resource-definition-uri>
            uril://vdoc/resourceDefinition/DefaultOrganization/MoovappsWorkplace/MiddleOffice:4/Branding
        </resource-definition-uri>
        <reference>default</reference>
        <properties>
            <property>
                <name>HomeMessage</name>
                <type>TEXT_I18N</type>
                <multiple>true</multiple>
                <values>
                    <value language="fr">Bienvenue sur votre service client Moovapps</value>
                    <value language="en">Welcome to your Moovapps customer service</value>
                </values>
            </property>
        </properties>
        <permissions>
        </permissions>
    </resource>
</resources>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
    <resource>
        <action>UPDATE</action>
        <resource-definition-uri>
            uril://vdoc/resourceDefinition/DefaultOrganization/MoovappsWorkplace/MiddleOffice:4/Branding
        </resource-definition-uri>
        <reference>default</reference>
        <properties>
            <property>
                <name>ExternalObject</name>
                <type>EXTERNAL-ELEMENT</type>
                <multiple>true</multiple>
                <values>
                    <value name="key">key</value>
                    <value name="label">label</value>
                    <value name="type">type</value>
                </values>
            </property>
        </properties>
        <permissions>
        </permissions>
    </resource>
</resources>

Fields

Name Comment
action Allows you to define whether the resource must be:
  • created: CREATE, throw errors if the resource already exist
  • created if it does not exist and updated if it exist: CREATE_OR_UPDATE
  • updated: UPDATE, throws error if the resource does not exist
resource-definition-uri Needed to find the parent table of the resource.
reference Necessary to find the resource or know the reference to give it during creation.
property Describes a property to update.
permission Describes a security update.

Property fields

Name Comment
name System name of the property to update.
type Property type: TEXT, TEXT_I18N, INTEGER, LONG, BOOLEAN, PROTOCOL-SUPPORT, FILE, FLOAT, DOUBLE, or BIG_DECIMAL.
For the TEXT_I18N, the language attribute specifies the language for the update (you can value several languages by setting multiple to true and putting values with different languages).
For the DATE the possible formats are:
  • yyyy-MM-dd
  • yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
For the EXTERNAL-ELEMENT, the name attribute corresponds to the attributes of an ExternalElement (key, label and type). You must specify multiple to true.
multiple Indicates whether the property accepts one or more values. If this tag is not filled in, the default value is false. In the case of a file (FILE), must be specified to “true”
value Representation of the property value. In the case of a file (FILE), specify the name of the file, it is searched in the custom/resources directories.

Permission fields

Name Comment
action
  • ADD adds the permission indicated by the permission-level to the subject.
  • REMOVE removes the subject’s permissions on the resource.
  • BREAK breaks the rights inheritance from the subject.
subject The subject accepts PROTOCOL-URI types (specify the subject’s url in the value) or, in the case of the ADD and REMOVE actions, JOKERS (specify EVERYONE or ANONYMOUS in the value).
permission-level Used in the case of an ADD to know what permissions to give to the subject on the resource.