Showing posts with label DMS. Show all posts
Showing posts with label DMS. Show all posts

Saturday, 1 September 2012

Changing the Alfresco Site Manage Permissions Action

To change the behavior of the Manage Permissions action to be the same as that available from the Share Repository button.

In:
/opt/alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/share-documentlibrary-config.xml
Replace:
<!-- Manage permissions (site roles) -->
<action id="document-manage-site-permissions" type="javascript" icon="document-manage-permissions" label="actions.document.manage-permissions">
<param name="function">onActionManagePermissions</param>
<permissions>
<permission allow="true">ChangePermissions</permission>
</permissions>
<evaluator>evaluator.doclib.action.siteBased</evaluator>
</action>
With:
<!-- Manage permissions (site roles) -->
<action id="document-manage-site-permissions" type="pagelink" icon="document-manage-permissions" label="actions.document.manage-permissions">
<param name="page">manage-permissions?nodeRef={node.nodeRef}</param>
<permissions>
<permission allow="true">ChangePermissions</permission>
</permissions>
<evaluator>evaluator.doclib.action.siteBased</evaluator>
</action>

Reload Alfresco and you should now have the more granular permissions from the Alfresco Share repository browser in the Site Document Library browser.

Possibly Related Posts

Hide Alfresco Share Repository Browser button

To hide the repository link from non-admin users

open this file:
/opt/alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/share-config.xml
find this line within the <header> tags
<item type="link" id="repository" condition="conditionRepositoryRootNode">/repository</item>
Change it to:
<item type="link" id="repository" permission="admin" condition="conditionRepositoryRootNode">/repository</item>
Reload Alfresco. Now only admin users will see that link.
Note that the url will still be accessible, this will only hide the link button.

Possibly Related Posts

Monday, 13 August 2012

Deploying Alfresco To Apache Server

This guide will detail a setup to deploy Alfresco Share to a live server using Tomcat and Apache with mod_jk and mod_ssl it also covers the deployment of the Alfresco's SharePoint interface using Apache with mod_proxy.

Setting up Tomcat

First let's set up a default context so there's no prefix path visible in the URL for Alfresco share. The proper way to do this is by creating the file $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml. When Tomcat is located at /opt/alfresco/tomcat/ the full path will be /opt/alfresco/tomcat/conf/Catalina/localhost/ROOT.xml. Create the following XML document inside the file:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="" docBase="share.war">
</Context>
The path attribute sets the context used in the URL. Using "" as the path thus means 'use as default'. The docBase attribute sets where the real webapp is. When using Alfresco Share this is share.war by default, it's not necessary to use the absolute path.
Now if you restart Tomcat you should be able to reach Alfresco Share at [host]:[port], without specifying the share prefix.
Next we need to setup a connector for Apache. It's possible this is already done on your Tomcat install by default, if not add the following in the Catalina Service section in $CATALINA_BASE/conf/server.xml:
...
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
...
Restart Tomcat again for the connector to be available.

Setting up Apache

