org.ibisph.mvc.controller.indicator
Class PublishIndicator

java.lang.Object
  extended by org.ibisph.mvc.controller.PublishXML
      extended by org.ibisph.mvc.controller.indicator.PublishIndicator
All Implemented Interfaces:
org.springframework.web.servlet.mvc.Controller

public class PublishIndicator
extends PublishXML

Indicator Profile XML Publish Controller. This controller receives a publish command and gets the indicator profile and associated view's XML streamed from the admin system. Once the content is received, it is put into an XML document to validate. If valid it then saves the XML to the specified directory and updates the published indicators. If not successful, a null controller request is returned and a "failed" type message is returned to the response. If XML is good and the published indicators are updated okay then the cat index is rebuilt.

Author:
Garth Braithwaite, STG

Field Summary
protected  java.io.File publishedIndicatorsFile
           
 
Fields inherited from class org.ibisph.mvc.controller.PublishXML
destinationXMLPath, documentDAO, fileBackupFactory, successReturnValue
 
Constructor Summary
PublishIndicator()
           
 
Method Summary
protected  java.lang.String addIndicatorToPublishedIndicators(org.dom4j.Document indicator)
          Helper method that adds the just published IP to the published indicator XML file.
protected  java.lang.String postSaveXMLProcessing(java.lang.String baseFilename, org.dom4j.Document indicator)
          Hooked call that finishes the indicator profile publishing request.
 void setPublishedIndicatorProfilesSystemID(SystemID publishedIndicatorProfilesSystemID)
          Sets System ID to the published indicator profiles XML file.
 
Methods inherited from class org.ibisph.mvc.controller.PublishXML
getBaseFilename, getDestinationXMLPath, getDocumentDAO, getXMLDocument, handleRequest, sendError, sendSuccess, setDestinationXMLPath, setDocumentDAO, setFileBackupFactory, setSuccessReturnValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

publishedIndicatorsFile

protected java.io.File publishedIndicatorsFile
Constructor Detail

PublishIndicator

public PublishIndicator()
Method Detail

setPublishedIndicatorProfilesSystemID

public void setPublishedIndicatorProfilesSystemID(SystemID publishedIndicatorProfilesSystemID)
                                           throws java.net.URISyntaxException
Sets System ID to the published indicator profiles XML file.

Parameters:
publishedIndicatorProfilesSystemID - Complete system ID string for the published indicator profiles XML file.
Throws:
java.net.URISyntaxException

postSaveXMLProcessing

protected java.lang.String postSaveXMLProcessing(java.lang.String baseFilename,
                                                 org.dom4j.Document indicator)
                                          throws java.lang.Exception
Hooked call that finishes the indicator profile publishing request. After the indicator profile XML files have been saved, the published indicators XML file needs to be updated, all related artifacts need to be deleted (including both IP indexes).

Overrides:
postSaveXMLProcessing in class PublishXML
Parameters:
baseFilename - Not used.
indicator - Indicator profile XML document which was received and is to be saved/published.
Returns:
Message string that details all actions and if successful or not.
Throws:
java.lang.Exception - General exception for any sub classed implementors.

addIndicatorToPublishedIndicators

protected java.lang.String addIndicatorToPublishedIndicators(org.dom4j.Document indicator)
                                                      throws java.lang.Exception
Helper method that adds the just published IP to the published indicator XML file.

Parameters:
indicator - Indicator XML document just received/added.
Returns:
Message that describes actions taken and their outcome/status.
Throws:
java.lang.Exception