Use folder properties and user input on share custom page

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

Use folder properties and user input on share custom page

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.

3 Replies
Highlighted
Senior Member II

Re: Use folder properties and user input on share custom page

Your question is bit not clear to me.

When we click on custom action, do you want something like below?

  1. Clicking on custom action should open up one dialogue/form.
  2. After filling up the data , it should get redirected to a new page which displayed the properties in edit/view mode.

What is the exact business requirement for this?

Highlighted
Member II

Re: Use folder properties and user input on share custom page

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

Highlighted
Senior Member II

Re: Use folder properties and user input on share custom page

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.