R. McDowell
R. McDowell

Reputation: 41

Alfresco custom action dialog not showing

I created a custom Alfresco action dialog using one of the sample SDK projects as a base. I kept the sample projects "org.alfresco.sample" package for my java files and it worked fine. Then I tried to change the package name to "com.xxxxxx.xxxxx" and it stopped working. I have checked all of the files in the project to make sure that I have replaced every instance of "org.alfresco.sample" with my new package name. Can anyone suggest a possible reason for this? Thanks

I found that when I build the project, it is not building the java files. Can anyone suggest why it is not building the java files with the new package name? Thanks

I got the java files build again. But the new actions are still not being used. The new actions use an evaluator but it does not seem to be running. (It would normally write to the log.)

Here is part of the build.xml:

<project name="Custom Dialog Build File" default="package-amp" basedir=".">
<property name="project.dir" value="."/>
<property name="build.dir" value="${project.dir}/build"/>
<property name="config.dir" value="${project.dir}/config"/>
<property name="jsp.dir" value="${project.dir}/web/jsp"/>
    <property name="web.dir" value="${project.dir}/web" />
<property name="package.file.jar" value="${build.dir}/lib/custom-dialog.jar"/>
    <property name="package.file.zip" value="${build.dir}/lib/custom-dialog.zip"/>
    <property name="amp.file" value="${build.dir}/dist/retailChannels.amp"/>

    <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}/source" destdir="${build.dir}" />
    </target>

<target name="package-jar" depends="increment-build-number">
      <delete file="${package.file.jar}" />  
    <jar destfile="${package.file.jar}">
        <fileset dir="${build.dir}">
            <exclude name="dist/**" />
            <exclude name="lib/**" />
            <exclude name="web/**" />
        </fileset>
    </jar>
</target>

    <target name="mkdirs">
      <mkdir dir="${build.dir}/dist" />
      <mkdir dir="${build.dir}/lib" />
    </target>

    <target name="clean">
    <delete includeemptydirs="true">
        <fileset dir="${build.dir}/dist" includes="**/*"/>
    </delete>
    </target>

    <target name="package-amp" depends="clean, mkdirs, package-jar" description="Package the Module" >
        <delete file="${amp.file}" /> 
        <zip destfile="${amp.file}" >
            <fileset dir="${project.dir}/build" includes="lib/*.jar" />
    <fileset dir="${project.dir}/config/alfresco/module/alfresco" includes="*.properties" />
            <fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" />
    <fileset dir="${project.dir}/source">
            <include name="web/jsp/**/*.jsp" />
            <include name="web/images/**" />
    </fileset>
        </zip>
   </target> 

</project>  

I just tried going through the maven SDK tutorial that you suggested but I got this error: Feb 14, 2014 3:42:48 PM org.apache.catalina.core.ContainerBase startInternal SEVERE: A child container failed during start java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:188)

Upvotes: 0

Views: 578

Answers (1)

Jeff Potts
Jeff Potts

Reputation: 10538

Check the build.xml file. Double-check the compile and package-jar tasks (or similar). For example, one or both of these tasks may have a fileset that uses a pattern to include your classes using the package structure, and it may no longer match now that you've changed your package name.

It's hard to tell without seeing your build.xml.

By the way, if you want a more up-to-date example for creating actions in Alfresco, take a look at this tutorial: http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html

It uses the Alfresco Maven SDK to package AMPs. The Alfresco Maven SDK is preferred over the old SDK you are using.

Upvotes: 1

Related Questions