`
awdxzc
  • 浏览: 335659 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Alfresco AMP

阅读更多
Alfresco AMP 在我看来就相当于它的插件,你可以扩展Alfresco的应用,通过AMP文件的形式通过Module Management Tool安装和更新部署到alfresco.war上面去。
Alfresco 扩展的amp module是被打包成amp file发布的。Module Management Tool是一个独立的包,下载alfresco-mmt-2.1.jar。在其BIN目录可执行java -jar alfresco-mmt-2.1.jar [args]

usage: install <AMPFileLocation> <WARFileLocation> [options]

valid options:

   -verbose   : enable verbose output
   -directory : indicates that the amp file location specified is a directory.
                All amp files found in the directory and its sub directories are installed.
   -force     : forces installation of AMP regardless of currently installed module version
   -preview   : previews installation of AMP without modifying WAR file
   -nobackup  : indicates that no backup should be made of the WAR



就可以安装一个amp文件到alfresco.war.

Example:
java -jar alfresco-mmt-2.1.0.jar install /root/alfresco-recordsmanagement-2.1.0.amp /usr/jboss-4.0.3SP1/server/default/deploy/alfresco.war 


AMP文件的结构
  |
  |- /config
  |
  |- /lib
  |
  |- /licenses
  |
  |- /web
    |
    |- /jsp
    |
    |- /css
    |
    |- /images
    |
    |- /scripts
  |
  |- module.properties
  |
  |- file-mapping.properties


文件的具体结构详细参阅:http://wiki.alfresco.com/wiki/AMP_Files

amp file的建立,我是通过ant来实现的。
<target name="mkdirs" depends="clean" >
        <mkdir dir="${build.dir}/dist" />
        <mkdir dir="${build.dir}/lib" />
</target>

<target name="package-jar" depends="compile">
        <jar destfile="${jar.file}" >
            <fileset dir="${build.dir}/classes" includes="**/*.class" />
        </jar>
</target>

<target name="compile">
        <mkdir dir="${build.dir}/classes" />
        <javac classpathref="class.path" debug="true" srcdir="${project.dir}/source/java" destdir="${build.dir}/classes" />
</target>

<target name="package-amp" depends="mkdirs, package-jar" description="Package the Module" >
        <zip destfile="${amp.file}" >
            <fileset dir="${project.dir}/build" includes="lib/*.jar" />
            <fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" />
            <fileset dir="${project.dir}/config/alfresco/module/com.company.poc" includes="module.properties" />
        </zip>
</target>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics