wt.viewmarkup
Class StandardViewMarkUpService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.viewmarkup.StandardViewMarkUpService
All Implemented Interfaces:
Manager, NetFactor, Serializable, ViewMarkUpService

public class StandardViewMarkUpService
extends StandardManager
implements ViewMarkUpService, Serializable

Contains methods for creating and manipulating DerivedImages and their associated MarkUps.

Use the newStandardViewMarkUpService static factory method(s), not the StandardViewMarkUpService 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 StandardViewMarkUpService.ViewMarkUpEventListener
           
 
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
StandardViewMarkUpService()
           
 
Method Summary
 Void deleteDerivedImage(DerivedImage derivedImage)
          Deletes the passed DerivedImage, unless it is the default representation for the associated Representable.
 Void deleteDerivedImage(DerivedImage derivedImage, boolean noDefaultsOK)
          If the noDefaultsOK argument is true, unconditionally deletes the passed Representation.
 Void deleteDerivedImage(WTSet derivedImages, boolean noDefaultsOK)
          If the noDefaultsOK argument is true, unconditionally deletes the passed DerivedImages.
 Void deleteMarkUp(MarkUp markUp)
          Remove the passed MarkUp for the passed Markable.
 Void deleteMarkUp(WTSet markUps)
          Deletes the passed MarkUps

Supported API: false
 QueryResult findDuplicateDerivedImages(DerivedImage image)
          Finds other DerivedImages for the associated Representable with the same name and representationType as the passed DerviedImage.
protected  QueryResult findDuplicateDerivedImagesInternal(DerivedImage image, Representable representable)
           
 String getConceptualClassname()
          Deprecated.  
 ConfigSpec getDerivedFromConfigSpec(DerivedImage derivedImage)
          Gets the WTObject playing the role of derivedFromConfigSpec for the passed DerivedImage.
 QueryResult getMarkUps(Viewable viewable)
          Get all the associated MarkUps of a Viewable

Supported API: false
 WTKeyedMap getMarkUps(WTCollection viewables)
          Get all the MarkUps associated to a collection of Viewables.
 PublishingProhibition getPublishingProhibition(Representable representable)
          Gets the single most restrictive PublishingProhibition for a Representable; if null is returned, then the Representable is publishable.
 WTValuedMap getPublishingProhibition(WTCollection representables)
          Gets the single most restrictive PublishingProhibition for each Representable; if a Representable is not returned as a key in the WTValuedMap, then that Representable is publishable

Supported API: false
 ConfigSpec getRepresentableConfigSpec(DerivedImage derivedImage)
          Gets the WTObject playing the role of representableConfigSpec for the passed DerivedImage.
 Viewable getViewable(MarkUp markUp)
          Get the Viewable for the passed MarkUp

Supported API: false
 WTValuedMap getViewable(WTCollection markUps)
          Gets the associated Viewables for the passed MarkUps.
 void lockMarkUp(MarkUp markUp)
          Lock the passed MarkUp for the current WTPrincipal.
static StandardViewMarkUpService newStandardViewMarkUpService()
          Default factory for the class.
protected  void performStartupProcess()
          

Supported API: false
private  void postMakeUnrestorable(Viewable viewable)
           
 DerivedImage postStoreDerivedImage(DerivedImage derivedImage, Boolean defaultRepresentation)
          This method should be called after a DerivedImage has been persisted with storeDerivedImage and after its contents have been uploaded.
protected  void processCleanupLinkEvent(Persistable target, Persistable plink)
           
protected  void processPostChangeDomainEvent(WTCollection target)
           
 ConfigSpec setDerivedFromConfigSpec(ConfigSpec configSpec, DerivedImage derivedImage)
          Copies the passed ConfigSpec and stores it as the object playing the role of derivedFromonfigSpec for the passed DerivedImage.
protected  ConfigSpec setDerivedFromConfigSpecInternal(ConfigSpec configSpec, DerivedImage derivedImage, boolean check)
           
 ConfigSpec setRepresentableConfigSpec(ConfigSpec configSpec, DerivedImage derivedImage)
          Copies the passed ConfigSpec and stores it as the object playing the role of representableConfigSpec for the passed DerivedImage.
protected  ConfigSpec setRepresentableConfigSpecInternal(ConfigSpec configSpec, DerivedImage derivedImage, boolean check)
           
 DerivedImage storeDerivedImage(Representable representable, String imageName, String imageDescription, String imageAdditionalInfo, RepresentationType imageType, DerivationType derivationType, ConfigSpec representableConfigSpec, ConfigSpec derivedFromConfigSpec, RepresentationContributor derivedFrom)
          Store a DerivedImage in the database without any content..
 DerivedImage storeDerivedImage(Representable representable, String imageName, String imageDescription, String imageAdditionalInfo, RepresentationType imageType, DerivationType derivationType, ConfigSpec representableConfigSpec, ConfigSpec derivedFromConfigSpec, RepresentationContributor derivedFrom, String CADFormName, String CADPartName)
          Store a DerivedImage in the database without any content..
 MarkUp storeMarkUp(Viewable viewable, MarkUp markUp)
          Store a MarkUp for the passed Viewable.
 void unLockMarkUp(MarkUp markUp)
          Remove the passed MarkUp for the passed Markable.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, registerEvents, 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