If you haven't done already, install mod_jk (libapache2-mod-jk in Ubuntu).
First we define the workers, I used $CATALINA_BASE/conf/workers.properties as configuration file:
worker.list=tomcat
worker.tomcat.port=8009
worker.tomcat.host=localhost
worker.tomcat.type=ajp13
worker.tomcat.lbfactor=1
The name tomcat is arbitrary, so you can replace all occurrences with whatever you like.
Next point Apache to this configuration file. You can either edit your httpd.conf, or if you're using a distribution with a config dir setup (for example, /etc/apache2/conf.d/ in Ubuntu) create a file and add the following content:
JkWorkersFile /opt/alfresco/tomcat/conf/workers.properties
Remember to use your own $CATALINA_BASE if it's not /opt/alfresco/tomcat/.
Finally, setup a virtualhost that will connect to Tomcat:
<VirtualHost *:80>
ServerName share.host.name
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://share.host.name/$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName share.host.name
JkMount /* tomcat
SSLEngine on
SSLCertificateKeyFile /etc/ssl/private/certificate.pem
SSLCertificateFile /etc/ssl/private/certificate.crt
SSLCACertificateFile /etc/ssl/private/authority.crt
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
This will create a virtualhost at share.host.name (replace this with your (sub)domain location), will force port 80/http to be redirected to port 443/https (forces the secure connection, the 301 will tell the browser it's a permanent redirect) and will serve all content (/*) using the worker tomcat as specified in our workers file (if you changed the name there, also change it here). Be sure to enter your own certificate information instead of what I entered.
You can extend this configuration file in the same way you'd normally do with Apache, so you can add rewrite rules etc..
Restart Apache for the configuration to have effect.

You now have Alfresco Share on a user friendly location, with a user friendly and secure setup. If Alfresco explorer is deployed on the same Tomcat instance, you can reach it at https://[host]/alfresco. Your other webapps should also still be reachable at their context path.

If you want to do the same with Alfresco with the SharePoint Protocol you'll have to set up another vhost in Apache, in this case we will use mod_proxy, like this:
<VirtualHost *:80>
ServerName sharepoint.host.name
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://sharepoint.host.name/$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName sharepoint.host.name
SSLEngine on
SSLCertificateKeyFile /etc/apache2/ssl/sharepoint.key
SSLCertificateFile /etc/apache2/ssl/sharepoint.crt
SSLCACertificateFile /etc/apache2/ssl/sharepoint.crt
SSLProxyEngine On
ProxyPass / http://localhost:7070/
ProxyPassReverse / http://localhost:7070/
ProxyPass /alfresco/ http://localhost:7070/alfresco/
ProxyPassReverse /alfresco/ http://localhost:7070/alfresco/
ProxyPass /share/ http://localhost:7070/share/
ProxyPassReverse /share/ http://localhost:7070/share/
ProxyPass /_vti_bin/ http://localhost:7070/_vti_bin/
ProxyPassReverse /_vti_bin/ http://localhost:7070/_vti_bin/
ProxyPass /_vti_inf.html http://localhost:7070/_vti_inf.html
ProxyPassReverse /_vti_inf.html http://localhost:7070/_vti_inf.html
ProxyPass /_vti_history/ http://localhost:7070/_vti_history/
ProxyPassReverse /_vti_history/ http://localhost:7070/_vti_history/
#RewriteCond %{SERVER_PORT} !443
#RewriteRule ^(.*)$ https://sharepoint.host.name/$1 [R,L]
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
Finally, on your Alfresco's global.properties file you'll have to set the following variables:
vti.server.external.host=sharepoint.host.name
vti.server.external.port=443
vti.server.external.protocol=https
so that your Edit Online links are generated correctly.

Possibly Related Posts

Friday, 20 April 2012

Fix alfresco share online preview

Here is what worked for me:

1. Install swftools
sudo apt-get install swftools
2. locate pdf2swf (usually in /usr/local/bin/pdf2swf)
which pdf2swf
3. open your /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
vi /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
edit your default setting to something like this:
ooo.enabled=true
ooo.exe=/usr/bin/soffice
jodconverter.enabled=true
jodconverter.officeHome=/usr/lib/openoffice/program
jodconverter.portNumbers=8101
swf.exe=/usr/local/bin/pdf2swf
save and then restart the alfresco:
alfresco.sh restart


Possibly Related Posts

Sunday, 19 June 2011

OpenKM LDAP auth

Hello, after some time kicking the machine and trying a several configurations, i got it working..

NOTE: for the config options to be red from the file you must first delete the equivalent configs from the web user interface (those are stored in the DB and override the config file)

Checkout the relevant parts of the final configuration files after the break

Possibly Related Posts

Install OpenKM on ubuntu 10.04 LTS

There’re several ways to install it, we use to install in Ubuntu but can be used any other Linux flavor.

Enable the partner repository:
sudo su
vi /etc/apt/sources.lst
Uncomment the following lines:
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
Install needed packages:

Execute on terminal the command
$ sudo aptitude install sun-java6-bin sun-java6-jdk sun-java6-jre imagemagick openoffice.org-core openoffice.org-java-common openoffice.org-writer openoffice.org-impress openoffice.org-calc swftools tesseract-ocr
set the Java Home environment variable
vi /etc/environment
add this line at the end of the file:
JAVA_HOME="/usr/lib/jvm/java-6-sun/"
Now update the environment variables:
# source /etc/environment
Install OpenKM

Download (http://www.openkm.com/Download.html) OpenKM 5.0.x + JBoss 4.2.3.GA bundle and uncompress on your file system disk (a good option is to uncompress under /opt/).

Execute on terminal the command
$ unzip OpenKM-5.0.x-JBoss-4.2.3.GA.zip
For document preview you need add these two entries in the OpenKM.cfg file:
system.openoffice=on
system.swftools.pdf2swf=/usr/bin/pdf2swf
You can configure OpenKM to use a remote server for OpenOffice document conversion:
system.openoffice.server=http://localhost:8080/converter/convert
Or you can configure OpenOffice.org listen port and a maximun conversion tasks:
system.openoffice.path=/usr/lib/openoffice
system.openoffice.tasks=5
system.openoffice.port=2222
Note that system.openoffice.tasks and system.openoffice.port have already a default value and is not needed to be set.

Enabling OCR

To enable OCR you must put the files system path of OCR engine:
system.ocr=/usr/local/bin/tesseract
Enable PS to SWF conversion

To enable postscript document preview, OpenKM need to convert PS files to SWF using the ps2pdf utility from Ghostscript:
system.ghostscript.ps2pdf=/usr/bin/ps2pdf
Enable image preview

To enable image preview, you need to install que ImageMagick convert utility and configure:
system.imagemagick.convert=/usr/bin/convert
Configuring chat service

By default chat and autologin are enabled. In order to enable or disable values can be "on" or "off".
chat.enabled=off
chat.autologin=off
Check http://wiki.openkm.com/index.php/Application_configuration for more information

First login

Execute the file /opt/jboss-4.2.3.GA/bin/run.sh to run OpenKM + JBoss application server.

If you want your OpenKM installation to be accessed from other computers add the -b 0.0.0.0 command line parameter (see Basic application knowledge)

Open on a client browser the URL http://localhost:8080/OpenKM/.

Autenticate to OpenKM using user "okmAdmin" with password "admin".

Note: From OpenKM 5.x there's a property definition in OpenKM.cfg to create automatically database. Once the tables are created, change the hibernate.hbm2ddl property from create to none. Do it after first time running, in other case all repository it'll be deleted and created in next OpenKM starting.

Please take a look at http://forum.openkm.com/ if you have any problem

Possibly Related Posts

Saturday, 4 June 2011

Configure LDAP authentication for Alfresco

Under the /subsystems/authentication structure, there are folders for ldap, passthru, etc. In the ldap folder, there is a .properties file... ldap-authentication.properties.
This is what you have to edit...
Specifying your server, ldap structure, authentication account, if you sync or not, etc. Go through it, there are pretty good explanations in the comments.

Lastly, edit the repository.properties file... add ldap1:ldap to the chain (probably only has alfrescoNtlm on it?) to activate your ldap config. You can also set this in the alfresco-global.properties file
file: /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties
 - or -
file: /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
# The default authentication chain
authentication.chain=ldap1:ldap,alfrescoNtlm1:alfrescoNtlm
restart, test...

Check out the example after the break.

Possibly Related Posts

Install Alfresco on Ubuntu 10.04 LTS

Enable the partner repository:
sudo su
vi /etc/apt/sources.lst
Uncomment the following lines:
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
update your system:
# apt-get update
# apt-get upgrade
Install the needed packages:
# apt-get install mysql-server sun-java6-jdk imagemagick openoffice.org-core openoffice.org-java-common openoffice.org-writer openoffice.org-impress openoffice.org-calc swftools
set the Java Home environment variable
vi /etc/environment
add this line at the end of the file:
JAVA_HOME="/usr/lib/jvm/java-6-sun/"
Now update the environment variables:
# source /etc/environment

Create the alfresco database:
# mysql -uroot -p

CREATE DATABASE alfresco DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL PRIVILEGES ON alfresco.* TO alfresco@localhost IDENTIFIED BY 'alfresco';
GRANT SELECT,LOCK TABLES ON alfresco.* TO alfresco@localhost IDENTIFIED BY 'alfresco';
FLUSH PRIVILEGES;
quit;
Create a directory for alfresco:
# mkdir -p /opt/alfresco# cd /opt/
Download the latest alfresco release (replace the url if necessary)
# wget http://dl.alfresco.com/release/community/build-3370/alfresco-community-3.4.d-installer-linux-x32.bin
# sudo chmod +x alfresco-community-3.4.d-installer-linux-x32.bin
# ./alfresco-community-3.4.d-installer-linux-x32.bin
And follow the wizard

Then point your browser to:

http://yourserver:8080/alfresco (Alfresco DMS)
and
http://yourserver:8080/share (Alfresco Share)


Log in with user:admin e password:admin

Possibly Related Posts