2013/06/19

Install Vaadin 7 on Liferay 6.1.1 (Jboss bundle)

To install the vaadin 7 on Liferay 6.1.1 Jboss bundle, follow this steps:
  1. Locate your liferay installation directory (let's call it $LIFERAY_HOME from now on), inside locate the jboss directory (call this $LIFERAY_JBOSS_HOME) and the ROOT.war folder that lies in $LIFERAY_JBOSS_HOME/standalone/deployments/ROOT.war ($ROOT from now on).
               LIFERAY_HOME=<your liferay bundle directory>
    
               LIFERAY_JBOSS_HOME=$LIFERAY_HOME/jboss-7.x.x
    
               ROOT=$LIFERAY_JBOSS_HOME/standalone/deployments/ROOT.war
            
     
  2. Delete all the content from the $ROOT/html/VAADIN directory
            
            rm -rf $ROOT/html/VAADIN/*
    
     
  3. Remove the vaadin.jar from the $ROOT/WEB-INF/lib/
            
            rm $ROOT/WEB-INF/lib/vaadin.jar
    
     
  4. Download the Vaadin 7 All-in-One Zip from the Vaadin downloads page and unzip it in temp ($ALL_IN_ONE_TEMP from now on) folder.
            ALL_IN_ONE_TEMP=vaadin-all-in-one-temp
            unzip vaadin-all-7.0.7.zip -d $ALL_IN_ONE_TEMP
    
     
  5. Change to the $ALL_IN_ONE_TEMP folder then copy and rename (removing the version part from the name) the following jars to the $ROOT/WEB-INF/lib/ directorty (replace the x's with the jars version): vaadin-server-7.x.x.jar, vaadin-shared-7.x.x.jar, vaadin-themes-7.x.x.jar, lib/vaadin-shared-deps-1.x.x.jar and lib/jsoup-1.x.x.jar (this last two jars are in the lib directory inside the $ALL_IN_ONE_TEMP folder)
            
            cd $ALL_IN_ONE_TEMP
            ROOT_LIB=$ROOT/WEB-INF/lib/
            cp vaadin-server-7.x.x.jar $ROOT_LIB/vaadin-server.jar
            cp vaadin-shared-7.x.x.jar $ROOT_LIB/vaadin-shared.jar
            cp vaadin-themes-7.x.x.jar $ROOT_LIB/vaadin-themes.jar
            cp lib/vaadin-shared-deps-1.x.x.jar $ROOT_LIB/vaadin-shared-deps.jar
            cp lib/jsoup-1.x.x.jar $ROOT_LIB/jsoup.jar
    
     
  6. Now you need to update the framework resource files to the new version, to do that, extract the VAADIN folders from the following jars and paste their contents into the $ROOT/html/VAADIN directory: vaadin-server-7.x.x.jar, vaadin-themes-7.x.x.jar, vaadin-client-compiled-7.x.x.jar.
            unzip vaadin-server-7.x.x.jar "VAADIN/*" -d "$ROOT/html/"
            unzip vaadin-themes-7.x.x.jar "VAADIN/*" -d "$ROOT/html/"
            unzip vaadin-client-compiled-7.x.x.jar "VAADIN/*" -d "$ROOT/html/"
    
     
With all the above done, you have Vaadin 7 installed in your Liferay 6.1.1 (Jboss) bundle, now, if you want to manage the framework from within Liferay, I recommend you to install the Vaadin 7 Control Panel, to do that, follow these steps:
  1. Download the vaadin-control-panel portlet zip bundle from github, follow the building instructions (note that for the building process you'll need Apache Maven). If you run with a problem with the install phase, check that your connection is not behind a proxy that blocks the repository domains, manually remove the corrupted artifacts and build again. If you need to detect corrupted artifacts, use the following find to spot them and remove the erroneous jar/pom:
            
    find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print
    
    If you want a one-liner to delete suspicious files, use this under your own risk:
            
            find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec sh -c "echo {} | rev | cut -d'.' -f2- | rev | xargs -I'[]' rm -i []" \;
    
    (Also, at the time of this writing, you can download an already compiled binary distribution from here)
     
  2. Deploy the vaadin-control-panel war in the deploy directory ($LIFERAY_HOME/deploy), start liferay and wait for the deployment to take effect...
     
  3. In order to compile the Widgetset from the Control Panel (without errors), you need to create the directory vaadin-client-jars in the $ROOT/WEB-INF folder, then copy and rename the following jars from the unzipped Vaadin All-in-One bundle (removing the version part of the name as noted above): vaadin-client-compiler-7.x.x.jar, vaadin-client-7.x.x.jar
            
            VAADIN_CLIENT_JARS=$ROOT/WEB-INF/vaadin-client-jars
            mkdir $VAADIN_CLIENT_JARS
            cp vaadin-client-compiler-7.x.x.jar $VAADIN_CLIENT_JARS/vaadin-client-compiler.jar
            cp vaadin-client-7.x.x.jar $VAADIN_CLIENT_JARS/vaadin-client.jar
    
    And copy the following jars to the $ROOT directory: lib/validation-api-1.0.0.GA.jar, lib/validation-api-1.0.0.GA-sources.jar
            
            cp lib/validation-api-1.x.x.GA.jar $ROOT_LIB/validation-api.GA.jar
            cp lib/validation-api-1.x.x.GA-sources.jar $ROOT_LIB/validation-api.GA-sources.jar
    
     
If everything went ok, then you should be able to add the Vaadin Configuration portlet (under the category "Undefined").
 

No comments:

Post a Comment