wt.representation
Class StandardRepresentationService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.representation.StandardRepresentationService
All Implemented Interfaces:
Manager, NetFactor, RepresentationService, RepresentationServiceSvr, Serializable

public class StandardRepresentationService
extends StandardManager
implements RepresentationService, RepresentationServiceSvr, Serializable

Use the newStandardRepresentationService static factory method(s), not the StandardRepresentationService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class StandardRepresentationService.RepresentationEventListener
           
 
Field Summary
private static String CLASSNAME
           
private  KeyedEventListener listener
           
private static String RESOURCE
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardRepresentationService()
           
 
Method Summary
 Representable copyThumbnail(Representable representable, Representation representation)
          Copies the thumbnail content item in the passed Representation, if any, to the passed Representable.
 Void deleteRepresentation(Representation representation)
          Deletes the passed Representation, unless it is the default representation for the associated Representable.
 Void deleteRepresentation(Representation representation, boolean noDefaultsOK)
          If the noDefaultsOK argument is true, unconditionally deletes the passed Representation.
 Void deleteRepresentation(WTSet representations, boolean noDefaultsOK)
          If the noDefaultsOK argument is true, unconditionally deletes the passed Representations.
protected  void dispatchVetoableEvent(String eventType, Persistable target)
          

Supported API: false
 void emitReadyToPublishEvent(Persistable persistable)
          

Supported API: false
 void emitReadyToPublishEvent(Vector objects, ConfigSpec configSpec)
          

Supported API: false
 ApplicationData get3DThumbnail(Representable representable)
          Get the associated Thumbnail for the passed Representable.
 ApplicationData get3DThumbnail(Representation representation)
          Get the associated Thumbnail for the passed Representation.
 String getConceptualClassname()
          Deprecated.  
 Representation getDefaultRepresentation(Representable representable)
          Get the default Representation for the passed Representable.
 WTValuedMap getDefaultRepresentation(WTCollection representables)
          Gets the default Representations for the passed Representables.
 QueryResult getOutOfDateRepresentationContributors(Representation representation)
          Return all the associated RepresentationContributors that are responsible for making the Representation out of date.
 Representable getRepresentable(Representation representation)
          Get the Representable for the passed Representation

Supported API: false
 WTValuedMap getRepresentable(WTCollection representations)
          Gets the Representables for the passed Representations

Supported API: false
 QueryResult getRepresentations(Representable representable)
          Return all the associated Representations for the associated Representable

Supported API: false
 WTKeyedMap getRepresentations(WTCollection representables)
          Return all the associated Representations for the passed Representables.
 ApplicationData getThumbnail(Representable representable)
          Get the associated Thumbnail for the passed Representable.
 ApplicationData getThumbnail(Representable representable, ContentRoleType roleType)
           
 ApplicationData getThumbnail(Representation representation)
          Get the associated Thumbnail for the passed Representation.
 ApplicationData getThumbnail(Representation representation, ContentRoleType roleType)
           
 Representation makeDefaultRepresentation(Representable representable, Representation representation)
          Makes the passed Representation the default representation for the passed Representable.
static StandardRepresentationService newStandardRepresentationService()
          Default factory for the class.
protected  void performStartupProcess()
          

Supported API: false
private  void postMakeUnrestorable(Representable representable)
           
protected  void processContentCopyForward(WTKeyedMap map)
           
protected  void processPostChangeDomainEvent(WTCollection target)
           
protected  void processPreDeleteEvent(WTCollection target)
           
 void registerEvents(ManagerService managerService)
          Registers Representation service events with the service manager.
 ApplicationData store3DThumbnail(Representation representation, ApplicationData thumbnail, InputStream is)
          Store the thumbnail for the passed Representation.
 Representation storeRepresentation(Representation representation, Representable representable, String representationName, String representationDescription, RepresentationType representationType)
          Sets the representation attributes of the passed Representation and stores it in the database without any content.
 ApplicationData storeThumbnail(Representation representation, ApplicationData thumbnail, InputStream is)
          Store the thumbnail for the passed Representation.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

listener

private KeyedEventListener listener

VERBOSE

private static boolean VERBOSE
Constructor Detail

StandardRepresentationService

public StandardRepresentationService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException


Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

dispatchVetoableEvent

protected void dispatchVetoableEvent(String eventType,
                                     Persistable target)
                              throws WTException


Supported API: false

Parameters:
eventType -
target -
Throws:
WTException

registerEvents

public void registerEvents(ManagerService managerService)
Registers Representation service events with the service manager.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
managerService -

newStandardRepresentationService

public static StandardRepresentationService newStandardRepresentationService()
                                                                      throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardRepresentationService
Throws:
WTException

getThumbnail

public ApplicationData getThumbnail(Representable representable)
                             throws WTException
Get the associated Thumbnail for the passed Representable. Returns null if no thumbnail is found and throws a RepresentationException if more than one thumbnail is found.

Supported API: false

Specified by:
getThumbnail in interface RepresentationService
Parameters:
representable -
Returns:
ApplicationData
Throws:
WTException

getThumbnail

public ApplicationData getThumbnail(Representation representation)
                             throws WTException
