cancel
Showing results for 
Search instead for 
Did you mean: 

problems with web-client-config-custom.xml

aznk
Champ in-the-making
Champ in-the-making
Hello,
I've been trying some content types/aspects by uncommenting the examples in alfresco/extension, I have no errors when launching the server, but it seems like nothing is taken into account in the web interface, like if web-client-config-custom.xml was completely ignored. Here is the code of the files :

- exampleModel.xml :
<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>

<!– The important part here is the name - Note: the use of the my: namespace
     which is defined further on in the document –>
<model name="my:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Example custom Model</description>
   <author></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"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="my.new.model" prefix="my"/>
   </namespaces>
  
   <types>
  
      <!– Definition of new Content Type: Standard Operating Procedure –>
      <type name="my:sop">
         <title>Standard Operating Procedure</title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:publishedDate">
               <type>d:datetime</type>
            </property>
            <property name="my:authorisedBy">
               <type>d:text</type>
            </property>
         </properties>
         <associations>
            <association name="my:signOff">
               <target>
                  <class>cm:content</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
            <child-association name="my:processSteps">
               <target>
                  <class>cm:content</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
         </child-association>          
         </associations>
      </type>
    
    </types>
  
    <aspects>
    
      <!– Definition of new Content Aspect: Image Classification –>
      <aspect name="my:imageClassification">
         <title>Image Classfication</title>
         <properties>
            <property name="my:width">
               <type>d:int</type>
            </property>
            <property name="my:height">
               <type>d:int</type>
            </property>
            <property name="my:resolution">
               <type>d:int</type>
            </property>
         </properties>
      </aspect>
    
   </aspects>
  
</model>

- web-client-config-custom.xml :

<alfresco-config>

   <!– Example of overriding the from email address –>
   <!–
   <config>
      <client>
         <from-email-address>someone@your-domain.com</from-email-address>
         <search-max-results>100</search-max-results>
      </client>
   </config>
   –>

   <!– Example of adding languages to the list in the login page –>
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="ca_ES">Catalan</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </config>

   <!– Example of configuring advanced search –>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         </content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </custom-properties>
      </advanced-search>
   </config>


   <!– Example of changing the sort direction for a view in the client –>

   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction>ascending</sort-direction>
            </topic>
         </view-defaults>
      </views>
   </config>


   <!– Example of adding a custom icon to the Create Space dialog –>

   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </icons>
   </config>


   <!– The config below shows how to incorporate the example model–>
   <!– into the web client, for this to work you will need to –>
   <!– rename example-model-context.xml.sample to example-model-context.xml –>
  
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="my:sop">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="my:publishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="my:processSteps" />
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </content-types>
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </custom-properties>
      </advanced-search>
   </config>
  
  
   <config evaluator="node-type" condition="wiki:page">
  <property-sheet>
    <show-property name="wiki:restrict"/>
    <show-property name="wiki:category"/>
  </property-sheet>
</config>

<config evaluator="string-compare" condition="Custom Content Types">
  <content-types>
    <type name="wiki:page"/>
  </content-types>
</config>

<config evaluator="string-compare" condition="Advanced Search">
  <advanced-search>
     <content-types>
        <type name="wiki:page" />
     </content-types>
     <custom-properties>
        <meta-data type="wiki:page" property="wiki:restrict" />
        <meta-data type="wiki:page" property="wiki:category" />
     </custom-properties>
  </advanced-search>
</config>

</alfresco-config>

- example-model-context.xml :

<?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/exampleModel.xml</value>
            </list>
        </property>
    </bean>
        
</beans>

18 REPLIES 18

gutierrez_ge
Champ in-the-making
Champ in-the-making
Thanks,

but how do they show on the web page?

i still see the same thing

Thanks

maheshlinga
Champ in-the-making
Champ in-the-making
you can see them similar to the normal default metdata fields , when you try to add data in the newly created  content model from the webclient.

Try restarting web server..

gutierrez_ge
Champ in-the-making
Champ in-the-making
ok i'm gonna to describe what do i have exactly

on alfresco/extension i have exampleModel.xml (thats the new model) and example-model-context.xml (where supose is declared my new model)

and on web-client-config-properties.xml that is on alfresco/

i have this sniplet

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"
                                 show-in-edit-mode="false"/>
      </property-sheet>
   </config>


i don't see any of width or height fileds when i'm adding the description and author metadata

I haven't done anything else, just as the web page says..

Thanks,

gutierrez_ge
Champ in-the-making
Champ in-the-making
i did.. im gonna try agan and im gonna refresh the web to see if is not working from the cache

gutierrez_ge
Champ in-the-making
Champ in-the-making
nothing… still the same page, i think i haven't registered the model well

on the example-model-context.xml i have this

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

i that file is on alfresco/extension

i think i need to register that on the core-service-context.xml file

what do you say?

Thanks,

maheshlinga
Champ in-the-making
Champ in-the-making
sorry the file name is web-client-config-custom.xml which is in Alfresco/extension folder.

the xml snippet added is similar to this:

<config evaluator="node-type" condition="my:sop1">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="my:birthDate" />
         <show-property name="my:field2" />
       </property-sheet>
   </config>

gutierrez_ge
Champ in-the-making
Champ in-the-making
still nothing,

lets see..

on web-client-config-custon.xml located on alfresco/extension (also this file is on alfresco/ and have the same snipplet, but i didnt added, it was already there, i just added the snipplet to try it out)

i have this

<config evaluator="aspect-name" condition="my:imageClassification">
  <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"
                show-in-edit-mode="false"/>
  </property-sheet>
</config>

on alfresco/extension i have exampleModel.xml that is the same code that the documentation explain

also i have a example-model-context.xml that have this snipplet

    <bean id="extension.dictionaryBootstrap"
   parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/exampleModel.xml</value>
            </list>
        </property>
    </bean>
and on the web-client-config located on alfresco/

i have this

    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/exampleModel.xml</value>
            </list>
        </property>
    </bean>

any comment?, Thanks

gavinc
Champ in-the-making
Champ in-the-making
To see these properties the node in the repository has to have had the "my:imageClassification" aspect applied.

The config you have uncommented is saying show these properties when the my:imageClassification aspect is present.

To add the aspect you need to either setup a rule or use the "Run Action" action on a node details page. However, to make sure this aspect is available for selection you need to uncomment the section in web-client-config-custom.xml that looks like the config below:

<config evaluator="string-compare" condition="Action Wizards">
   <aspects>
      <aspect name="my:imageClassification"/>
   </aspects>
</config>

Once you've done that and restarted the server go to a node's details page and select "Run Action". For the action chooose "Add an aspect", then select Image Classification. After the wizard is finished you should now see the 3 properties.

Hope this helps.

gutierrez_ge
Champ in-the-making
Champ in-the-making
thanks, it works now..