cancel
Showing results for 
Search instead for 
Did you mean: 

How to add new properties

lyagueca
Champ in-the-making
Champ in-the-making
Hi,
I want to add new properties to the documents, depending on their folder of storage.
What do I need to do?
Is the following example possible?

folderInvoice
     documents
    property -> InvoiceNumber
                property -> name
                property -> tittle
                property -> client
folderImages
      documents
    property -> name
                property -> camera
                property -> date
Thx in advance.
4 REPLIES 4

ribz33
Champ on-the-rise
Champ on-the-rise
Hi,

i think you need to implement two new content type.
And you will choose which type you want when you add content.
I dont think you can do it automatically.

see http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Step_by_Step_Model_Definition
to define new content type…

After if someone add an ImageDocument in folderInvoice, you can do a Script+rule which move new ImageDocument to ImageFolder.

In my view, I think this is more flexible and like that you can reuse your ImageDocument and InvoiceDocument in other palce of your repository Smiley Wink

best regards

lyagueca
Champ in-the-making
Champ in-the-making
hi,
ribz33

Thanks for your answer!

I've followed the steps in your link:
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Step_by_Step_Model_Definition

but, I still don't manage to get it right. I get stuck after step 5, "testing the model definition".

My question is: should I only modify files.xml to create the new model definition? If that is the case, which files need I create or modify and where?

I've tried to put the following files:
exampleModel.xml
example-model-context.xml
web-client-config-custom.xml

( taken from this folder:
C:\Program Files\alfresco-1.3.0\tomcat\shared\classes\alfresco\extension
with the extension .sample
)

into this folder:

C:\Program Files\alfresco-1.3.0\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension


But I havn't been able to do anything else, and I can't see the modifications in the Web Client

So, for any help you could give I would be very grateful.

many thanks,
Luis

ribz33
Champ on-the-rise
Champ on-the-rise
ok,
if you want to see model working quickly look in your dowloaded archive you have an extension folder (when you dezzip it)
copy in this extension folder this 3 files :
exampleModel.xml
example-model-context.xml
web-client-config-custom.xml

and paste them in
C:\Program Files\alfresco-1.3.0\tomcat\shared\classes\alfresco\extension
(for tomcat servers)

after edit web-client-config-custom.xml and uncomment this code :
   <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>

This code add your new "example model" in your web client…
Now reboot your server, add a content and look you can choose "content" or your new model type (its magic Smiley Wink lol )
And with code that you had uncommented you had added also your model in advanced search take a look to advance searh to see it Smiley Wink

Now you have (i expect) a working model you can try to modify it or create others with same architecture to do what you want.

I expect that will help you…

bst regards

lyagueca
Champ in-the-making
Champ in-the-making
hi again,

thank you so much for all your help - I finally got the new model working!!

  Smiley Very Happy