cancel
Showing results for 
Search instead for 
Did you mean: 

Highlight folder by rule

d_franz
Champ on-the-rise
Champ on-the-rise
I am looking for a method to highlight a folder (or change its logo) if a rule of it hits. Is there a script I can use to change the appearance?

I am happy over every proposal
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
In Alfresco 4.0 there are these "indicators" that can be configured to show up based on your criteria. An out-of-the-box example is when you upload an image that has geographic metadata (or you add the geographic aspect to any document) a little pushpin shows up. Another example is the Dropbox integration. When a document is sync'd to Dropbox it gets a little Dropbox icon.

So you would have your rule set a piece of metadata and/or add a custom aspect. Then the evaluator would look for the presence of that aspect to decide whether or not to show the custom indicator.

If this might work for your needs, you can learn how to do your own custom evaluator (the thing that decides whether or not to display the indicator) and the custom indicator by reading pages 25 - 27 of this tutorial.

If an indicator won't meet your needs you might be able to use some of the new extension points in Share 4.0 to swap out the folder icon based on some criteria. I don't know of any examples that do that explicitly, but you might see if Mike's presentation from last year's DevCon on Document Library extension points helps.

You might also check out Dave Draper's Tech Talk Live on the subject.

Jeff

d_franz
Champ on-the-rise
Champ on-the-rise
Thank you!

I will check this the next days. Hopefully I can post a report about my results.

d_franz
Champ on-the-rise
Champ on-the-rise
OK, now it works.

In short steps what I have done:

Created two Indicators in share-config-custom.xml:

   <!– Document Library config section –>
   <config evaluator="string-compare" condition="DocumentLibrary" replace="true">
      <!– Custom Indicators –>
     <indicators>
          <indicator id="noarchiv" index="10" icon="nonciarchiv-indicator-16.png" label="Nicht Eingepflegt">
              <evaluator negate="true">evaluator.doclib.indicator.noarchiv</evaluator>
          </indicator>
          <indicator id="archivfolder" index="10" icon="archivfolder-indicator-16.png" label="Einpflegen nicht notwendig">
              <evaluator>evaluator.doclib.indicator.archivfolder</evaluator>
              <override>noarchiv</override>
          </indicator>
      </indicators>
    </config>         

created a Bean config custom-slinghot-application-context.xml.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   <bean id="evaluator.doclib.indicator.noarchiv" class="org.alfresco.web.evaluator.HasAspectEvaluator">
      <property name="aspects">
         <list>
            <value>prefix:archivalInfo</value>
         </list>
      </property>
   </bean>
   <bean id="evaluator.doclib.indicator.archivfolder" class="org.alfresco.web.evaluator.HasAspectEvaluator">
      <property name="aspects">
         <list>
            <value>prefix:archivFolder</value>
         </list>
      </property>
   </bean>
</beans>

created two new icons: archivfolder-indicator-16.png; nonciarchiv-indicator-16.png

Additionally I have a rule that applys the aspect "prefix:archivFolder" to every new created Folder.

Now every File that doesn't have the aspect "prefix:archivalInfo" applied gets the Icon nonciarchiv-indicator-16.png in front of it. In case of a folder this icon is replaced (overridden) by archivfolder-indicator-16.png that in my case is a blank icon.