cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Custom Aspects

vpps
Champ in-the-making
Champ in-the-making
Hi,

I'm somewhat new to Alfresco and have been familiarizing myself with the wiki, forum and Packt book.

Now I’m trying to create a custom aspect for which I’ve modified the following files in the alfresco/extension folder:
•   custom-model-context.xml
•   customModel.xml
•   and web-client-config-custom.xml

But on restarting the Alfresco server, when I try to create a business rule in the webclient UI, in the Create Rules Wizard – Set action values, I do not see the newly created custom aspect to set as a rule.

I tried the example-model-context.xml, exampleModel.xml and web-client-config-custom.xml, but it still did not work.

Could you suggest as to what the problem could be….

Thanks,
Padma
15 REPLIES 15

vpps
Champ in-the-making
Champ in-the-making
Would it help if I provided extracts of the custom-model-context.xml, customModel.xml and/or and web-client-config-custom.xml ?

Please advice.

This would be a great help, since I'm waiting on this to complete a prototype with Alfresco, so as to leverage the work on future client projects.

vpps
Champ in-the-making
Champ in-the-making
Just noticed that the section in the web-client-config-custom.xml was commented out somewhere earlier in the file….

Wish I'd noticed it earlier….

Anyway, sorry about that.

christophes
Champ in-the-making
Champ in-the-making
Have you modified your web-client-config-custom.xml as below ?

   <config evaluator="aspect-name" condition="prefix:nameOfAspect">
      <property-sheet>
         <show-property name="prefix:metadata1"/>
         <show-property name="prefix:metadata2"/>
         <show-property name="prefix:metadata3"/>
         <show-property name="prefix:metadata4"/>
      </property-sheet>
   </config>

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

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-aspect>
            <aspect name="prefix:nameOfAspect" />
         </content-aspect>
         <custom-properties>
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata1" />
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata2" />
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata3" />
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata4" />
         </custom-properties>
      </advanced-search>
   </config>
The most important part for you is the second config's node. Hope that will help you.

Christophe

vpps
Champ in-the-making
Champ in-the-making
I've completed the 1st two sections in the web-client-config-custom.xml, namely the following (after which I'm able to create a business rule using the custom aspect in the web client):


<config evaluator="aspect-name" condition="prefix:nameOfAspect">
      <property-sheet>
         <show-property name="prefix:metadata1"/>
         <show-property name="prefix:metadata2"/>
         <show-property name="prefix:metadata3"/>
         <show-property name="prefix:metadata4"/>
      </property-sheet>
   </config>

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


The above appears to link the aspect properties such that the aspect and the properties appear in the web client while creating a business rule on the aspect.

Regarding the last section, could you clarify as to why this is required or what it does:


<config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-aspect>
            <aspect name="prefix:nameOfAspect" />
         </content-aspect>
         <custom-properties>
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata1" />
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata2" />
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata3" />
            <meta-data aspect="prefix:nameOfAspect" property="prefix:metadata4" />
         </custom-properties>
      </advanced-search>
   </config>

maxlint
Champ in-the-making
Champ in-the-making
I am having the same issue you described.  Have resolved this issue yet?  I followed the examlpe in Alfresco Book from chapter 7.  Alfresco boots with no errors, but I don't see my custom aspect.

priyanka_nayak
Champ in-the-making
Champ in-the-making
Hi ,
While adding a new aspect in custommodel.xml like in the code below, I am getting exception : org.alfresco.service.cmr.dictionary.InvalidAspectException: The aspect is invalid: {custom.model}CustomerDetails

My code is:
<aspects>
<aspect name="custom : CustomerDetails">
<title>Customer Details</title>
<properties>
<property name="custom : CustomerName">
<title>Customer Name</title>
<type>d:text</type>
</property>
<property name="custom : CustomerContactName">
<title>Customer Contact Name</title>
<type>d:text</type>
</property>
<property name="custom : CustomerProjectID">
<title>Customer Project ID</title>
<type>d:int</type>
</property>
</properties>
</aspect>
</aspects>

Plez reply bac…Its very urgent..
Regards,
Priyanka

rivarola
Champ on-the-rise
Champ on-the-rise
Hello,

Seems there are blank spaces around the : in your property names.

priyanka_nayak
Champ in-the-making
Champ in-the-making
Even if i reply blank spaces its giving the same exception..

dhalupa
Champ on-the-rise
Champ on-the-rise
Could you post entire model definition and enclose it with "code" tags in order to be more readable?

Kind regards,

Denis