StandardViewMarkUpService

public StandardViewMarkUpService()
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

newStandardViewMarkUpService

public static StandardViewMarkUpService newStandardViewMarkUpService()
                                                              throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardViewMarkUpService
Throws:
WTException

storeMarkUp

public MarkUp storeMarkUp(Viewable viewable,
                          MarkUp markUp)
                   throws WTException
Store a MarkUp for the passed Viewable.

Supported API: false

Specified by:
storeMarkUp in interface ViewMarkUpService
Parameters:
viewable -
markUp -
Returns:
MarkUp
Throws:
WTException

getMarkUps

public QueryResult getMarkUps(Viewable viewable)
                       throws WTException
Get all the associated MarkUps of a Viewable

Supported API: false

Specified by:
getMarkUps in interface ViewMarkUpService
Parameters:
viewable -
Returns:
QueryResult
Throws:
WTException

getMarkUps

public WTKeyedMap getMarkUps(WTCollection viewables)
                      throws WTException
Get all the MarkUps associated to a collection of Viewables.

Supported API: false

Specified by:
getMarkUps in interface ViewMarkUpService
Parameters:
viewables - WTCollection of Viewables
Returns:
WTKeyedMap - keys are the Viewables and values are a WTList of MarkUp objects. A Viewable with no MarkUp will not be included in the returned WTKeyedMap.
Throws:
WTException

getViewable

public Viewable getViewable(MarkUp markUp)
                     throws WTException
Get the Viewable for the passed MarkUp

Supported API: false

Specified by:
getViewable in interface ViewMarkUpService
Parameters:
markUp -
Returns:
Viewable
Throws:
WTException

getViewable

public WTValuedMap getViewable(WTCollection markUps)
                        throws WTException
Gets the associated Viewables for the passed MarkUps.

Supported API: false

Specified by:
getViewable in interface ViewMarkUpService
Parameters:
markUps - WTCollection of MarkUp objects
Returns:
WTValuedMap - keys are the Markups and the values are the Viewables
Throws:
WTException

deleteMarkUp

public Void deleteMarkUp(MarkUp markUp)
                  throws WTException
Remove the passed MarkUp for the passed Markable.

Supported API: false

Specified by:
deleteMarkUp in interface ViewMarkUpService
Parameters:
markUp -
Returns:
Void
Throws:
WTException

deleteMarkUp

public Void deleteMarkUp(WTSet markUps)
                  throws WTException
Deletes the passed MarkUps

Supported API: false

Specified by:
deleteMarkUp in interface ViewMarkUpService
Parameters:
markUps - WTCollection of MarkUp objects
Returns:
Void
Throws:
WTException

unLockMarkUp

public void unLockMarkUp(MarkUp markUp)
                  throws WTException,
                         WTPropertyVetoException
Remove the passed MarkUp for the passed Markable.

Supported API: false

Specified by:
unLockMarkUp in interface ViewMarkUpService
Parameters:
markUp -
Throws:
WTException
WTPropertyVetoException

lockMarkUp

public void lockMarkUp(MarkUp markUp)
                throws WTException,
                       WTPropertyVetoException
Lock the passed MarkUp for the current WTPrincipal.

Supported API: false

Specified by:
lockMarkUp in interface ViewMarkUpService
Parameters:
markUp -
Throws:
WTException
WTPropertyVetoException

storeDerivedImage

public DerivedImage storeDerivedImage(Representable representable,
                                      String imageName,
                                      String imageDescription,
                                      String imageAdditionalInfo,
                                      RepresentationType imageType,
                                      DerivationType derivationType,
                                      ConfigSpec representableConfigSpec,
                                      ConfigSpec derivedFromConfigSpec,
                                      RepresentationContributor derivedFrom)
                               throws WTException,
                                      WTPropertyVetoException,
                                      PropertyVetoException
Store a DerivedImage in the database without any content.. The image will be associated to the passed Representable and have a defaultRepresentation attribute of false. Its other attributes will be set according to the passed input arguments. Only representable, imageName, imageType, and derivationType are required. The other attribute arguments may be null. If one or more configSpec objects are passed, they must be PersistableConfigSpecs. Each configSpec will be copied and the copy stored with the DerivedImage. User must have READ permission for the associated Representable object.

Supported API: false

