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

priyanka_nayak
Champ in-the-making
Champ in-the-making
Hi,
Sending you the codes where I have made changes.

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

web-client-config-custom.xml
  <!– add blog types to teh add content list –> 
   <config evaluator="string-compare" condition="Action Wizards">
     <aspects>
         <aspect name="custom:CustomerDetails"/>
      </aspects>
   </config>
  
    <config evaluator="aspect-name" condition="custom:CustomerDetails">
      <property-sheet>
      <separator name="sepCust1"  display-label="Customer Details"
       component-generator="HeaderSeparatorGenerator"/>
         <show-property name="custom:CustomerName"/>
         <show-property name="custom:CustomerContactName"/>
         <show-property name="custom:CustomerProjectID"/>
      </property-sheet>
   </config>

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

<!– Custom Model –>
<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!– types and aspects added here will automatically be registered –>

<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Custom Model</description>
   <author></author>
   <version>1.0</version>

   <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 custom.model should be changed to reflect your own namespace –>
   <!–namespaces>
      <namespace uri="http://www.google.com/model/content/1.0" prefix="custom"/>
      <!–namespace uri="http://www.alfresco.org/model/content/1.0" prefix="custom"/ –>
   <!–/namespaces–>



<namespaces>
   <namespace uri="wipro.custom.model" prefix="custom"/ >
</namespaces>



   <!–aspects>
       <aspect name="custom:NewDetails">
         <properties>
           <property name="custom:MYNewDetails">
             <title>My New Details</title>
             <type>d:text</type>
           </property>
         </properties>
      </aspect>
   </aspects–>


<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>

</model>


Plez reply bac…Its urgent..
Priyanka


Edited by moderator to enclose XML in code tags. Please remember to use the Code tags when posting code on the forum. Thanks.

dhalupa
Champ on-the-rise
Champ on-the-rise
You did not close namespace tag properly, besides that I did not found anything wrong. Try pasting model below..

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

<!– Custom Model –>
<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!– types and aspects added here will automatically be registered –>

<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Custom Model</description>
   <author></author>
   <version>1.0</version>

   <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>

   <namespaces>
      <namespace uri="wipro.custom.model" prefix="custom" />
   </namespaces>

   <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>

</model>

priyanka_nayak
Champ in-the-making
Champ in-the-making
no its still not working…can you just tell me whether there are any other files other than the three where the changes are to be made..

fhomasp
Champ in-the-making
Champ in-the-making
If I'm not mistaken you'll need to define a model first and then the aspect.  I declared the model after the namespace declaration and I enclosed the model in the <types> modelstuff</types> tags.

<types>
  
      <!– Definition of new Content Type: Real CV –>
      <type name="rls:cv">
         <title>Real CV</title>
         <parent>cm:content</parent>
         <properties>
            <property name="rls:name">
               <type>d:text</type>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>cm:versionable</aspect>
            <aspect>rls:locatable</aspect>           
         </mandatory-aspects>
      </type>
     
</types>

<!–aspect definitions go here–>

I don't think you need mandatory aspects, but you need a type defined between the types tag.

Hope it helps Smiley Wink

priyanka_nayak
Champ in-the-making
Champ in-the-making
Hi everybody,

Thanks a lot for ur prompt replies…
it helped alot…
Can anybody tell me how to add a drop-down box as a aspect…

Priyanka

ajs
Champ in-the-making
Champ in-the-making
I have the same problem than priyanka.nayak. I have made the same changes… and modifications… but still have the same problem Smiley Frustrated