Showing posts with label Share. Show all posts
Showing posts with label Share. Show all posts

Saturday, November 30, 2013

Disable Download Action in offline editing



      How to disable Download Action in Document Library when a document is locked for offline editing?

Using Evaluator: evaluator.doclib.action.isWorkingCopy (An OOTB evaluator which checks whether a node is a working copy or not), we can configure Download Action to be visible or not in the UI.

Add the following entry in Alfresco_Home/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml file.

< !-- Document Library Actions config section -- >
< config evaluator="string-compare" condition="DocLibActions" >

    < !--
       Action definitions
    -- >
    < actions >
       
       < !-- Download document -- >
       < action id="document-download" type="link" label="actions.document.download" >
         
         < param name="href" >{downloadUrl}</ param >

       < !--
       Evaluator to Disable Download action when document is locked by a user
       -- >
          < evaluator negate="true" >evaluator.doclib.action.isWorkingCopy</ evaluator >
       </ action >


    </ actions >
</ config >

     For more info, refer following link: 

Disable Publish Action in Share Document Library


      How to disable Publish Action in Document Library for all the users?

Using Evaluator, we can configure Document Actions to be visible or not in the UI.

Add the following entry in Alfresco_Home/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml file.


< !-- Document Library Actions config section -- >
<config evaluator="string-compare" condition="DocLibActions">

    < !--
       Action definitions
    -- >
    < actions>

        < !-- Publish document -- >
         < action id="document-publish" type="javascript" label="actions.document.publish" >

            <param name="function">onActionPublish</param>

            < !--
             Evaluator to disable Pulish Document Action for all users.
            -- >
            < evaluator>evaluator.doclib.action.disableAction</ evaluator>

            < evaluator negate="true"> evaluator.doclib.action.isLocked</ evaluator>
         </ action>

    </ actions>
</ config>

evaluator.doclib.action.disableAction :  This is an OOTB evaluator which always return false.

For more info, refer following link:
OOTB evaluators: http://wiki.alfresco.com/wiki/Document_Library_Predefined_Evaluators

Friday, December 7, 2012

Configure SOLR and Alfresco to use HTTP protocol


In Association with Amazon.in

How to configure SOLR to use plain HTTP protocol instead of HTTPS for Alfresco v4.0.x on Ubuntu?

On SOLR server, which is deployed on a separate tomcat, we have to configure plain HTTP protocol in order to communicate with Alfresco server.

1) Stop Solr tomcat.
/var$ sudo /etc/init.d/tomcat6 stop

2) Delete indexes directory of each core to rebuild new indexes.

/var/alfsolr/workspace/SpacesStore is the index directory for workspace-SpacesStore core and /var/alfsolr/archive/SpacesStore is the index directory for archive-SpacesStore core.

/var$ sudo rm -rf /var/alfsolr/workspace/

/var$ sudo rm -rf /var/alfsolr/archive/

3) For each core, edit solrcore.properties file and set alfresco.port to proper HTTP port number & alfresco.secureComms=none.

/var/alfsolr/workspace-SpacesStore/conf/solrcore.properties &
/var/alfsolr/archive-SpacesStore/conf/solrcore.properties files.

# Top level directory path for the indexes managed by Solr.
data.dir.root=/var/alfsolr

# Alfresco hostname
alfresco.host=api.alfresco.com

# Alfresco HTTP port
alfresco.port=8080

# Alfresco HTTPS port
alfresco.port.ssl=8443

# Value can be https or none
alfresco.secureComms=none

Change the ownership of each file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/alfsolr/workspace-SpacesStore/conf/solrcore.properties

/var$ sudo chown tomcat6:tomcat6 /var/alfsolr/archive-SpacesStore/conf/solrcore.properties

4) Now, Alfresco will talk over plain HTTP protocol with Solr. So, comment the specification of the connector on port 8443 in /var/lib/tomcat6/conf/server.xml file.

< !-- Comment below code -- >
< !--
< Connector
port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
SSLEnabled="true" maxThreads="150" scheme="https"
keystoreFile="/var/alfsolr/keystore/ssl.keystore"
keystorePass="kT9X6oe68t" keystoreType="JCEKS"
secure="true" connectionTimeout="240000"
truststoreFile="/var/alfsolr/keystore/ssl.truststore"
truststorePass="kT9X6oe68t" truststoreType="JCEKS"
clientAuth="false" sslProtocol="TLS"
allowUnsafeLegacyRenegotiation="true" maxSavePostSize="-1"
/ >
-- >

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/conf/server.xml