Specified by:
storeDerivedImage in interface ViewMarkUpService
Parameters:
representable - The object playing the role of representable for the DerivedImage. Required.
imageName - Name of the DerivedImage. Required.
imageDescription - Description of the DerivedImage. Optional.
imageAdditionalInfo - Additional information for the DerivedImage. Optional.
imageType - RepresentationType of the DerivedImage. Required.
derivationType - DerivationType of the DerivedImage. Required.
representableConfigSpec - Object playing the role of representableConfigSpec. Must be a WTObject. Optional.
derivedFromConfigSpec - Object playing the role of derivedFromConfigSpec. Must be a WTObject. Optional.
derivedFrom - Object playing the role of derivedFrom. Optional.
Returns:
DerivedImage
Throws:
WTException
WTPropertyVetoException
PropertyVetoException

storeDerivedImage

public DerivedImage storeDerivedImage(Representable representable,
                                      String imageName,
                                      String imageDescription,
                                      String imageAdditionalInfo,
                                      RepresentationType imageType,
                                      DerivationType derivationType,
                                      ConfigSpec representableConfigSpec,
                                      ConfigSpec derivedFromConfigSpec,
                                      RepresentationContributor derivedFrom,
                                      String CADFormName,
                                      String CADPartName)
                               throws WTException,
                                      WTPropertyVetoException,
                                      PropertyVetoException
Store a DerivedImage in the database without any content.. The image will be associated to the passed Representable and have a defaultRepresentation attribute of false. Its other attributes will be set according to the passed input arguments. Only representable, imageName, imageType, and derivationType are required. The other attribute arguments may be null. If one or more configSpec objects are passed, they must be WTObjects. Each configSpec will be copied and the copy stored with the DerivedImage. User must have READ permission for the associated Representable object.

Supported API: false

Specified by:
storeDerivedImage in interface ViewMarkUpService
Parameters:
representable - The object playing the role of representable for the DerivedImage. Required.
imageName - Name of the DerivedImage. Required.
imageDescription - Description of the DerivedImage. Optional.
imageAdditionalInfo - Additional information for the DerivedImage. Optional.
imageType - RepresentationType of the DerivedImage. Required.
derivationType - DerivationType of the DerivedImage. Required.
representableConfigSpec - Object playing the role of representableConfigSpec. Must be a WTObject. Optional.
derivedFromConfigSpec - Object playing the role of derivedFromConfigSpec. Must be a WTObject. Optional.
derivedFrom - Object playing the role of derivedFrom. Optional.
CADFormName -
CADPartName -
Returns:
DerivedImage
Throws:
WTException
WTPropertyVetoException
PropertyVetoException

postStoreDerivedImage

public DerivedImage postStoreDerivedImage(DerivedImage derivedImage,
                                          Boolean defaultRepresentation)
                                   throws WTException,
                                          PropertyVetoException
This method should be called after a DerivedImage has been persisted with storeDerivedImage and after its contents have been uploaded. It deletes any other DerivedImages with the same name and RepresentationType associated with the same Representable, unless those images have markups, in which case the image is not deleted and the Representable will have two DerivedImages with the same name and type but different create timestamps. This method also sets the defaultRepresentation attribute on the DerivedImage and, if this attribute is true, stores the DerivedImage's thumbnail with the associated Representable. The passed DerivedImage will be made the default if one of the following is true: (1) the associated Representable has no other default Representations (after deleting others with the same name and type) or (2) the passed default argument is true.

Supported API: false

Specified by:
postStoreDerivedImage in interface ViewMarkUpService
Parameters:
derivedImage -
defaultRepresentation -
Returns:
DerivedImage
Throws:
WTException
PropertyVetoException

deleteDerivedImage

public Void deleteDerivedImage(DerivedImage derivedImage)
                        throws WTException
Deletes the passed DerivedImage, 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 is deleted. Throws a RepresentationException if the Representation is not deleted.

Supported API: false

Specified by:
deleteDerivedImage in interface ViewMarkUpService
Parameters:
derivedImage -
Returns:
Void
Throws:
WTException

deleteDerivedImage

