本文描述在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="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
浙公網安備 33010602011771號