LearnPAd/learnpad

View on GitHub
lp-collaborative-workspace/lp-cw-component/lp-cw-component-ui/src/main/resources/LPCode/OrganizationMacro.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.2" reference="LPCode.OrganizationMacro" locale="">
  <web>LPCode</web>
  <name>OrganizationMacro</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1445614990000</creationDate>
  <parent>LPCode.WorkflowButtonsMacro</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1459246593000</date>
  <contentUpdateDate>1458950916000</contentUpdateDate>
  <version>1.1</version>
  <title>OrganizationMacro</title>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content/>
  <object>
    <name>LPCode.OrganizationMacro</name>
    <number>0</number>
    <className>XWiki.WikiMacroClass</className>
    <guid>73c698cd-3a24-49e6-80f0-bb4f62b96c73</guid>
    <class>
      <name>XWiki.WikiMacroClass</name>
      <customClass/>
      <customMapping/>
      <defaultViewSheet/>
      <defaultEditSheet/>
      <defaultWeb/>
      <nameField/>
      <validationScript/>
      <code>
        <disabled>0</disabled>
        <name>code</name>
        <number>9</number>
        <prettyName>Macro code</prettyName>
        <rows>20</rows>
        <size>40</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
      </code>
      <contentDescription>
        <disabled>0</disabled>
        <name>contentDescription</name>
        <number>8</number>
        <prettyName>Content description (Not applicable for "No content" type)</prettyName>
        <rows>5</rows>
        <size>40</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
      </contentDescription>
      <contentType>
        <cache>0</cache>
        <disabled>0</disabled>
        <displayType>select</displayType>
        <multiSelect>0</multiSelect>
        <name>contentType</name>
        <number>7</number>
        <prettyName>Macro content type</prettyName>
        <relationalStorage>0</relationalStorage>
        <separator>|</separator>
        <separators>|</separators>
        <size>1</size>
        <unmodifiable>0</unmodifiable>
        <values>Optional|Mandatory|No content</values>
        <classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
      </contentType>
      <defaultCategory>
        <disabled>0</disabled>
        <name>defaultCategory</name>
        <number>4</number>
        <prettyName>Default category</prettyName>
        <size>30</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.StringClass</classType>
      </defaultCategory>
      <description>
        <disabled>0</disabled>
        <name>description</name>
        <number>3</number>
        <prettyName>Macro description</prettyName>
        <rows>5</rows>
        <size>40</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
      </description>
      <id>
        <disabled>0</disabled>
        <name>id</name>
        <number>1</number>
        <prettyName>Macro id</prettyName>
        <size>30</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.StringClass</classType>
      </id>
      <name>
        <disabled>0</disabled>
        <name>name</name>
        <number>2</number>
        <prettyName>Macro name</prettyName>
        <size>30</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.StringClass</classType>
      </name>
      <supportsInlineMode>
        <disabled>0</disabled>
        <displayFormType>select</displayFormType>
        <displayType>yesno</displayType>
        <name>supportsInlineMode</name>
        <number>5</number>
        <prettyName>Supports inline mode</prettyName>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
      </supportsInlineMode>
      <visibility>
        <cache>0</cache>
        <disabled>0</disabled>
        <displayType>select</displayType>
        <multiSelect>0</multiSelect>
        <name>visibility</name>
        <number>6</number>
        <prettyName>Macro visibility</prettyName>
        <relationalStorage>0</relationalStorage>
        <separator>|</separator>
        <separators>|</separators>
        <size>1</size>
        <unmodifiable>0</unmodifiable>
        <values>Current User|Current Wiki|Global</values>
        <classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
      </visibility>
    </class>
    <property>
      <code>{{velocity}}
#set ($modeltype = $xcontext.macro.params.modeltype)
#if ($modeltype.equals('bpmn'))
  #set ($select = "select distinct targetdoc.fullName")
