Hi!
I'm trying to add some extra functionality to Alfresco Document Library and as I'm new to Alfresco I would like to ask you for some assistance.
What is needed (as example):
1. Create folder
2. Apply custom type demoFolder to the folder (done)
3. Populate demoFolder properties First Name and Last Name with required data (done)
4. Add custom Action Demo Action (done)
5. When Demo Action is triggered - open custom Share demo-page (done)
<config evaluator="string-compare" condition="DocLibActions">
<actions>
<action id="demo.action.execute"
icon="demo-icon"
type="page"
label="demo.action.execute.label">
<param name="page">demo-page?nodeRef={node.nodeRef}</param>
<evaluator>com.demo.actionEnabled</evaluator>
</action>
</actions>
The question is:
1. How get folder properties First Name and Last Name from within page template and show it on the page?
2. Is any possibility to get user input before opening custom page and then use this input data and folder properties on the custom page? As it is done in the documentation sample code (but sample code redirects to the backend action and not to the custom page).
<action id="alfresco.tutorials.doclib.action.sendAsEmail" icon="email" type="javascript" label="alfresco.tutorials.doclib.action.sendAsEmail.label"> <param name="function">onActionFormDialog</param> <param name="itemKind">action</param> <param name="itemId">send-as-email</param> <param name="mode">create</param> <param name="destination">{node.nodeRef}</param>
3. Or using the javascript type action is it possible to collect all required data (folder properties, user form input data) on the action implementation (ActionExecuterAbstractBase) and pass it to the custom page demo-page to render it based on that data?
Or you can suggest other way of implementing it.
Thanks in advance for any help.
Your question is bit not clear to me.
When we click on custom action, do you want something like below?
What is the exact business requirement for this?
Hi Krutik!
Thanks for the response.
Yes, that's exactly what we want. Get user input data via form and when submit - open custom page displaying entered data by user and properties from the container where this action was executed.
Let's suppose tha folder has properties:
First Name: Oleh
Last Name: Lylak
User execute custom action and enter additional values using form:
Product: Book
Amount: 100
After form submit we want to be redirected to custom page showing those values.
I want to know how I can achive it? possible solutions.
Thanks
Well its bit difficult, but you can achieve this.
Basically you need to use javascript function for this.Default javascript function like onActionFormDialog or onActionSimpleRepoAction are defined in below file on alfresco share.
share-war\components\documentlibrary\actions.js
You can take reference of above mentioned functions in the actions.js file and create new javascript function as per the requirement and finally redirect user to edit properties or the page which want.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.