Get the associated Thumbnail for the passed Representation. Returns null if no thumbnail is found and throws a RepresentationException if more than one thumbnail is found.

Supported API: false

Specified by:
getThumbnail in interface RepresentationService
Parameters:
representation -
Returns:
ApplicationData
Throws:
WTException

getOutOfDateRepresentationContributors

public QueryResult getOutOfDateRepresentationContributors(Representation representation)
                                                   throws WTException
Return all the associated RepresentationContributors that are responsible for making the Representation out of date. This list would normally be displayed to the user to decide if the Representation is still useable as is or should be re-published.

Supported API: false

Specified by:
getOutOfDateRepresentationContributors in interface RepresentationService
Parameters:
representation -
Returns:
QueryResult
Throws:
WTException

getRepresentations

public QueryResult getRepresentations(Representable representable)
                               throws WTException
Return all the associated Representations for the associated Representable

Supported API: false

Specified by:
getRepresentations in interface RepresentationService
Parameters:
representable -
Returns:
QueryResult
Throws:
WTException

getRepresentations

public WTKeyedMap getRepresentations(WTCollection representables)
                              throws WTException
Return all the associated Representations for the passed Representables.

Supported API: false

Specified by:
getRepresentations in interface RepresentationService
Parameters:
representables - WTCollection of Representables
Returns:
WTKeyedMap - keys are the Representables and values a WTList of the Representations associated with that Representable. A Representable without any Representation will not be included in the returned WTKeyedMap.
Throws:
WTException

getRepresentable

public Representable getRepresentable(Representation representation)
                               throws WTException
Get the Representable for the passed Representation

Supported API: false

Specified by:
getRepresentable in interface RepresentationService
Parameters:
representation -
Returns:
Representable
Throws:
WTException

getRepresentable

public WTValuedMap getRepresentable(WTCollection representations)
                             throws WTException
Gets the Representables for the passed Representations

Supported API: false

Specified by:
getRepresentable in interface RepresentationService
Parameters:
representations - WTCollection of Representations
Returns:
WTValuedMap - keys are the Representations and values are the Representables
Throws:
WTException

storeRepresentation

public Representation storeRepresentation(Representation representation,
                                          Representable representable,
                                          String representationName,
                                          String representationDescription,
                                          RepresentationType representationType)
                                   throws WTException,
                                          WTPropertyVetoException,
                                          PropertyVetoException
Sets the representation attributes of the passed Representation and stores it in the database without any content. The Representation's defaultRepresentation attribute will be set to false. Its other attributes will be set according to the passed input arguments. Only representable, representationName and representationType are required. The user must have READ permission for the Representable.

Supported API: false

Specified by:
storeRepresentation in interface RepresentationService
Parameters:
representation -
representable -
representationName -
representationDescription -
representationType -
Returns:
Representation
Throws:
WTException
WTPropertyVetoException
PropertyVetoException

deleteRepresentation

public Void deleteRepresentation(Representation representation)
                          throws WTException
Deletes the passed Representation, unless it is the default representation for the associated Representable. If it is the default, it will be deleted only if it is the only Representation associated with the Representable. Otherwise, another Representation must be made the default before this one may be deleted. Throws a RepresentationException if the Representation is not deleted.

Supported API: false

Specified by:
deleteRepresentation in interface RepresentationService
Parameters:
representation -
Returns:
Void
Throws:
WTException

deleteRepresentation

public Void deleteRepresentation(Representation representation,
                                 boolean noDefaultsOK)
                          throws WTException
If the noDefaultsOK argument is true, unconditionally deletes the passed Representation. If the noDefaultsOK argument is false, deletes the passed Representation only if its defaultRepresentation attribute is false or it is the only Representation for the associated Representable. Throws a RepresentationException if the Representation is not deleted.

Supported API: false

Specified by:
deleteRepresentation in interface RepresentationService
Parameters:
representation -
noDefaultsOK - Modifies method behavior if passed Representation is a default Representation. Set to true if it OK for the associated Representable to have Representations without one being designated the default. In this case, the passed Representation will be unconditionally deleted even if it a default Representation. Otherwise, the passed Representation will only be deleted if it is not a default Representation or is the only Representation associated with the Representable.
Returns:
Void
Throws:
WTException

deleteRepresentation

public Void deleteRepresentation(WTSet representations,
                                 boolean noDefaultsOK)
                          throws WTException
If the noDefaultsOK argument is true, unconditionally deletes the passed Representations. If the noDefaultsOK argument is false, deletes the passed Representations only if the Representation's defaultRepresentation attribute is false or it is the only Representation for the associated Representable. Throws a RepresentationException if any of the Representations is not deleted.

Supported API: false

Specified by:
deleteRepresentation in interface RepresentationService
Parameters:
representations - WTSet of Representations
noDefaultsOK - Modifies method behavior if a passed Representation is a default Representation. Set to true if it is OK for the associated Representable to have Representations without one being designated as the default. In this case, the passed Representation will be unconditionally deleted even if it is a default Representation. Otherwise, a Representation will only be deleted if it is not a default Representation or it is the only Representation associated with the Representable.
Returns:
Void
Throws:
WTException

