cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with aspect created

toze
Champ in-the-making
Champ in-the-making
Hi! I created a new model, so i can use a new aspect

<?xml version="1.0" encoding="UTF-8"?>
<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              
       xsi:schemaLocation="http://www.alfresco.org/model/dictionary/1.0 ../../../../webapps/alfresco/WEB-INF/classes/alfresco/model/modelSchema.xsd"     
       xmlns="http://www.alfresco.org/model/dictionary/1.0" name="gscom:model">

  <imports>
     <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
     <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
  </imports>
  <namespaces>
     <namespace uri="gscom.model" prefix="gscom"/>
  </namespaces> 
  <!– Type and Aspect definitions go here –>   
   <aspects>
      <aspect name="gscom:documentClassification">
         <title>Document Classification</title>
         <properties>
            <property name="gscom:name">
               <type>d:text</type>
            </property>
            <property name="gscom:publishedDate">
               <type>d:datetime</type>
            </property>
            <property name="gscom:author">
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
   </aspects>
   
</model>

Then i added <value>alfresco/extension/gscomModel.xml</value> in custom-model-context

Then i went to share-config-custom and added
<!– Repository Library config section –>
   <config evaluator="string-compare" condition="RepositoryLibrary" replace="true">
      <!–
         Whether the link to the Repository Library appears in the header component or not.
      –>
     <aspects>
         <!– Aspects that a user can see –>
         <visible>
            <aspect name="gscom:documentClassification" />           
         </visible>

         <!– Aspects that a user can add. Same as "visible" if left empty –>
         <addable>
         </addable>

         <!– Aspects that a user can remove. Same as "visible" if left empty –>
         <removeable>
         </removeable>
      </aspects>
     <!– <visible>true</visible> –>
   </config>
  
   <config evaluator="aspect" condition="gscom:documentClassification">
      <forms>
         <form>
            <field-visibility>
                <show id="gscom:name" />
                <show id="gscom:publishedDate" />
            <show id="gscom:author" />
            </field-visibility>
            <appearance>                
                <field id="gscom:name" label-id="prop.gscom_name" />
                <field id="gscom:publishedDate" label-id="prop.gscom_publishedDate" />
            <field id="gscom:author" label-id="prop.gscom_author" />
         </appearance>
         </form>
      </forms>
   </config>

But when i start tomcat, dont have any erros and the model is not loaded! Any help?
4 REPLIES 4

jpotts
World-Class Innovator
World-Class Innovator
What makes you think your model isn't being loaded?

If there are no errors, perhaps your Spring config in the custom-model-context file is wrong. Can you provide that?

Jeff

toze
Champ in-the-making
Champ in-the-making
Hi!
What makes you think your model isn't being loaded?

I said that because i think i must have a problem in share-config-custom.xml

my custom-model-context is like this:

<?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.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
            <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>

toze
Champ in-the-making
Champ in-the-making
Solved!
I must  complete sare-config-custom.xml with some more code.

added
<!– Custom Forms Extension –>
   <config evaluator="node-type" condition="cm:content">
      <forms>
         <!– Default form configuration used on the document details and edit metadata pages –>
         <form>
            <field-visibility>
                  <show id="ex:version" />         
            </field-visibility>
            <appearance>
                  <field id="ex:version" label="Version" />               
            </appearance>
         </form>

         <!– Document Library pop-up Edit Metadata form –>
         <form id="doclib-simple-metadata">
        <field-visibility>
                  <show id="ex:version" />
            </field-visibility>
            <appearance>
                <field id="ex:version" label="Version" />
            </appearance>

         </form>

         <!– Document Library Inline Edit form –>
         <form id="doclib-inline-edit">
          <field-visibility>
                  <show id="ex:version" />
            </field-visibility>
            <appearance>
                <field id="ex:version" label="Version" />
            </appearance>

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

Already Working

mahaam
Champ in-the-making
Champ in-the-making
try