com.ge.research.acuity.utils
Class ConversionUtils

java.lang.Object
  extended bycom.ge.research.acuity.utils.ConversionUtils

public class ConversionUtils
extends java.lang.Object

Takes information about a presentation from the onotology and creates a user interface model of that presentation object, for use in client applications

Version:
$Revision: 1.3 $ $Date: 2006/12/07 22:45:41 $
Author:
garbiras
Created on:
Dec 7, 2004

Constructor Summary
ConversionUtils()
           
 
Method Summary
static void constructPO(PresentationObject po, PresentationParameterMap ppm)
          Introspects the presentation object to setup the parameter setter method map and then calls the setParameters(com.ge.research.acuity.ui.PresentationObject, com.ge.grc.acuity.PresentationParameterMap, java.util.Map) with that map information.
static PresentationObject convertIndividual(com.hp.hpl.jena.ontology.Individual individual, AcuityController controller)
          Converts an ontology individual to a user interface presentation object.
static PresentationObject convertPresentationObject(PresentationObject po, AcuityController controller)
          Converts an ontology presentation object to a user interface presentation object.
static void setIAOValues(InteractionContent mpi, InteractionObject po, AcuityController controller)
          Uses the interaction content of the interaction object(presentation object) to set up the ui interaction/selection presentation object.
static void setIAOValues(java.util.List choices, java.util.List answers, InteractionObject po, AcuityController controller)
          Uses a list of choices and answers to set up the ui interaction/selection presentation object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversionUtils

public ConversionUtils()
Method Detail

constructPO

public static void constructPO(PresentationObject po,
                               PresentationParameterMap ppm)
                        throws AcuityException
Introspects the presentation object to setup the parameter setter method map and then calls the setParameters(com.ge.research.acuity.ui.PresentationObject, com.ge.grc.acuity.PresentationParameterMap, java.util.Map) with that map information.

Parameters:
po - the ui presentation object
ppm - the presentation parameter map of attribute values, from the ontology, to be set for the presentation object
Throws:
AcuityException - If there is a Security Exception thrown while introspecting the presentation object

convertIndividual

public static PresentationObject convertIndividual(com.hp.hpl.jena.ontology.Individual individual,
                                                   AcuityController controller)
                                            throws AcuityException
Converts an ontology individual to a user interface presentation object. The ontology individual is changed to an acuity presentation object by the controller. The acuity presentation object is then convereted to a ui presentation object.

Parameters:
individual - the individual from the ontology
controller - the acuity controller to use
Returns:
The newly created acuity ui presentation object
Throws:
AcuityException - If the controller errs
See Also:
convertPresentationObject(com.ge.grc.acuity.PresentationObject, com.ge.grc.acuity.AcuityController)

convertPresentationObject

public static PresentationObject convertPresentationObject(PresentationObject po,
                                                           AcuityController controller)
                                                    throws AcuityException
Converts an ontology presentation object to a user interface presentation object. The ontology presentation object is inspected for its presentation nature, which determines the subclass of ui presentation object is constructed. Then the new presentation object is introspected to set its member values, and certain subclasses are passed on to other setup methods for further processing

Parameters:
po - the presentation object from the ontology
controller - the acuity controller to use
Returns:
The newly created acuity ui presentation object
Throws:
AcuityException - If the controller errs

setIAOValues

public static void setIAOValues(InteractionContent mpi,
                                InteractionObject po,
                                AcuityController controller)
                         throws AcuityException
Uses the interaction content of the interaction object(presentation object) to set up the ui interaction/selection presentation object. The choice values and displays are set along with any default values for the interaction content.

Parameters:
mpi - the interaction content from the controller
po - the ui presentation object constructed to represent the ontology information
controller - the acuity controller to use
Throws:
AcuityException - If the controller errs

setIAOValues

public static void setIAOValues(java.util.List choices,
                                java.util.List answers,
                                InteractionObject po,
                                AcuityController controller)
                         throws AcuityException
Uses a list of choices and answers to set up the ui interaction/selection presentation object. The choice values and displays are set along with any default values for the interaction content.

Parameters:
choices - the choice values
answers - the current answer values
po - the ui presentation object constructed to represent the ontology information
controller - the acuity controller to use (if any)
Throws:
AcuityException - If the controller errs