一、介绍
http://www.alfresco.com/
Alfresco is the Open Source Alternative for Enterprise Content Management (ECM), providing Document Management, Collaboration, Records Management, Knowledge Management, Web Content Management and Imaging.
 
采用的技术
Java
Spring Aspect-Oriented Framework
ACEGI – Aspect-Oriented Security Framework
MyFaces JSF Implementation
Hibernate ORM Persistence
Lucene Text Search Engine
JLAN
POI File Format Conversion
PDFBox – PDF Conversion
OpenOffice
jBPM
Rhino JavaScript engine
支持的接口
CIFS/SMB Microsoft File Share Protocol
JSR-168 Portlet Specification
JSR-127 Java Server Faces
FTP
WebDAV
Web Services
REST
更多的技术规范详见: http://www.alfresco.com/products/ecm/specifications/
 


二、配置解读
1、从web.xml开始入手
其它的略过,在 web.xml 中可以看到加载了如下 Spring 配置文件
<context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
     classpath:alfresco/web-client-application-context.xml
     classpath:web-services-application-context.xml
     classpath:alfresco/web-api-application-context.xml
     classpath:alfresco/application-context.xml
 </param-value>
            <description>Spring config file locations</description>
</context-param>
web client 层
alfresco/web-client-application-context.xml
打开它可以看到它引入了所有的 alfresco/web-client*.xml & alfresco/extension/web-client*.xml & jar:*!/META-INF/web-client*.xml
web api 层
alfresco/web-api-application-context.xml
打开它可以看到它引入了 alfresco/web-api-config.xml & alfresco/extension/web-api-config-custom.xml
web service 层
web-services-application-context.xml
刚开始找这个文件时,居然没有找到,怪事!not exist???why?
于是后来才发现这个文件是在 remote-api.jar 包里,晕,不是很好的做法啊。
bean 配置定义关键的文件
alfresco/application-context.xml
    <import resource="classpath:alfresco/core-services-context.xml"/>
    <import resource="classpath:alfresco/public-services-context.xml"/>
    <import resource="classpath:alfresco/model-specific-services-context.xml"/>
    <import resource="classpath:alfresco/action-services-context.xml"/>
    <import resource="classpath:alfresco/rule-services-context.xml"/>
    <import resource="classpath:alfresco/node-services-context.xml"/>
    <import resource="classpath:alfresco/scheduled-jobs-context.xml"/>
    <import resource="classpath:alfresco/network-protocol-context.xml"/>
    <import resource="classpath:alfresco/content-services-context.xml"/>
    <import resource="classpath:alfresco/hibernate-context.xml"/>
    <import resource="classpath:alfresco/ownable-services-context.xml"/>
    <import resource="classpath:alfresco/template-services-context.xml"/>
    <import resource="classpath:alfresco/script-services-context.xml"/>
    <import resource="classpath:alfresco/index-recovery-context.xml"/>
    <import resource="classpath:alfresco/authority-services-context.xml"/>
    <import resource="classpath:alfresco/authentication-services-context.xml"/>
    <import resource="classpath:alfresco/policy-context.xml"/>
    <import resource="classpath:alfresco/import-export-context.xml"/>
    <import resource="classpath:alfresco/bootstrap-context.xml"/>
    <import resource="classpath:alfresco/workflow-context.xml"/>
    <import resource="classpath:alfresco/jcr-api-context.xml"/>
    <import resource="classpath:alfresco/avm-services-context.xml"/>
    <import resource="classpath:alfresco/audit-services-context.xml"/>
    <import resource="classpath*:alfresco/patch/*-context.xml"/>
    <import resource="classpath*:alfresco/domain/*-context.xml"/>
 
    <!--
         Import all modules and related components.
         Extensions are explicitly imported after this so that the default
         mechanism can still be used to override module-specific beans.
    -->
    <import resource="classpath*:alfresco/module-context.xml"/>
 
    <!--
         Import of general extensions and bean overrides.
 
         To give developers final control over the tuning
         of their own local build, the dev-context.xml file
         is processed last (note: dev-context.xml isn't
         part of the source tree itself).
        
         For details, see:
         http://wiki.alfresco.com/wiki/Developer_Runtime_Configuration
    -->
    <import resource="classpath*:alfresco/extension/*-context.xml"/>
    <import resource="classpath*:alfresco/extension/dev-context.xml"/>
 