5) Comment/Remove the following user in /var/lib/tomcat6/conf/tomcat-users.xml file.

< !--
< user
username="CN=Alfresco Repository, OU=Unknown, O=Alfresco
Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repository"
password="null"
/ >
-- >

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/conf/tomcat-users.xml

6) Comment/Remove the following configuration in /var/lib/tomcat6/webapps/solr/WEBINF/web.xml

< !--
< security-constraint >
< web-resource-collection >
< url-pattern >/*</ url-pattern >
</ web-resource-collection >
< auth-constraint >
< role-name >repository</ role-name >
</ auth-constraint >
< user-data-constraint >
< transport-guarantee >CONFIDENTIAL</ transport-guarantee >
</ user-data-constraint >
</ security-constraint >
< login-config >
< auth-method >CLIENT-CERT</ auth-method >
< realm-name >Solr</ realm-name >
</ login-config >
< security-role >
< role-name >repository</ role-name >
</ security-role >
-- >

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/webapps/solr/WEBINF/web.xml

Next, we need to configure Alfresco server, which is deployed on a separate tomcat to communicate over plain HTTP protocol with SOLR server.

1) Stop Alfresco tomcat.
/var$ sudo /etc/init.d/tomcat6 stop

2) Edit following properties in /var/lib/tomcat6/shared/classes/alfresco-global.properties file.

### Alfresco properties ###

#Alfresco hostname
alfresco.host=api.alfresco.com

#HTTP port number
alfresco.port=8080

#Value can be http or https
alfresco.protocol=http

### Solr indexing ###

# Absolute Path to your keystore directory for configuring Alfresco to talk to SOLR
# This will not be used for HTTP communication. Comment this property.
#dir.keystore=/var/alfsolr/keystore

# The subsystem type value. Value is either solr or lucene.
index.subsystem.name=solr

# Solr hostname.
solr.host=solr.alfresco.com

# Solr HTTP port.
solr.port=8080

# Solr HTTPS port.
solr.port.ssl=8443

# Value can be https or none.
solr.secureComms=none

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/shared/classes/alfresco-global.properties

3) Comment the specification of the connector on port 8443 in /var/lib/tomcat6/conf/server.xml file.

< !--
< Connector
port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
SSLEnabled="true" maxThreads="150" scheme="https"
keystoreFile="/var/alfresco/alf_data/keystore/ssl.keystore"
keystorePass="kT9X6oe68t" keystoreType="JCEKS"
secure="true" connectionTimeout="240000"
truststoreFile="/var/alfresco/alf_data/keystore/ssl.truststore"
truststorePass="kT9X6oe68t" truststoreType="JCEKS"
clientAuth="false" sslProtocol="TLS"
allowUnsafeLegacyRenegotiation="true" maxSavePostSize="-1"
/ >
-- >

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/conf/server.xml

4) Comment/Remove the following user in /var/lib/tomcat6/conf/tomcat-users.xml file.
< !--
< user
username="CN=Alfresco Repository Client, OU=Unknown, O=Alfresco
Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repoclient"
password="null"
/ >
-- >

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/conf/tomcat-users.xml

5) Comment/Remove the following configuration in /var/lib/tomcat6/webapps/alfresco/WEBINF/web.xml

< !--
< security-constraint >
< web-resource-collection >
< web-resource-name >SOLR</ web-resource-name >
< url-pattern >/service/api/solr/*</ url-pattern >
</ web-resource-collection >
< auth-constraint >
< role-name >repoclient</ role-name >
</ auth-constraint >
< user-data-constraint >
< transport-guarantee >CONFIDENTIAL</ transport-guarantee >
</ user-data-constraint >
</ security-constraint >
< login-config >
< auth-method >CLIENT-CERT</ auth-method >
< realm-name >Repository</ realm-name >
</ login-config >
< security-role >
< role-name >repoclient</ role-name >
</ security-role >
-- >

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/webapps/alfresco/WEBINF/web.xml

6) Start Alfresco tomcat server.
/var$ sudo /etc/init.d/tomcat6 start

7) After Alfresco server is up, start tomcat server that has Solr Web Application deployed on a separate Ubuntu box.
/var$ sudo /etc/init.d/tomcat6 start

For more info, refer following links:
1) http://wiki.alfresco.com/wiki/Alfresco_And_SOLR
2) http://wiki.alfresco.com/wiki/Alfresco_Solr_Demo_Script



In Association with Amazon.in