public Void deleteDerivedImage(DerivedImage derivedImage,
                               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:
deleteDerivedImage in interface ViewMarkUpService
Parameters:
derivedImage -
noDefaultsOK -
Returns:
Void
Throws:
WTException

deleteDerivedImage

public Void deleteDerivedImage(WTSet derivedImages,
                               boolean noDefaultsOK)
                        throws WTException
If the noDefaultsOK argument is true, unconditionally deletes the passed DerivedImages. If the noDefaultsOK argument is false, deletes a passed DerivedImage only if its defaultRepresentation attribute is false or it is the only Representation for the associated Representable. Throws a RepresentationException if any of the DerivedImages is not deleted.

Supported API: false

Specified by:
deleteDerivedImage in interface ViewMarkUpService
Parameters:
derivedImages - WTSet of DerivedImage objects
noDefaultsOK -
Returns:
Void
Throws:
WTException

getDerivedFromConfigSpec

public ConfigSpec getDerivedFromConfigSpec(DerivedImage derivedImage)
                                    throws WTException
Gets the WTObject playing the role of derivedFromConfigSpec for the passed DerivedImage. Returns null if no derivedFromConfigSpec is found.

Supported API: false

Specified by:
getDerivedFromConfigSpec in interface ViewMarkUpService
Parameters:
derivedImage -
Returns:
ConfigSpec
Throws:
WTException

setDerivedFromConfigSpec

public ConfigSpec setDerivedFromConfigSpec(ConfigSpec configSpec,
                                           DerivedImage derivedImage)
                                    throws WTException,
                                           WTPropertyVetoException
Copies the passed ConfigSpec and stores it as the object playing the role of derivedFromonfigSpec for the passed DerivedImage. The pre-existing derivedFromConfigSpec, if any, is deleted. The passed DerivedImage must be persisted and the passed config spec must be a PersistableConfigSpec. A ViewMarkUpException is thrown if either of these is not true.

Supported API: false

Specified by:
setDerivedFromConfigSpec in interface ViewMarkUpService
Parameters:
configSpec -
derivedImage -
Returns:
ConfigSpec
Throws:
WTException
WTPropertyVetoException

getRepresentableConfigSpec

public ConfigSpec getRepresentableConfigSpec(DerivedImage derivedImage)
                                      throws WTException
Gets the WTObject playing the role of representableConfigSpec for the passed DerivedImage. Returns null if no representableConfigSpec is found.

Supported API: false

Specified by:
getRepresentableConfigSpec in interface ViewMarkUpService
Parameters:
derivedImage -
Returns:
ConfigSpec
Throws:
WTException

setRepresentableConfigSpec

public ConfigSpec setRepresentableConfigSpec(ConfigSpec configSpec,
                                             DerivedImage derivedImage)
                                      throws WTException,
                                             WTPropertyVetoException
Copies the passed ConfigSpec and stores it as the object playing the role of representableConfigSpec for the passed DerivedImage. The pre-existing representableConfigSpec, if any, is deleted. The passed ConfigSpec must be a PersistableConfigSpec and the passed DerivedImage must be persisted. A ViewMarkUpException is thrown if either of these is not true.

Supported API: false

Specified by:
setRepresentableConfigSpec in interface ViewMarkUpService
Parameters:
configSpec -
derivedImage -
Returns:
ConfigSpec
Throws:
WTException
WTPropertyVetoException

findDuplicateDerivedImages

public QueryResult findDuplicateDerivedImages(DerivedImage image)
                                       throws WTException
Finds other DerivedImages for the associated Representable with the same name and representationType as the passed DerviedImage.

Supported API: false

Specified by:
findDuplicateDerivedImages in interface ViewMarkUpService
Parameters:
image -
Returns:
QueryResult
Throws:
WTException

getPublishingProhibition

public PublishingProhibition getPublishingProhibition(Representable representable)
                                               throws WTException
Gets the single most restrictive PublishingProhibition for a Representable; if null is returned, then the Representable is publishable.

Supported API: false

Specified by:
getPublishingProhibition in interface ViewMarkUpService
Parameters:
representable -
Returns:
PublishingProhibition
Throws:
WTException

getPublishingProhibition

public WTValuedMap getPublishingProhibition(WTCollection representables)
                                     throws WTException
Gets the single most restrictive PublishingProhibition for each Representable; if a Representable is not returned as a key in the WTValuedMap, then that Representable is publishable

Supported API: false

Specified by:
getPublishingProhibition in interface ViewMarkUpService
Parameters:
representables - WTCollection of Representable objects
Returns:
WTValuedMap - keys are the Representables and the values are PublishingProhibition objects
Throws:
WTException

setRepresentableConfigSpecInternal

protected ConfigSpec setRepresentableConfigSpecInternal(ConfigSpec configSpec,
                                                        DerivedImage derivedImage,
                                                        boolean check)
                                                 throws WTException,
                                                        WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

setDerivedFromConfigSpecInternal

protected ConfigSpec setDerivedFromConfigSpecInternal(ConfigSpec configSpec,
                                                      DerivedImage derivedImage,
                                                      boolean check)
                                               throws WTException,
                                                      WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

findDuplicateDerivedImagesInternal

protected QueryResult findDuplicateDerivedImagesInternal(DerivedImage image,
                                                         Representable representable)
                                                  throws WTException
Throws:
WTException

processCleanupLinkEvent

protected void processCleanupLinkEvent(Persistable target,
                                       Persistable plink)
                                throws WTException
Throws:
WTException

processPostChangeDomainEvent

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

postMakeUnrestorable

private void postMakeUnrestorable(Viewable viewable)
                           throws WTException
Throws:
WTException