AnsweredAssumed Answered

Help with Alfresco

Question asked by km70569w on Dec 3, 2009
Latest reply on Jul 19, 2010 by bookworm2113
Hi I am very new to Alresco and have just started reading the book Alfresco Developer Guide By Jeff Potts. I was going through the first test of the book on chapter 2 to just to see the login page changes for Someco. I made the created the project on eclipse and followed the step in the book. But I cannot get it to going. I do not get the desired result. Here is what I did.

I created a client-extensions project where I have the following directory structure:
client-extensions
      - src
           > java
           > web
               >> someco
                        >>> images
                               >>>> someco-logo.png
      - config
           > alfresco
                 >> extension
                         >>> model
                                >>>> scModel.xml
                         >>> someco-model-context.xml
                         >>> web-client-config-custom.xml
      - web
           > jsp
               >> extension
                     >>> login.jsp
                     >>> relogin.jsp
      - build.xml
      - build.prperties


Here is the build.xml file that i have:
<?xml version="1.0"?>

<project name="client-extension" default="package-extension" basedir=".">

   <property name="project.dir" value="." />
   <property name="build.dir" value="${project.dir}/build" />
   <property name="web.dir" value="${project.dir}/web" />
   <property name="lib.dir" value="${project.dir}/../WEB-INF/lib" />
   <property name="package.file.jar" value="${build.dir}/client-extensions.jar" />
   <property name="package.file.zip" value="${build.dir}/client-extensions.zip" />
   <property name="alfresco.dir" value="c:/Alfresco/tomcat/webapps/alfresco/" />
   <property name="alfresco.lib.dir" value="${alfresco.dir}/WEB-INF/lib/" />

   <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" depends="compile">
      <delete file="${package.file.jar}" />
      <jar destfile="${package.file.jar}">
         <fileset dir="${build.dir}" excludes="*.zip" />
      </jar>
   </target>

   <target name="package-extension" depends="package-jar">
      <delete file="${package.file.zip}" />
      <zip destfile="${package.file.zip}">
         <zipfileset file="${package.file.jar}" prefix="WEB-INF/lib" />
         <zipfileset dir="${web.dir}" />
      </zip>
      <copy file="${package.file.jar}" todir="${lib.dir}" />
   </target>

   <target name="integrate-extension" depends="package-extension">
      <available file="alfresco.war" type="file" property="alfresco.war.present" />
      <fail unless="alfresco.war.present" message="Could not find alfresco.war, please copy it to ${basedir}" />
      <zip destfile="alfresco.war" update="true">
         <zipfileset file="${package.file.jar}" prefix="WEB-INF/lib" />
         <zipfileset dir="${web.dir}" />
         <!–zipfileset file="${project.dir}/src/WEB-INF/classes/alfresco/mimetype/openoffice-document-formats.xml" prefix="WEB-INF/classes/alfresco/mimetype" /–>
      </zip>
   </target>

   <target name="copy jar" description="copy files to alfresco lib dir" depends="package-jar">
      <copy todir="${alfresco.lib.dir}" overwrite="true">
         <fileset dir="${build.dir}/">
            <include name="*.jar" />
         </fileset>
      </copy>
   </target>

   <target name="deploy" description="copy files to alfresco lib dir">
      <unzip src="${package.file.zip}" dest="${alfresco.dir}" />
   </target>

</project>


I can build the project, creates an empty jar file and zip file with a jar file and jsp files in there, with a warning below:
Buildfile: C:\temp\Projects\alfresco\client-extensions\build.xml
compile:
package-jar:
   [delete] Deleting: C:\temp\Projects\alfresco\client-extensions\build\client-extensions.jar
      [jar] Warning: skipping jar archive C:\temp\Projects\alfresco\client-extensions\build\client-extensions.jar because no files were included.
      [jar] Building MANIFEST-only jar: C:\temp\Projects\alfresco\client-extensions\build\client-extensions.jar
package-extension:
   [delete] Deleting: C:\temp\Projects\alfresco\client-extensions\build\client-extensions.zip
      [zip] Building zip: C:\temp\Projects\alfresco\client-extensions\build\client-extensions.zip
     [copy] Copying 1 file to C:\temp\Projects\alfresco\WEB-INF\lib
BUILD SUCCESSFUL
Total time: 219 milliseconds

I would also prefer if you can email me a sample project to do this if any of you have done it, would be very helpful as well. my email address is km70569w@yahoo.com. Thanks for any assistance.

KM

Outcomes