#set ($from = "from Document as doc, Document as targetdoc, doc.object(LPCode.BaseElementClass) as be, doc.object(LPCode.LinkClass) as link, targetdoc.object(LPCode.BaseElementClass) as targetbe")
#set ($where = "where doc.id = :id and ( targetbe.type = 'bpmn-pool' or targetbe.type = 'bpmn-lane' ) and link.targetmodelsetid = targetbe.modelsetid and link.targetmodelid = targetbe.modelid and link.targetartifactid = targetbe.id")
  #set ($query = "${select} ${from} ${where}")
  #set ($unitFullnames = $services.query.xwql($query).bindValue("id", ${doc.id}).execute())
  #if ("$!unitFullnames" != "" &amp;&amp; $unitFullnames.size() &gt; 0)
    (% class="panel panel-organization" %)(((
      (% class="panel-heading" %)(((
        ${services.icon.render('group')} ${services.localization.render('LPCode.OrganizationMacro.title')}
      )))
      (% class="panel-body" %)(((
        #foreach($unitFullname in $unitFullnames)
          #set ($unitReference = $services.model.resolveDocument($unitFullname))
          #set ($unitDocument = $xwiki.getDocument($unitReference))
          #set ($unitObject = $unitDocument.getObject('LPCode.BaseElementClass'))
          #set ($unitType = $unitObject.getProperty('type').value)
          #set ($unitURL = $unitDocument.URL)
          #if ($unitType.equals('bpmn-pool'))
            #set ($unitIcon = $services.icon.render('home'))
          #elseif ($unitType.equals('bpmn-lane'))
            #set ($unitIcon = $services.icon.render('group'))
          #end
          (% class="row" %)(((
            [[${unitIcon} ${unitDocument.title}&gt;&gt;path:${unitURL}||class="col-xs-12 panel-item"]]
          )))
        #end
      )))
    )))
  #end
#end
{{/velocity}}</code>
    </property>
    <property>
      <contentDescription/>
    </property>
    <property>
      <contentType>No content</contentType>
    </property>
    <property>
      <defaultCategory/>
    </property>
    <property>
      <description>Display the related units and role.</description>
    </property>
    <property>
      <id>organization</id>
    </property>
    <property>
      <name>Organization</name>
    </property>
    <property>
      <supportsInlineMode>0</supportsInlineMode>
    </property>
    <property>
      <visibility>Current Wiki</visibility>
    </property>
  </object>
  <object>
    <name>LPCode.OrganizationMacro</name>
    <number>0</number>
    <className>XWiki.WikiMacroParameterClass</className>
    <guid>f7459e8f-7f4e-4311-84e1-de737efd3733</guid>
    <class>
      <name>XWiki.WikiMacroParameterClass</name>
      <customClass/>
      <customMapping/>
      <defaultViewSheet/>
      <defaultEditSheet/>
      <defaultWeb/>
      <nameField/>
      <validationScript/>
      <defaultValue>
        <disabled>0</disabled>
        <name>defaultValue</name>
        <number>4</number>
        <prettyName>Parameter default value</prettyName>
        <size>30</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.StringClass</classType>
      </defaultValue>
      <description>
        <disabled>0</disabled>
        <name>description</name>
        <number>2</number>
        <prettyName>Parameter description</prettyName>
        <rows>5</rows>
        <size>40</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
      </description>
      <mandatory>
        <disabled>0</disabled>
        <displayFormType>select</displayFormType>
        <displayType>yesno</displayType>
        <name>mandatory</name>
        <number>3</number>
        <prettyName>Parameter mandatory</prettyName>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
      </mandatory>
      <name>
        <disabled>0</disabled>
        <name>name</name>
        <number>1</number>
        <prettyName>Parameter name</prettyName>
        <size>30</size>
        <unmodifiable>0</unmodifiable>
        <classType>com.xpn.xwiki.objects.classes.StringClass</classType>
      </name>
    </class>
    <property>
      <defaultValue>bpmn</defaultValue>
    </property>
    <property>
      <description>Type of the model.</description>
    </property>
    <property>
      <mandatory>1</mandatory>
    </property>
    <property>
      <name>modeltype</name>
    </property>
  </object>
</xwikidoc>