Alfresco Bibliothek (Liste von Büchern) erstellen

Eine Bibliothek (Liste von Büchern) erstellen

Eine BilblithekDatalistModel für Share erstellen

vi ./tomcat/shared/classes/alfresco/extension/bibliothekDatalistModel.xml

Mit folgendem Inhalt füllen

<?xml version="1.0" encoding="UTF-8"?>
    <!-- Definition of new Model -->
    <model name="gc:bibliothekDatalist" xmlns="http://www.alfresco.org/model/dictionary/1.0">

       <!-- Optional meta-data about the model -->
       <description>Custom Bibliothek Datalist</description>
       <author>Ralph Wetter</author>
       <version>1.0</version>

       <!-- Imports are required to allow references to definitions in other models -->
       <imports>
            <!-- Import Alfresco Dictionary Definitions -->
          <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
          <!-- Import Alfresco Content Domain Model Definitions -->
          <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
         <!-- Import Alfresco Data List Model Definitions -->
          <import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl"/>
       </imports>

       <!-- Introduction of new namespaces defined by this model -->
       <namespaces>
           <namespace uri="gc.customlists.com" prefix="gc"/>
       </namespaces>


       <!--      T Y P E   D E F I N I T I O N S      -->
       <types>
         <!--   Data list defintions For this model go here -->
          <type name="gc:bibliothek">
           <title>Bibliothek</title>
           <description>Buecherliste - Bibliothek</description>
           <parent>dl:dataListItem</parent>
           <properties>
             <property name="gc:bibliothekTitle">
                <title>Buchtitel</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
             <property name="gc:bibliothekSprache">
                <title>Sprache</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
             <property name="gc:bibliothekISBN">
                <title>ISBN</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
             </property>
             <property name="gc:bibliothekPage">
                <title>Seitenanzahl</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
             </property>
             <property name="gc:bibliothekContent">
                <title>Kurzbeschreibung</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
             </property>
             <property name="gc:bibliothekComment">
                <title>Kommentar</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
             </property>
             <property name="gc:bibliothekAusgeliehen">
                <title>Standort</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
          </properties>

           <associations>
             <association name="gc:bibliothekAttachments">
                <title>Attachements</title>
                <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
                </source>
                <target>
                  <class>cm:content</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
                </target>
             </association>
           </associations>
         </type>
       </types>
</model>

Eine BilblithekDatalistModel für Alfresco-Repository erstellen

vi ./tomcat/shared/classes/alfresco/extension/customDatalist-model-context.xml

Mit folgendem Inhalt füllen

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
        <!-- Registration of new models -->
    <bean id="extension.gc.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
            <property name="models">
                <list>
                    <value>alfresco/extension/bibliothekDatalistModel.xml</value>
                </list>
            </property>
        </bean>

</beans>

share-config-custom mit Bibliothek erweitern

./tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml

Mit folgendem Inhalt erweitern:

<!-- Bibliothek DataList -->

       <config evaluator="model-type" condition="gc:bibliothek">
          <forms>
             <!-- Create item form -->
             <form>
                <field-visibility>
                   <!-- for the form creation we are showing everything except approved date -->
                   <show id="gc:bibliothekTitle" />
                   <show id="gc:bibliothekSprache" />
                   <show id="gc:bibliothekISBN" />
                   <show id="gc:bibliothekPage" />
                   <show id="gc:bibliothekContent" />
                   <show id="gc:bibliothekComment" />
                   <show id="gc:bibliothekAusgeliehen" />
                   <show id="gc:gcAttachments" />
                </field-visibility>
                <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
                <appearance>
                   <field id="gc:bibliothekTitle">
                      <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                   </field>

                   <field id="gc:bibliothekContent">
                      <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                   </field>
                   <field id="gc:gcAttachments">
                      <control>
                       <control-param name="startLocation">{doclib}</control-param>
                      </control>
                       </field>
                </appearance>
             </form>

                   <!-- Data Grid view -->
                   <form id="datagrid">
                   <field-visibility>
                     <show id="gc:bibliothekTitle" />
                     <show id="gc:bibliothekSprache" />
                     <show id="gc:bibliothekISBN" />
                     <show id="gc:bibliothekPage" />
                     <show id="gc:bibliothekContent" />
                     <show id="gc:bibliothekAusgeliehen" />
                     <show id="gc:gcAttachments" />
                   </field-visibility>
                   </form>
             </forms>
          </config>
     
          <!-- Edit view -->
       <config evaluator="node-type" condition="gc:bibliothek">
          <forms>
             <!-- Edit marketing item form -->
             <form>
                <field-visibility>
                     <show id="gc:bibliothekTitle" />
                     <show id="gc:bibliothekSprache" />
                     <show id="gc:bibliothekISBN" />
                     <show id="gc:bibliothekPage" />
                     <show id="gc:bibliothekContent" />
                     <show id="gc:bibliothekComment" />
                     <show id="gc:bibliothekAusgeliehen" />
                     <show id="gc:gcAttachments" />
                </field-visibility>
                <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
                <appearance>
                   <field id="gc:bibliothekTitle">
                      <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                   </field>

                   <field id="gc:bibliothekContent">
                      <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                   </field>
                   <field id="gc:gcAttachments">
                      <control>
                       <control-param name="startLocation">{doclib}</control-param>
                      </control>
                       </field>
                </appearance>

             </form>
          </forms>
       </config>