如何将 jar 与 Alfresco 中的自定义操作集成

发布于 2024-12-19 00:51:12 字数 1494 浏览 2 评论 0原文

我创建了一个自定义操作作为 Eclipse 项目。我将它打包在一个 jar 中,然后将其放入: alfresco-3.4.d/tomcat/webapps/alfresco/WEB-INF/lib

我启动了 Alfresco,并使用自定义操作创建了一条规则。当在此文件夹中创建文件时,将触发规则。

但是当我创建文件时,唯一的可用类型是“内容”,我的自定义内容类型不会显示在选择列表中。我的问题是我需要这些自定义类型。

我已经测试了在没有罐子的情况下启动 Alfresco,并且所有类型都可用。

我的项目结构错误?:

 src.main.java
 -executer
   ·UrlActionExecuter.java
   ·UrlActionHandler.java
 src.main.resources
 -alfresco.extension
   ·url-actions-context.xml
   ·web-client-config-custom.xml
   ·webclient.properties
 src.main.webapp
  -jsp.actions
   ·url-action-executer.jsp

或者build.xml?:

<?xml version="1.0"?>

<project name="Action Url" default="package" basedir=".">

    <property name="project.dir" value="."/>
    <property name="build.dir" value="${project.dir}/build"/>
    <property name="package.file" value="${build.dir}/Action-url.jar"/>

    <path id="class.path">
        <dirset dir="${build.dir}" />
        <fileset dir="../../lib/server" includes="**/*.jar"/>
    </path>

    <target name="compile">
        <mkdir dir="${build.dir}" />
        <javac classpathref="class.path" srcdir="${project.dir}/src" destdir="${build.dir}" />
    </target>

    <target name="package" >
        <jar destfile="${package.file}">
            <fileset dir="${build.dir}"/>
        </jar>
    </target>

</project>

谢谢大家!

I've created a custom action with as a eclipse project. I packaged it in a jar and I put it in: alfresco-3.4.d/tomcat/webapps/alfresco/WEB-INF/lib

I started Alfresco and I created a rule with my custom action. When a file is created in this folder then the rule is triggered.

But when I create a file, the unique available type is "content", my custom content types don't show in select list. My problem is I need these custom types.

I have tested starting Alfresco without my jar and all types are availables.

My project structure is wrong?:

 src.main.java
 -executer
   ·UrlActionExecuter.java
   ·UrlActionHandler.java
 src.main.resources
 -alfresco.extension
   ·url-actions-context.xml
   ·web-client-config-custom.xml
   ·webclient.properties
 src.main.webapp
  -jsp.actions
   ·url-action-executer.jsp

or build.xml?:

<?xml version="1.0"?>

<project name="Action Url" default="package" basedir=".">

    <property name="project.dir" value="."/>
    <property name="build.dir" value="${project.dir}/build"/>
    <property name="package.file" value="${build.dir}/Action-url.jar"/>

    <path id="class.path">
        <dirset dir="${build.dir}" />
        <fileset dir="../../lib/server" includes="**/*.jar"/>
    </path>

    <target name="compile">
        <mkdir dir="${build.dir}" />
        <javac classpathref="class.path" srcdir="${project.dir}/src" destdir="${build.dir}" />
    </target>

    <target name="package" >
        <jar destfile="${package.file}">
            <fileset dir="${build.dir}"/>
        </jar>
    </target>

</project>

Thanks everybody!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮年 2024-12-26 00:51:12

您的自定义类型应在模型文件中进行描述,然后您应将模型导入到 alfresco,例如:

    <?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="custom_dictionaryBootstrap"
        parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/module/mymodule/model/mymodel.xml</value>
            </list>
        </property>
        <property name="labels">
            <list>
                <value>alfresco/module/mymodule/messages/system</value>
            </list>
        </property>
    </bean>

</beans>

Your custom types should described in the model file and then you should import your model to the alfresco, for example:

    <?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="custom_dictionaryBootstrap"
        parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/module/mymodule/model/mymodel.xml</value>
            </list>
        </property>
        <property name="labels">
            <list>
                <value>alfresco/module/mymodule/messages/system</value>
            </list>
        </property>
    </bean>

</beans>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文