本文描述在Linux系统上安装Alfresco的步骤:
1. 下载安装文件:alfresco-community-5.0.d-installer-linux-x64.bin
2. 增加执行权限并执行:
chmod +x alfresco-community-5.0.d-installer-linux-x64.bin
./alfresco-community-5.0.d-installer-linux-x64.bin
3. 选择安装过程中语言:
Please select the installation language
[1] English – English
[2] French – Français
[3] Spanish – Español
[4] Italian – Italiano
[5] German – Deutsch
[6] Japanese – 日本語
Please choose an option [1] :
4. 输入安装目录
Installation folder
Please choose a folder to install Alfresco Community (Evaluation Use Only)
Select a folder [/opt/alfresco-5.0.d]:
5. 输入管理员(admin)的密码
Admin Password
Please give a password to use for the Alfresco administrator account.
Admin Password: :
6. 重复密码,输入Y,继续安装
7. 安装提示,继续安装,直到完成
8. 访问:
http://127.0.0.1:8080/share
<!–
pre { direction: ltr; color: rgb(0, 0, 0); orphans: 2; widows: 2; }pre.western { font-family: “DejaVu Sans Mono”,monospace; }pre.cjk { font-family: “DejaVu Sans Mono”,monospace; }pre.ctl { font-family: “DejaVu Sans Mono”,monospace; }p { margin-bottom: 0.08in; direction: ltr; color: rgb(0, 0, 0); text-align: justify; orphans: 2; widows: 2; }p.western { font-family: “Trebuchet MS”,sans-serif; font-size: 12pt; }p.cjk { font-family: “Times New Roman”,serif; font-size: 12pt; }p.ctl { font-family: “Times New Roman”,serif; font-size: 12pt; }code { font-family: “DejaVu Sans Mono”,monospace; }a.western:visited { }a.cjk:visited { }a.ctl:visited { }a:link { color: rgb(0, 0, 255); }
–>
-
Create a file extension, named ocr-transform-context.xml into /tomcat/shared/classes/alfresco/extenssion with the following content:
<?
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="transformer.worker.ocr.tiff"class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name="mimetypeService">
<ref bean="mimetypeService"/>
</property>
<property name="checkCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<!--<value>tesseract</value>-->
<value>/opt/alfresco/ocr</value>
</list>
</entry>
</map>
</property>
<property name="errorCodes">
<value>2</value>
</property>
</bean>
</property>
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<!--<value>tesseract</value>
<value>${source}</value>
<value>${target}</value>
<value>-l</value>
<value>eng</value>-->
<value>/opt/alfresco/ocr</value>
<value>${source}</value>
<value>${target}</value>
</list>
</entry>
</map>
</property>
<property name="errorCodes">
<value>1,2</value>
</property>
</bean>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
<property name="sourceMimetype"><value>image/tiff</value></property>
<property name="targetMimetype"><value>text/plain</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.ocr.tiff"class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.ocr.tiff"/>
</property>
</bean>
</beans>Create a bash file, named "ocr" and put into the alfresco root directory. And put it into /opt/alfresco. #!/bin/bash
# save arguments to variables
SOURCE=$1
TARGET=$2
TMPDIR=/tmp
FILENAME=`basename $SOURCE`
OCRFILE=$FILENAME.tif # to see what happens
#echo "from $SOURCE to $TARGET" >>/tmp/ocrtransform.log cp -f $SOURCE $TMPDIR/$OCRFILE # call tesseract and redirect output to $TARGET
tesseract $TMPDIR/$OCRFILE ${TARGET%\.*} -l eng
rm -f $TMPDIR/$OCRFILE