cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding workflow list from alfresco share

sradha
Champ on-the-rise
Champ on-the-rise
Hi,

I want to hide all workflow lists except "Review and Approve" in alfresco share.Can anybody help? :?:
17 REPLIES 17

romschn
Star Collaborator
Star Collaborator
Hi,

You will have to modify documentlist.js file to achieve this.

Below is one simpler way of doing it achieve it.
1. If you want effective form (your custom field) to appear below the description field, search for "this.registerRenderer("description"" in documentlist.js file.
2. Before return statement of the function found in step-1, add below code

                        var customFieldEffectiveFromDate = properties["my:customdate"];
         if(customFieldEffectiveFromDate !== undefined && customFieldEffectiveFromDate !== "")
         {
            html += '<br /><span class="item">Effective From : ' + customFieldEffectiveFromDate + '</span>';
         }

Other way of doing it is instead of modifying the renderer function of description fields, you can write your own renderer for your custom field and register it.

Hope this helps,

Thanks

irene08
Champ in-the-making
Champ in-the-making
Hi! Thank you for your help. One more thing. I changed the 'Effective from' to 'Effectivity date'. I only edited this code in this path. Should I change something in the code you've given me?

C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\model\contentModel.xml

<aspect name="cm:effectivity">
         <title>Effectivity</title>
         <properties>
            <property name="cm:from">
               <title>Effectivity Date</title> <— This is only what I've changed. Before it was 'Effective from'.
               <type>d:datetime</type>
   <index enabled="true">
  <atomic>true</atomic>
  <stored>false</stored>
                  <tokenised>both</tokenised>
               </index>
            </property>
         </properties>
</aspect>

Thank you so much.
Irene

romschn
Star Collaborator
Star Collaborator
you will have to put the name of the property that you are using. In my code, I have given a simple example property named "my:customdate". Looking at your content mode, you will have to use "cm:from" instead of it.

Hope this helps.

Thanks,

irene08
Champ in-the-making
Champ in-the-making
Hi already used the cm:from and it has no effect in the file. If I'm not mistaken, I should add a code in share-documentlibrary-config.xml to appear the Effective from/Effecivity Date.

<!– Default (fallback) –>
     <template id="default">
            <line index="10" id="date">{date}{size}</line>
            <line index="20" id="description" view="detailed">{description}</line>
       <line index="30" id="______________" view="detailed"></line> <— What property name or id should I use here? Is it the cm:from also?
            <line index="40" id="categories" view="detailed" evaluator="evaluator.doclib.metadata.hasCategories">{categories}</line>
            <line index="50" id="social" view="detailed">{social}</line>
      </template>


Thank you.
Irene

romschn
Star Collaborator
Star Collaborator
I hope your documentlist-min.js is having the latest content as of documentlist.js.

Also, ensure that the java script is properly loaded in the browser. Clear cookies/cache and reload the page and re-test.

Hope this helps.

Thanks,

irene08
Champ in-the-making
Champ in-the-making
Hi!

Thank you. But I can't understand the documentlist-min.js. It's a one line code.
The share-documentlibrary-config.xml that I've mention above.
Do it has a connection?

Thank you,
Irene

romschn
Star Collaborator
Star Collaborator
For testing purpose, copy whole code from documentlist.js file to documentlist-min.js file.

Basically, the *-min.js file is a minified version used for better performance.

anon26949
Star Contributor
Star Contributor

It works for 5.1 - 5.2 versions (at least).

In share-config-custom.xml specify the following:

...
   <config evaluator="string-compare" condition="Workflow">
      <hidden-workflows>
           <workflow name="activiti$activitiAdhoc"/>
           <workflow name="activiti$activitiReview"/>
           <workflow name="activiti$activitiParallelReview"/>
           <workflow name="activiti$activitiReviewPooled"/> 
         <workflow name="activiti$activitiParallelGroupReview"/>
      </hidden-workflows>
   </config>
...

Labels for OOTB content-oriented workflows you can find in alfresco-repository-5.2.e.jar\alfresco\workflow\workflow-messages_*.properties