cancel
Showing results for 
Search instead for 
Did you mean: 

Association customization in Share

ttati
Champ in-the-making
Champ in-the-making
Hi
I created a new custom model called mymodel1in alfresco with some properties and an association to mymodel2.

When I render it in Share I can click on create–>newmodel1 and I can associate the newmodel1 object to an existing newmodel2 object.

what I can't do is to click on create –>newmodel1 and to get a button in the form to create newomodel2 instead of the button "select"

Is it possible to customize share/document-library to do that?
3 REPLIES 3

lementree
Champ on-the-rise
Champ on-the-rise
Yes Possible,

You need to create a custom Controller, that would show the upload dialogue and uploads the file and add as association.

ttati
Champ in-the-making
Champ in-the-making
that's great.
It not 100% clear what you mean with Controller, a webscript?
Could you please be more specific?
actually my target type is not cm:content it is a custom model it self so I don't have a simple file to upload but a new  obj to create. Do you have any idea about how I can implement that in share?

thanks a lot

lementree
Champ on-the-rise
Champ on-the-rise
Hi,

In share every form filed is rendered by a Controller.

You can find the OOB controllers in tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls.

Now you need to implement a Custom Controller, that wolud have a button, onclick it would open create content Dialouge, onSuccess you wil get the created nodeRef, you assign this node ref to association field.

You can take a look into the association.ftl, how it is working.