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

java.lang.Object
  extended by org.infoglue.cms.controllers.kernel.impl.simple.BaseController
      extended by org.infoglue.cms.controllers.kernel.impl.simple.UpdateController

public class UpdateController
extends BaseController

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 Title breif description http://url_to_ant_install_script http://url_to_html-info_page_describing_the_package ... 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()
           
 BaseEntityVO getNewVO()
           
 void refreshAvailableUpdates()
           
 void runUpdatePackage(java.lang.String updatePackageId, java.io.OutputStreamWriter writer)
           
 void runUpdatePackage(UpdatePackage upd, java.io.OutputStreamWriter out)
           
 void unInstallPackage(java.lang.String updatePackageId, java.io.PrintWriter out)
           
 void unInstallPackage(UpdatePackage upd, java.io.PrintWriter out)
           
 
Methods inherited from class org.infoglue.cms.controllers.kernel.impl.simple.BaseController
beginTransaction, beginTransaction, closeDatabase, commitTransaction, createEntity, createEntity, createQuery, deleteEntity, deleteEntity, deleteEntity, deleteEntity, executeQuery, executeQuery, executeQuery, executeQuery, getAllObjects, getAllVOObjects, getAllVOObjects, getAllVOObjects, getAllVOObjects, getLogger, getObjectWithId, getObjectWithId, getObjectWithIdAsReadOnly, getVOWithId, getVOWithId, getVOWithId, getVOWithId, intercept, intercept, rollbackTransaction, toModifiableVOList, toVOList, updateEntity, updateEntity, updateEntity, updateEntity, validateEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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
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.OutputStreamWriter writer)
                      throws java.io.IOException
Throws:
java.io.IOException

unInstallPackage

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

runUpdatePackage

public void runUpdatePackage(UpdatePackage upd,
                             java.io.OutputStreamWriter out)
                      throws java.io.IOException
Throws:
java.io.IOException

unInstallPackage

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

getNewVO

public BaseEntityVO getNewVO()
Specified by:
getNewVO in class BaseController


Copyright © 2005 InfoGlue.org All Rights Reserved.