Difference between revisions of "Development tips OpenKM 5.0"

From OpenKM Documentation
Jump to: navigation, search
(Created page with 'We recommend downloading JBoss+OpenKM from SourceForge, remove ''OpenKM.war'' and develop with this JBoss server configuration. For better development we recommend not deploying …')
 
 
(10 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
[[File:Okm_dev_guide_011.jpeg‎|441px|center]]
 
[[File:Okm_dev_guide_011.jpeg‎|441px|center]]
 +
 +
 +
{{Note|To create symbolic links in windows use juntion.exe http://technet.microsoft.com/en-us/sysinternals/bb896768 }}
 +
 +
 +
It's mandatory registering '''sample-5.0-full.jar''' into maven repository. File is into '''ext-libs''' folder. It must be executed some maven command to registering ( then compilation will execute right ). Take a look at install.sh, if sometimes is required some new library, the reference it'll be included on that file.
 +
 +
mvn install:install-file -DgroupId=com.openkm.extension -DartifactId=sample-full -Dversion=5.0 -Dpackaging=jar -Dfile=sample-5.0-full.jar
  
  
Line 32: Line 40:
 
{{Advice|Is possible to compile GWT modules individually by this way:
 
{{Advice|Is possible to compile GWT modules individually by this way:
  
  <nowiki>$ mvn gwt:compile -Dgwt.module=com.openkm.backend.Main</nowiki>
+
  <nowiki>$ mvn gwt:compile -Dgwt.module=com.openkm.frontend.Main</nowiki>
 
}}
 
}}
  
Line 38: Line 46:
  
  
[[File:Okm_dev_guide_012.jpeg‎|800px|center]]
+
[[File:Okm_dev_guide_031.jpeg|800px|center]]
  
  
[[File:Okm_dev_guide_013.jpeg‎|800px|center]]
+
[[File:Okm_dev_guide_032.jpeg‎|800px|center]]
  
  
To achieve a faster compile we use to development Firefox, uncommenting gecko line on file Main.gwt.xml GWT compilation only for gecko browser runs fine. Don't forget at finish to comment it and try application with IE or other browsers. Now are two files called Main.gwt.xml one for frontend and other to backend.
+
To achieve a faster compile we use to development Firefox, uncommenting gecko line on file '''Main.gwt.xml''' GWT compilation only for gecko browser runs fine. Don't forget at finish to comment it and try application with IE or other browsers.  
  
 
<source lang="xml">
 
<source lang="xml">
Line 50: Line 58:
 
<set-property name="user.agent" value="gecko"/>
 
<set-property name="user.agent" value="gecko"/>
 
</source>
 
</source>
 +
 +
== User contribution script ==
 +
<source lang="bash">
 +
#!/bin/bash
 +
# @author: Kenneth Walter
 +
 +
#Cleans and re-compiles the source files
 +
mvn -Dmaven.test.skip=true clean gwt:compile install $*
 +
 +
#Set the TARGET_DIRECTORY to the path of your JBoss installation
 +
TARGET_DIRECTORY=~/Downloads/jboss-4.2.3.GA/
 +
FILE_TO_MOVE=target/OpenKM.war
 +
#This will only attempt to replace the existing WAR if the new WAR exists
 +
if [ -f $FILE_TO_MOVE ]
 +
then
 +
  echo 'Deploying WAR to JBoss Directory'
 +
  cp -v $FILE_TO_MOVE $TARGET_DIRECTORY/server/default/deploy/.
 +
  echo 'Done'
 +
fi
 +
</source>
 +
 +
More info about this script at [http://forum.openkm.com/viewtopic.php?f=31&t=5332 Cannot create or use example extensions] forum thread.
  
 
[[Category: Developer Guide]]
 
[[Category: Developer Guide]]

Latest revision as of 21:01, 20 November 2011

We recommend downloading JBoss+OpenKM from SourceForge, remove OpenKM.war and develop with this JBoss server configuration. For better development we recommend not deploying OpenKM.war file it's better setting in $JBOSS_HOME/server/default/deploy some alias to target/OpenKM folder:


Okm dev guide 011.jpeg



Nota clasica.png To create symbolic links in windows use juntion.exe http://technet.microsoft.com/en-us/sysinternals/bb896768


It's mandatory registering sample-5.0-full.jar into maven repository. File is into ext-libs folder. It must be executed some maven command to registering ( then compilation will execute right ). Take a look at install.sh, if sometimes is required some new library, the reference it'll be included on that file.

mvn install:install-file -DgroupId=com.openkm.extension -DartifactId=sample-full -Dversion=5.0 -Dpackaging=jar -Dfile=sample-5.0-full.jar


In case you're making strong changes in OpenKM UI (GWT) we recommend disabling pom compile directive

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <!-- <goal>generateAsync</goal> -->
              <!-- <goal>test</goal> -->
            </goals>
          </execution>
        </executions>
        <configuration>
          <runTarget>com.openkm.frontend.Main/index.html</runTarget>
          <modules>
            <module>com.openkm.frontend.Main</module>
          </modules>
        </configuration>
      </plugin>

Nota idea.png Is possible to compile GWT modules individually by this way:
$ mvn gwt:compile -Dgwt.module=com.openkm.frontend.Main

You might be interested in running frontend and backend GWT packaging from eclipse. Go to run configurations and add in maven build


Okm dev guide 031.jpeg


Okm dev guide 032.jpeg


To achieve a faster compile we use to development Firefox, uncommenting gecko line on file Main.gwt.xml GWT compilation only for gecko browser runs fine. Don't forget at finish to comment it and try application with IE or other browsers.

<!-- Compile for Firefox only -->
<set-property name="user.agent" value="gecko"/>

User contribution script

#!/bin/bash
# @author: Kenneth Walter

#Cleans and re-compiles the source files
mvn -Dmaven.test.skip=true clean gwt:compile install $*

#Set the TARGET_DIRECTORY to the path of your JBoss installation
TARGET_DIRECTORY=~/Downloads/jboss-4.2.3.GA/
FILE_TO_MOVE=target/OpenKM.war
#This will only attempt to replace the existing WAR if the new WAR exists
if [ -f $FILE_TO_MOVE ]
then
   echo 'Deploying WAR to JBoss Directory'
   cp -v $FILE_TO_MOVE $TARGET_DIRECTORY/server/default/deploy/.
   echo 'Done'
fi

More info about this script at Cannot create or use example extensions forum thread.