[go: up one dir, main page]

Menu

Configuration

Ian Jennings mikem1 Tom Potts
There is a newer version of this page. You can find it here.

Configuration

(Vic has been tested against Alfresco Community version 4.0 and above.)

Although Vic will be able to access the CMIS repository without any configuration, many additional features will only work once configured.

Alfresco supports metadata, defined by Alfresco itself or by a custom extension. This metadata can be displayed in Vic. Vic needs to know which metadata to display and uses one or more config files in the Alfresco repository to determine this. It is the job of the Alfresco administrator to create and maintain these config files.

What metadata is supported
* Properties defined on Types or Aspects
* Associations

Where are the config files saved
* In the Alfresco folder /Data Dictionary/Vic Configs. This will need creating by the administrator

Searching by metadata
Once configured, metadata search boxes are added to the Advanced Search dialog in Vic.
The search metadata fields must be defined within a 'search_group' the config xml. The search group is titled and expandable.

When defining a 'search-field' you must include a 'type' and a 'display-label'. The options for 'type' are:
* String
* Multi
* Date

**The xsd

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <!-- Simple elements -->

<xs:element name="value" type="xs:string"/>

  <!-- definition of attributes -->
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="parent" type="xs:string"/>
<xs:attribute name="action" type="xs:string"/>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="display-label" type="xs:string"/>
<xs:attribute name="authority" type="xs:string"/>
<xs:attribute name="expanded" type="xs:string"/>
<xs:attribute name="aspect" type="xs:string"/>
<xs:attribute name="property" type="xs:string"/>


  <!-- definition of complex elements -->

<xs:element name="alfresco-config">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="properties" maxOccurs="1"/>
      <xs:element ref="search" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="properties">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="config" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="config">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="property" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute ref="type" use="required"/>
    <xs:attribute ref="name" use="required"/>
    <xs:attribute ref="parent"/>
  </xs:complexType>
</xs:element>

<xs:element name="property">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="constraint" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute ref="name" use="required"/>
    <xs:attribute ref="action"/>
  </xs:complexType>
</xs:element>

<xs:element name="constraint">
  <xs:complexType>
    <xs:sequence>
       <xs:element ref="value" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute ref="type" use="required"/>
  </xs:complexType>
</xs:element>

<xs:element name="search">
  <xs:complexType>
    <xs:sequence>
       <xs:element ref="search-group" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="search-group">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="search-field" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute ref="id" use="required"/>
    <xs:attribute ref="display-label" use="required"/>
    <xs:attribute ref="authority" use="required"/>
    <xs:attribute ref="expanded" use="required"/>
  </xs:complexType>
</xs:element>

<xs:element name="search-field">
  <xs:complexType>
    <xs:sequence />
    <xs:attribute ref="aspect" use="required"/>
    <xs:attribute ref="property" use="required"/>
    <xs:attribute ref="type" use="required"/>
    <xs:attribute ref="display-label" use="required"/>
  </xs:complexType>
</xs:element>

</xs:schema>

What does the XML look like

Here is an example - myExample-config.xml.

<alfresco-config>
  <properties>

   <!-- A sample aspect defined as my:myCustomAspect in Alfresco -->
    <config type="aspect" name="P:my:myCustomAspect">
      <property name="my:myAspectProperty"/>    
      <property name="my:myOtherAspectProperty"/>   
    </config>

    <config type="aspect" name="P:my:myChildCustomAspect" parent="P:my:myCustomAspect">
      <property name="my:myAspectProperty">
        <constraint type="List">
          <value>My Value 1</value>
          <value>My Value 2</value>
        </constraint>
      </property>   
      <property name="my:myOtherAspectProperty"/>   
    </config>

   <!-- A sample type defined as my:myCustomType in Alfresco -->
    <config type="type" name="D:my:myCustomType">
      <property name="my:myTypeProperty"/>  
      <property name="my:myOtherTypeProperty"/> 
    </config>
  </properties>

  <associations>
    <config type="type" name="D:my:myCustomType">
      <association name="R:my:myTypeAssociation" display-label="My Association"/>
    </config>
  </associations>

  <search>
    <search-group id="myCustomGroup" display-label="Custom Metadata" expanded="false">
      <search-field aspect="P:my:myCustomAspect" property="my:myAspectProperty" type="String" display-label="Aspect Property"/>
      <search-field aspect="P:my:myCustomAspect" property="my:myOtherAspectProperty" type="String" display-label="Other Aspect Property"/>
    </search-group>
  </search>
</alfresco-config>

User Settings

User configuration settings are saved in the "User Homes/username" Alfresco space structure under a folder vic_workspace.
NOTE: If you are testing Vic using the admin user, remember to create a home folder for the admin user