Alfresco share UI form for custom model

540 Views Asked by At

I'm using Alfresco one 5.1 Enterprise edition. I've created a custom content model using the Model Manager in Alfresco & it has some custom properties (ds:prority, ds:action, ds:actionText, ds:linkURL, etc) associated with it. I would like to customize Share UI to include these custom properties alongside the default cm:content properties (cm:content, cm:description, cm:title, etc). I'm referring to Jeff Potts post on ecmarchitect to use custom model & share UI customization.

Now my question is, can I use the model created in Alfresco Model Manager & create a customized Share form along with these custom properties. All the examples for this process I see content model definition done in a Alfresco repo AMP and then have the Share form customization done in an Alfresco share amp. Can I create the share AMP alone (for my Share UI Customization) & still refer the model which I've already created in Alfresco Model Manager ?

2

There are 2 best solutions below

1
On BEST ANSWER

As pointed out by Murali, once the model is active, we can create a Share AMP as pointed out in Jeff Potts tutorial, create a share amp archive using maven target (mvn package) and deploy the same to alfresco amps_share folder (/alfresco_one/amps_share) and then apply the same with the apply_amps.sh command in /bin/apply_amps.sh and then restart alfresco.

Note for my requirement I needed the custom properties to be part of inline-edit screen of share only. So I added the

<config evaluator="node-type" condition="<my model>">
...
   <form id="doclib-inline-edit">
   ...
   <show id="my:property" force="true" /> 
   ...
...
</config>

Initially I had cm:content in the condition evaluator & it didn't work. Only after updating it to my model name it started reflecting the changes.

Note: without restarting Alfresco the changes are not reflecting.

5
On

You can use model console to list out created & deployed models.

http://IP:Port/alfresco/s/enterprise/admin/admin-repoconsole

Command : show models

If you're able to see your model with loaded (isLoaded) status as "Yes" then you can deploy on the share amp should be fine. Have you created this model in your development machine or production machine? If it is development machine, you need the Repo amp to deploy the model in the production machine.

##
##  Model Admin Commands
##

ok> show models

    Show deployed models - that are stored in the repository data dictionary.

ok> deploy model 

    Upload model to repository and load into runtime data dictionary. This will also
    set the repository model as active. 

    If a model is already deployed then it will be updated and re-deployed.

    e.g. deploy model alfresco/extension/exampleModel.xml

ok> undeploy model 

    Permanently delete model from repository (all versions) and unload from runtime data dictionary.

    e.g. undeploy model exampleModel.xml

ok> activate model 

    Set repository model to active and load into runtime data dictionary.

    e.g. activate model exampleModel.xml

ok> deactivate model 

    Set repository model to inactive and unload from runtime data dictionary. 

    e.g. deactivate model exampleModel.xml

As you're using Enterpise edition, you can get in touch with Alfresco support also.

Hope this helps you.