org.infoglue.cms.controllers.kernel.impl.simple
Class UpdateController

java.lang.Object
  |
  +--org.infoglue.cms.controllers.kernel.impl.simple.UpdateController

public class UpdateController
extends java.lang.Object

Core infoglue up2date functionallity is provided through this controller. The constructor takes two arguments 1: url to the updateservers xml-file of available packages This delegates the problem of mirror handling and finding a working updateserver to the calling class. 2: path to up2date directory residing directly below the toplevel codebase directory. Ant operates with this directory as the basedirectory so the ant-files delivered by the updateserver should operate on ".." to get access to the base directory. The update process briefly: Overview: Available updates are served by a InfoGlue CMS repository where developers easily can publish update packages and deployment logic for installing those packages. The list of available updates, are served in xml-format from the InfoGlue Update Server. When requesting this document, a list of allready installed packages is passed to the server along with the query. The returned document looks something like this: pid http://url_to_ant_install_script http://url_to_html-info_page_describing_the_package breif description ... This document is retrieved by this controller on the client system and is unmarshaled to objects and placed in a list of available packages. The list is presented to the user (administrator of the client system) in the management tool. Where he may chose to access the detail page on the server, or install the package. Package Installation: When the user has decided that the has come to install an update. This class retrieves the ant-script (actually using ants get task) that shall be used for the installation. The url to the script is found in packagedefinition. The file is stored locally on the client system in CMS_BASEDIR/up2date/PID.xml Another ant session is started, using this file, and running target "runUpdate" Typically this target gets a zip-file from the server and unpacks it over the current codebase. But first a backup is made. But all this is up to the Update Server. A target "unInstall" should also exist in this file. Current setup at www.infoglue.org updateserver also executes two additional targets beforeUpdate and afterUpdate which can be edited by the packageauthor for each package After the update is made, the package object are added to the list of installed packages, and later marshalled to CMS_BASEDIR/up2date/installed.xml

Author:
Stefan Sik

Constructor Summary
UpdateController(java.lang.String url, java.lang.String path)
           
 
Method Summary
 java.util.Vector getAvailableUpdates()
           
 java.util.Vector getInstalledUpdates()
           
 java.util.Date getLatestRefresh()
           
 void refreshAvailableUpdates()
           
 void runUpdatePackage(java.lang.String updatePackageId, java.io.PrintWriter out)
           
 void runUpdatePackage(UpdatePackage upd, java.io.PrintWriter out)
           
 void unInstallPackage(java.lang.String updatePackageId, java.io.PrintWriter out)
           
 void unInstallPackage(UpdatePackage upd, java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateController

public UpdateController(java.lang.String url,
                        java.lang.String path)
                 throws java.io.FileNotFoundException,
                        java.io.IOException,
                        org.exolab.castor.mapping.MappingException
Method Detail

refreshAvailableUpdates

public void refreshAvailableUpdates()

getLatestRefresh

public java.util.Date getLatestRefresh()

getAvailableUpdates

public java.util.Vector getAvailableUpdates()

getInstalledUpdates

public java.util.Vector getInstalledUpdates()

runUpdatePackage

public void runUpdatePackage(java.lang.String updatePackageId,
                             java.io.PrintWriter out)
                      throws java.net.MalformedURLException
java.net.MalformedURLException

unInstallPackage

public void unInstallPackage(java.lang.String updatePackageId,
                             java.io.PrintWriter out)
                      throws java.net.MalformedURLException
java.net.MalformedURLException

runUpdatePackage

public void runUpdatePackage(UpdatePackage upd,
                             java.io.PrintWriter out)
                      throws java.net.MalformedURLException
java.net.MalformedURLException

unInstallPackage

public void unInstallPackage(UpdatePackage upd,
                             java.io.PrintWriter out)
                      throws java.net.MalformedURLException
java.net.MalformedURLException