cancel
Showing results for 
Search instead for 
Did you mean: 

Remove some panels from document details page

namoo
Champ in-the-making
Champ in-the-making
Hi

I would like remove some panels from document details page of Alfresco Share. I'm using Alfresco Community 4.0b version.
In my share-config-custom.xml file I added follwoing configuration:


  …
  <config evaluator="string-compare" condition="DocumentDetails" replace="true">
    <document-details>
      <!– display web previewer on document details page –>
      <display-web-preview>true</display-web-preview>
    </document-details>
  </config>
  …
I think I need to add a tag something like this: <display-tags-panel>false</display-tags-panel>.
I know this is not working.

Also, I want to change the order of panels. I want to put "Properties" at the top of the page.

Any help?
Thank you!
7 REPLIES 7

erikwinlof
Confirmed Champ
Confirmed Champ
This is a excellent example of how to use all the new extensibility features that we have put into Alfresco Community 4.0.  What you want to to is to create an extension module that tells Share to evaluate which components (note the plural, it is now possible to add and remove multiple components into the same region) that shall be rendered inside a region. The idea is that you provide an evaluator that, in runtime, can decide if a component shall be added or not depending on its context (which page, site, preset the site has, user role etc).

There's now a post about this topic (and also about adding & replacing panels) in the alfresco blogs, please visit: http://blogs.alfresco.com/wp/ewinlof/2011/11/09/add-remove-or-replace-components-on-shares-document-...

But just to show how easy it is I will post the code you need right below. Simply create a <SHARE_TOMAT_HOME>/shared/classes/alfresco/site-data/extensions/acme-test-extension.xml with the content below.
   
<extension>
   <modules>
      <module>
         <id>Acme :: Test - Remove Tags</id>

         <!– Always apply config in this file –>
         <evaluator type="default.extensibility.evaluator"/>

         <components>

            <!– Remove Tag Panel –>
            <component>
               <scope>template</scope>
               <region-id>document-tags</region-id>
               <source-id>document-details</source-id>
               <sub-components>
                  <sub-component id="default">
                     <evaluations>
                        <evaluation id="acme-test-removeTags">
                           <render>false</render>
                        </evaluation>
                     </evaluations>
                  </sub-component>
              </sub-components>
            </component>

         </components>

      </module>
     
   </modules>
</extension>

Now all you need to do is to restart your server and visit the module deployment ui (http://localhost:8080/share/page/modules/deploy) andmake sure to enable your module by adding it and then click the "Apply" button.

Good luck and dont forget to read the blog posts afterwards!

namoo
Champ in-the-making
Champ in-the-making
Perfect !!! That's what I exactly wanted. Thank you, erikwinlof!

Now, I can customize components on document library, folder details, and document details page! Awesome!!

Besides, blog you referred is really helpful to create my own customized component.

Thank you, again!

dnallsopp
Champ in-the-making
Champ in-the-making
When I try to apply the example as shown above, the Tags panel disappears as expected, but I get the error:

"Could not save deployment configuration, please sure you are authenticated. Changes will not survive server restart."

I am logged in as admin. This is Alfresco Community 4.0.d

ddraper
World-Class Innovator
World-Class Innovator
Hi,

Are you seeing this error in the module deployment console? What you might find is that whilst you're authenticated to Share you're not authenticated directly to the WebScripts service (although the credentials will be the same, the authentication is different). If you're seeing the error appearing in the Share startup logs in Tomcat then it's ugly but nothing to worry about and is actually a factually correct statement but not a problem,

Regards,
Dave

dnallsopp
Champ in-the-making
Champ in-the-making
I saw the error in the module deployment console and also in the logs. My module deployments were not persisted across restarts.

I have now enabled module auto-deploy, which seems to work fine.

Are manual deployments supposed to survive restarts, depsite the error message?

I don't quite understand the point about being authenticated to Share but not the webscript… if separate authentication is required, why aren't I asked to authenticate again?

dnallsopp
Champ in-the-making
Champ in-the-making
One question - why do these extension modules go in

<SHARE_TOMAT_HOME>/shared/classes/alfresco/site-data/extensions/


rather than in the normal web-extension folder as for other customisations, i.e:

<SHARE_TOMAT_HOME>/shared/classes/alfresco/web-extension/…


(or the equivalent web-extension directory within the webapp, i.e.

<SHARE_TOMAT_HOME>/webapps/share/WEB-INF/classes/alfresco/web-extension/…


There seems to be a profusion of special extension directories in Alfresco/Share…!

n_pancholi87
Champ in-the-making
Champ in-the-making
Hi,
i tried these changes on my alfresco 4.1.3, but this didnt work. I went to the deployment console and applied the changes there but the test panel i created is not coming up. Any suggestions?