getDefaultRepresentation

public Representation getDefaultRepresentation(Representable representable)
                                        throws WTException
Get the default Representation for the passed Representable.

Supported API: false

Specified by:
getDefaultRepresentation in interface RepresentationService
Parameters:
representable -
Returns:
Representation
Throws:
WTException

getDefaultRepresentation

public WTValuedMap getDefaultRepresentation(WTCollection representables)
                                     throws WTException
Gets the default Representations for the passed Representables.

Supported API: false

Specified by:
getDefaultRepresentation in interface RepresentationService
Parameters:
representables - WTCollection of Representables
Returns:
WTValuedMap - keys are the Representables and values are the default Representations for the Representables. A Representable without a default Representation will not be included in the returned WTValuedMap
Throws:
WTException

makeDefaultRepresentation

public Representation makeDefaultRepresentation(Representable representable,
                                                Representation representation)
                                         throws WTException,
                                                PropertyVetoException
Makes the passed Representation the default representation for the passed Representable. Thumbnail content will be copied from the passed Representation to the Representable.

Supported API: false

Specified by:
makeDefaultRepresentation in interface RepresentationService
Parameters:
representable -
representation -
Returns:
Representation
Throws:
WTException
PropertyVetoException

emitReadyToPublishEvent

public void emitReadyToPublishEvent(Persistable persistable)
                             throws WTException


Supported API: false

Specified by:
emitReadyToPublishEvent in interface RepresentationService
Parameters:
persistable -
Throws:
WTException

emitReadyToPublishEvent

public void emitReadyToPublishEvent(Vector objects,
                                    ConfigSpec configSpec)
                             throws WTException


Supported API: false

Specified by:
emitReadyToPublishEvent in interface RepresentationService
Parameters:
objects -
configSpec -
Throws:
WTException

get3DThumbnail

public ApplicationData get3DThumbnail(Representable representable)
                               throws WTException
Get the associated Thumbnail for the passed Representable. Returns null if no thumbnail is found and throws a RepresentationException if more than one thumbnail is found.

Supported API: false

Specified by:
get3DThumbnail in interface RepresentationService
Parameters:
representable -
Returns:
ApplicationData
Throws:
WTException

get3DThumbnail

public ApplicationData get3DThumbnail(Representation representation)
                               throws WTException
Get the associated Thumbnail for the passed Representation. Returns null if no thumbnail is found and throws a RepresentationException if more than one thumbnail is found.

Supported API: false

Specified by:
get3DThumbnail in interface RepresentationService
Parameters:
representation -
Returns:
ApplicationData
Throws:
WTException

storeThumbnail

public ApplicationData storeThumbnail(Representation representation,
                                      ApplicationData thumbnail,
                                      InputStream is)
                               throws WTException,
                                      PropertyVetoException,
                                      IOException,
                                      FileNotFoundException
Store the thumbnail for the passed Representation. Deletes any pre-existing thumbnails on the Representation. The attributes on the ApplicationData need to be set appropriately.

Supported API: false

Specified by:
storeThumbnail in interface RepresentationServiceSvr
Parameters:
representation -
thumbnail -
is -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

copyThumbnail

public Representable copyThumbnail(Representable representable,
                                   Representation representation)
                            throws WTException,
                                   PropertyVetoException
Copies the thumbnail content item in the passed Representation, if any, to the passed Representable. Any pre-existing thumbnail for the Representable is deleted, regardless of whether the passed Representation has a thumbnail.

Supported API: false

Specified by:
copyThumbnail in interface RepresentationServiceSvr
Parameters:
representable -
representation -
Returns:
Representable
Throws:
WTException
PropertyVetoException

store3DThumbnail

public ApplicationData store3DThumbnail(Representation representation,
                                        ApplicationData thumbnail,
                                        InputStream is)
                                 throws WTException,
                                        PropertyVetoException,
                                        IOException,
                                        FileNotFoundException
Store the thumbnail for the passed Representation. Deletes any pre-existing thumbnails on the Representation. The attributes on the ApplicationData need to be set appropriately.

Supported API: false

Specified by:
store3DThumbnail in interface RepresentationServiceSvr
Parameters:
representation -
thumbnail -
is -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

processContentCopyForward

protected void processContentCopyForward(WTKeyedMap map)
                                  throws WTException,
                                         PropertyVetoException
Throws:
WTException
PropertyVetoException

processPostChangeDomainEvent

protected void processPostChangeDomainEvent(WTCollection target)
                                     throws WTException
Throws:
WTException

processPreDeleteEvent

protected void processPreDeleteEvent(WTCollection target)
                              throws WTException,
                                     PropertyVetoException
Throws:
WTException
PropertyVetoException

getThumbnail

public ApplicationData getThumbnail(Representation representation,
                                    ContentRoleType roleType)
                             throws WTException
Throws:
WTException

getThumbnail

public ApplicationData getThumbnail(Representable representable,
                                    ContentRoleType roleType)
                             throws WTException
Throws:
WTException

postMakeUnrestorable

private void postMakeUnrestorable(Representable representable)
                           throws WTException
Throws:
WTException