Customizing package items in workflow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2012 09:57 AM
Hello
I would like to customize worfklow form for items - bpm
ackage,
in such a way that instead of description for a package item
it would show title property of an item( cm:title ).
I know that packageitems.ftl is used for the bpm
ackage in share,
but I can't be configured here which document properties are shown here.
So if I would like to customize which properties are shown in package items,
where do I have to make changes. I have tried making changes in document-picker-min.js
( I can see code for outputing name and description or name only if in compact mode there )
but there is no difference visible. I am using version 4.b
Thank you for your answers.
I would like to customize worfklow form for items - bpm

in such a way that instead of description for a package item
it would show title property of an item( cm:title ).
I know that packageitems.ftl is used for the bpm

but I can't be configured here which document properties are shown here.
So if I would like to customize which properties are shown in package items,
where do I have to make changes. I have tried making changes in document-picker-min.js
( I can see code for outputing name and description or name only if in compact mode there )
but there is no difference visible. I am using version 4.b
Thank you for your answers.
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2012 03:58 PM
The packageitems.ftl form control augments the object-finder control instantiated in WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/forms/controls/common/picker.inc.ftl. You need not adjust anything here.
The object-finder can be found in components/object-finder/object-finder.js. To change the contents of the item details you need to adapt function ObjectFinder_fnRenderCellListItemName on line 1313
You can create your own javascript file and extend the objectFinder using YAHOO.lang.augmentObject. Copy ObjectFinder_fnRenderCellListItemName and adapt it. Make sure you use overwrite=true on the YAHOO.lang.augmentObject when overriding the function.
BTW you were editing the minified version of the javascript (all files with '-min' suffix) which can be unpractical. In the alfresco svn you can find the original files. On the alfresco wiki there are instructions on how to yui minify your own scripts before deploying them.
Hope this helps.
The object-finder can be found in components/object-finder/object-finder.js. To change the contents of the item details you need to adapt function ObjectFinder_fnRenderCellListItemName on line 1313
You can create your own javascript file and extend the objectFinder using YAHOO.lang.augmentObject. Copy ObjectFinder_fnRenderCellListItemName and adapt it. Make sure you use overwrite=true on the YAHOO.lang.augmentObject when overriding the function.
BTW you were editing the minified version of the javascript (all files with '-min' suffix) which can be unpractical. In the alfresco svn you can find the original files. On the alfresco wiki there are instructions on how to yui minify your own scripts before deploying them.
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2012 12:15 PM
Yes I had to change in object picker as you said.
Now I have another problem, unrelated to previous one, but I am going to use the same topic for it.
I wanted to change the content of package in forms,
so I could copy the document title to workflow property in start task(always only one document in workflow).
I have managed to copy the title by having a button in forms that does that with javascript(so user can have a choice where to copy the
documen title or not). But I have a problem now. The property where I copied title to is mandatory(the only mandatory property) and
even though the property has value now(text data type, I use ordinary text field), I can't start workflow, the button is grayed out. If I make a change in
input field the I can start the workflow. Also if I type something in the input field, and then copy by clicking on button, I can also start workflow
Any suggestion?
Thanks for answers
EDIT: I have solved the problem.
I had to use the mandatory validator on the field for event that I trigered with javascript
Now I have another problem, unrelated to previous one, but I am going to use the same topic for it.
I wanted to change the content of package in forms,
so I could copy the document title to workflow property in start task(always only one document in workflow).
I have managed to copy the title by having a button in forms that does that with javascript(so user can have a choice where to copy the
documen title or not). But I have a problem now. The property where I copied title to is mandatory(the only mandatory property) and
even though the property has value now(text data type, I use ordinary text field), I can't start workflow, the button is grayed out. If I make a change in
input field the I can start the workflow. Also if I type something in the input field, and then copy by clicking on button, I can also start workflow
Any suggestion?
Thanks for answers
EDIT: I have solved the problem.
I had to use the mandatory validator on the field for event that I trigered with javascript
