本文描述在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
-
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&#61;"transformer.worker.ocr.tiff"class&#61;"org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name&#61;"mimetypeService">
<ref bean&#61;"mimetypeService"/>
property>
<property name&#61;"checkCommand">
<bean class&#61;"org.alfresco.util.exec.RuntimeExec">
<property name&#61;"commandsAndArguments">
<map>
<entry key&#61;".*">
<list>
<value>/opt/alfresco/ocrvalue>
list>
entry>
map>
property>
<property name&#61;"errorCodes">
<value>2value>
property>
bean>
property>
<property name&#61;"transformCommand">
<bean class&#61;"org.alfresco.util.exec.RuntimeExec">
<property name&#61;"commandsAndArguments">
<map>
<entry key&#61;".*">
<list>
<value>/opt/alfresco/ocrvalue>
<value>${source}value>
<value>${target}value>
list>
entry>
map>
property>
<property name&#61;"errorCodes">
<value>1,2value>
property>
bean>
property>
<property name&#61;"explicitTransformations">
<list>
<bean class&#61;"org.alfresco.repo.content.transform.ExplictTransformationDetails">
<property name&#61;"sourceMimetype"><value>image/tiffvalue>property>
<property name&#61;"targetMimetype"><value>text/plainvalue>property>
bean>
list>
property> bean> <bean id&#61;"transformer.ocr.tiff"class&#61;"org.alfresco.repo.content.transform.ProxyContentTransformer" parent&#61;"baseContentTransformer"> <property name&#61;"worker"> <ref bean&#61;"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&#61;$1 TARGET&#61;$2 TMPDIR&#61;/tmp FILENAME&#61;&#96;basename $SOURCE&#96; OCRFILE&#61;$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