可以看到分层次地进行加载不同的 bean ,并且在后面提供可扩展的 bean 定义的引入,方便进行扩展,而不需要更变这个配置文件
 
继续一个个往下看,并把一些重要的 bean 配置拿出来:
core-services-context.xml 核心 bean 的配置
看到配置了 JMX 的服务
<!-- Custom MBeanServer -->
<bean />
 
同时覆盖掉想覆盖的Bean,后面覆盖前面的,Map嘛。比如: custom-repository-context.xml 里的属性配置、资源配置、事务配置等


三、配置安装时的注意事项
1、要将 Alfresco 默认安装使用的数据库HSQL转换为MqSQL的话,只需要删掉三个 HSQL 使用的文件:
这三个文件分别是 tomcat/shared/classes/alfresco/extension 目录下的
            custom-db-and-data-context.xml
            custom-db-connection.properties
            custom-hibernate-dialect.properties
为了产生一个MySQL数据库,执行 <alfresco_installation_folder>\extra\database\mysql ,运行 db_setup.bat 文件,或者打开文件,手工输入命令也一样。
就会产生一个与一个使用者一起命名 alfresco 的 MySQL 数据库帐户和一个 alfresco 的密码。
 
2、国际化
alfresco的文件路径为: WEB-INF\classes\alfresco\messages 下面包含了一堆文件,一个个去国际化吧,当然用插件、Native2ASCII或配合ANT都可以。
Eclipse 的 PropertiesEditor 插件不错。
 
3、无论从一种数据库切换到另一种数据库,都要记得把 repository.properties 配置文件里 dir.root 所在的目录下的文件删除干净,要不然会出问题。
比如:Caused by: org.alfresco.repo.search.SearcherException: More than one root node in index: 2
#dir.root=./alf_data
 
4、将 Win32NetBIOS.dll 拷贝到 %JAVA_HOME%\jre\bin\ 目录下 或者 %TOMCAT_HOME%\bin 目录下
 
5、不要 ScriptService 的话,可以在 public-services-context.xml 中
注释掉 ScriptService 和 ScriptService_transaction
<!-- Script Service -->
<!--
<bean >http://dotnet.csdn.net/n/20060206/86350.html
六、开发与代码分析
1、换 Web Services 的实现方式由 AXIS 换到 XFire
  Codehaus XFire is a next-generation java SOAP framework. Codehaus XFire makes service oriented development approachable through its easy to use API and support for standards. It is also highly performant since it is built on a low memory StAX based model.
 
==============================================================
代码分析有时间再继续整理上来
 
Category由id,title,description组成
            public Category(org.alfresco.webservice.types.Reference id,java.lang.String title,java.lang.String description)
 
Classification
            public Classification(java.lang.String classification,org.alfresco.webservice.types.Category rootCategory,java.lang.String title,java.lang.String description)
 
Reference
            public Reference(org.alfresco.webservice.types.Store store,java.lang.String uuid,java.lang.String path)
 
AppliedCategory
            public AppliedCategory(java.lang.String classification,org.alfresco.webservice.types.Reference[] categories)
 
ClassDefinition
            public ClassDefinition(java.lang.String name,java.lang.String title,java.lang.String description,java.lang.String superClass,boolean isAspect,org.alfresco.webservice.types.PropertyDefinition[] properties,org.alfresco.webservice.types.AssociationDefinition[] associations)
 
 附件下载:

1、Alfresco Database Model

2、Alfresco2.0

 

出处:http://blog.csdn.net/yulimin/archive/2007/05/15/1609437.aspx

相关文章: