j2ee学习和交流

j2ee学习和交流

博客园 首页 新随笔 联系 订阅 管理

本文描述在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
posted on 2015-10-10 18:15  tyshan  阅读(409)  评论(0编辑  收藏  举报