Package com.ptc.wvs.common.ui
Class VisualizationHelper
java.lang.Object
com.ptc.wvs.common.ui.VisualizationHelper
- All Implemented Interfaces:
VisualizationHelperIfc
The VisualizationHelper class provides abstract access to class methods in the com.ptc.wvs
package from external packages such as wt and provides visualization helper methods.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum defining the Permissions of a Representation (READ, MODIFY, DELETE). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThumbnail preference default value to use in getIndexOfVisLink
Supported API: truestatic final StringThumbnail preference key to use in getIndexOfVisLink
Supported API: trueFields inherited from interface wt.wvs.VisualizationHelperIfc
LINK_NAVIGATION_ALL, LINK_NAVIGATION_DESCRIBE, LINK_NAVIGATION_NON_OWNER, LINK_NAVIGATION_NON_PRIMARY_OWNER -
Constructor Summary
ConstructorsConstructorDescriptionNo-arg constructor for this VisualizationHelper class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the index of the Add to Clipboard link in the data array returned by getDefaultVisualizationData
Supported API: truebooleancopyToDescribedParts(Representation _sourceRepresentation, boolean _includeMarkUps, boolean _defaultRepresentation, boolean _requireOwnerLink, boolean _latestIteration, int _linkNavigation) Copies the source Representation to the described parts.booleancopyToDescribedParts(Representation _sourceRepresentation, EPMDocument _targetEPMDocument, boolean _includeMarkUps, boolean _defaultRepresentation, boolean _requireOwnerLink, boolean _latestIteration, int _linkNavigation) Copy a representation to all described parts.findDescribedParts(EPMDocument _targetEPMDoc, int _linkNavigation, boolean _executeHook) Find Described Parts for the given EPMDocument.Find the representable to be used for a given object.Returns the JavaScript to create a Dialog Window.String[]getDefaultVisualizationData(String representableObjectReference, Boolean forListing, Locale locale) Returns a set of HTML fragments to display thumbnails and other visualization action links
Supported API: trueintgetIndexOfVisLink(String prefKey, String prefDefault) Returns the index in the data array returned by getDefaultVisualizationData of the HTML fragment to use for launching PV.Get the default representation for an object.getRepresentation(Persistable d, String repName) Get the named representation for an object.Get the representations for an object.int[]Returns the thumbnail width and height
Supported API: truebooleanReturns true if the WVS property partstructureview is true.booleanReturns true if visual nagigation is installed
Supported API: truebooleanReturns true if visualization services are enabled
Supported API: trueintReturns the index of the Print link in the data array returned by getDefaultVisualizationData
Supported API: trueintReturns the index of the Launch ProductView link in the data array returned by getDefaultVisualizationData
Supported API: truestatic booleansetAccess(Representation representation, VisualizationHelper.RepresentationPermission permission, WTPrincipal principal) Set AdHoc permissions on Representations.intReturns the index of the thumbnail, Publish Me, or Launch ProductView link in the data array returned by getDefaultVisualizationData.intReturns the index of the view representations link in the data array returned by getDefaultVisualizationData
Supported API: true
-
Field Details
-
THUMBNAILS_PROP_PAGE_PREF_KEY
Thumbnail preference key to use in getIndexOfVisLink
Supported API: true- See Also:
-
DEFAULT_THUMBNAILS_PROP_PAGE_PREF_VALUE
Thumbnail preference default value to use in getIndexOfVisLink
Supported API: true- See Also:
-
-
Constructor Details
-
VisualizationHelper
public VisualizationHelper()No-arg constructor for this VisualizationHelper class.
Supported API: true
-
-
Method Details
-
isWVSEnabled
public boolean isWVSEnabled()Returns true if visualization services are enabled
Supported API: true- Specified by:
isWVSEnabledin interfaceVisualizationHelperIfc
-
isDisplayPartViewEnabled
public boolean isDisplayPartViewEnabled()Returns true if the WVS property partstructureview is true. NOTE: Also insures that visualization services and required software is installed and configured.
Supported API: true- Specified by:
isDisplayPartViewEnabledin interfaceVisualizationHelperIfc
-
getThumbnailSize
public int[] getThumbnailSize()Returns the thumbnail width and height
Supported API: true- Specified by:
getThumbnailSizein interfaceVisualizationHelperIfc
-
getCreateDialogWindow
Returns the JavaScript to create a Dialog Window. This should be called once per page, and included in the HEAD of the page
Supported API: true- Specified by:
getCreateDialogWindowin interfaceVisualizationHelperIfc
-
getDefaultVisualizationData
public String[] getDefaultVisualizationData(String representableObjectReference, Boolean forListing, Locale locale) Returns a set of HTML fragments to display thumbnails and other visualization action links
Supported API: true- Specified by:
getDefaultVisualizationDatain interfaceVisualizationHelperIfc- Parameters:
representableObjectReference- The object reference of the representableforListing- Specifies if the resulting HTML is to be used in a listinglocale- Specifies the locale to use for tooltip display- Returns:
- String[] HTML fragments, which can be extracted using the "...Index" methods in this class
-
productViewLinkIndex
public int productViewLinkIndex()Returns the index of the Launch ProductView link in the data array returned by getDefaultVisualizationData
Supported API: true- Specified by:
productViewLinkIndexin interfaceVisualizationHelperIfc
-
thumbnailLinkIndex
public int thumbnailLinkIndex()Returns the index of the thumbnail, Publish Me, or Launch ProductView link in the data array returned by getDefaultVisualizationData. The graphic returned depends on the state of the Representable object.
Supported API: true- Specified by:
thumbnailLinkIndexin interfaceVisualizationHelperIfc
-
clipboardLinkIndex
public int clipboardLinkIndex()Returns the index of the Add to Clipboard link in the data array returned by getDefaultVisualizationData
Supported API: true- Specified by:
clipboardLinkIndexin interfaceVisualizationHelperIfc
-
printLinkIndex
public int printLinkIndex()Returns the index of the Print link in the data array returned by getDefaultVisualizationData
Supported API: true- Specified by:
printLinkIndexin interfaceVisualizationHelperIfc
-
viewRepsLinkIndex
public int viewRepsLinkIndex()Returns the index of the view representations link in the data array returned by getDefaultVisualizationData
Supported API: true- Specified by:
viewRepsLinkIndexin interfaceVisualizationHelperIfc
-
getIndexOfVisLink
Returns the index in the data array returned by getDefaultVisualizationData of the HTML fragment to use for launching PV. This depends on the thumbnail preference setting for the client. The index returned will be that of the element containing the Launch PV icon (productViewLinkIndex) or the element containing the thumbnail (thumbnailLinkIndex).- Specified by:
getIndexOfVisLinkin interfaceVisualizationHelperIfc- Parameters:
prefKey- The key for the user preference to display thumbnails use THUMBNAILS_PROP_PAGE_PREF_KEY for the property page preference keyprefDefault- The default value for the key, use DEFAULT_THUMBNAILS_PROP_PAGE_PREF_VALUE for the default property page value
Supported API: true
-
findDescribedParts
public WTCollection findDescribedParts(EPMDocument _targetEPMDoc, int _linkNavigation, boolean _executeHook) Find Described Parts for the given EPMDocument.- Specified by:
findDescribedPartsin interfaceVisualizationHelperIfc- Parameters:
_targetEPMDoc- The EPMDocument object to find all of the Described Parts for._linkNavigation- Indicate which links should be used when doing the navigation from the given EPMDocument to the Described Parts. The following are supported values which can be concatenated together to indicate more than one link type (Bit Mask):VisualizationHelperIfc.LINK_NAVIGATION_NON_OWNERVisualizationHelperIfc.LINK_NAVIGATION_NON_PRIMARY_OWNERVisualizationHelperIfc.LINK_NAVIGATION_DESCRIBEVisualizationHelperIfc.LINK_NAVIGATION_ALLboolean- _executeHook Whether or not to execute a configured "Find Described Parts" hook. See wvs.properties.xconf for configuration information.
Supported API: true
-
copyToDescribedParts
public boolean copyToDescribedParts(Representation _sourceRepresentation, boolean _includeMarkUps, boolean _defaultRepresentation, boolean _requireOwnerLink, boolean _latestIteration, int _linkNavigation) Copies the source Representation to the described parts.- Specified by:
copyToDescribedPartsin interfaceVisualizationHelperIfc- Parameters:
_sourceRepresentation- Representation to copy from._includeMarkUps- Copy all associated MarkUps associated to the representation._defaultRepresentation- Should the source representation be the "default" in order to proceed with copying to all described parts._requireOwnerLink- Should the target EPMDocument have a Owner link to a WTPart in order to proceed with copying to all described parts._latestIteration- Should the target EPMDocument be the latest iteration in order to proceed with copying to all described parts._linkNavigation- Indicate which links should be used when doing the navigation from the given EPMDocument to the Described Parts. The following are supported values which can be concatenated together to indicate more than one link type (Bit Mask):VisualizationHelperIfc.LINK_NAVIGATION_NON_OWNERVisualizationHelperIfc.LINK_NAVIGATION_NON_PRIMARY_OWNERVisualizationHelperIfc.LINK_NAVIGATION_DESCRIBEVisualizationHelperIfc.LINK_NAVIGATION_ALL- Returns:
- boolean If the copy was successful
Supported API: true
-
copyToDescribedParts
public boolean copyToDescribedParts(Representation _sourceRepresentation, EPMDocument _targetEPMDocument, boolean _includeMarkUps, boolean _defaultRepresentation, boolean _requireOwnerLink, boolean _latestIteration, int _linkNavigation) Copy a representation to all described parts.- Specified by:
copyToDescribedPartsin interfaceVisualizationHelperIfc- Parameters:
_sourceRepresentation- Representation to copy from._targetEPMDocument- The EPMDocument used to find associated described parts to copy the source representation to._includeMarkUps- Copy all associated MarkUps associated to the representation._defaultRepresentation- Should the source representation be the "default" in order to proceed with copying to all described parts._requireOwnerLink- Should the target EPMDocument have a Owner link to a WTPart in order to proceed with copying to all described parts._latestIteration- Should the target EPMDocument be the latest iteration in order to proceed with copying to all described parts._linkNavigation- Indicate which links should be used when doing the navigation from the given EPMDocument to the Described Parts. The following are supported values which can be concatenated together to indicate more than one link type (Bit Mask):VisualizationHelperIfc.LINK_NAVIGATION_NON_OWNERVisualizationHelperIfc.LINK_NAVIGATION_NON_PRIMARY_OWNERVisualizationHelperIfc.LINK_NAVIGATION_DESCRIBEVisualizationHelperIfc.LINK_NAVIGATION_ALL- Returns:
- boolean If the copy was successful
Supported API: true
-
findRepresentable
Find the representable to be used for a given object. If the object is an EPMDocument this will return an actively associated WTPart, otherwise if the object is Representable it will return the same object as was passed.- Specified by:
findRepresentablein interfaceVisualizationHelperIfc- Parameters:
Persistable- d - object to find Representable for- Returns:
- Representable
Supported API: true
-
getRepresentations
Get the representations for an object. If an EPMDocument is given this will locate the representations on an actively associated WTPart- Parameters:
Persistable- d - object to locate representations for- Returns:
- QueryResult of Representations
Supported API: true
-
getRepresentation
Get the default representation for an object. If an EPMDocument is given this will locate a representation on an actively associated WTPart- Specified by:
getRepresentationin interfaceVisualizationHelperIfc- Parameters:
Persistable- d - object to locate representation for- Returns:
- Representation
Supported API: true
-
getRepresentation
Get the named representation for an object. If an EPMDocument is given this will locate a representation on an actively associated WTPart- Specified by:
getRepresentationin interfaceVisualizationHelperIfc- Parameters:
Persistable- d - object to locate representation forString- repName - the Represnetation name- Returns:
- Representation
Supported API: true
-
setAccess
public static boolean setAccess(Representation representation, VisualizationHelper.RepresentationPermission permission, WTPrincipal principal) Set AdHoc permissions on Representations. This method will return true of successful. If it returns false, look for stack trace in the method serverlog.
Pre-requisites: For this API to work, the Principal calling this API should have "Change Permissions" access on the Representations in the given domain. Also the principal calling this method can only give permissions (not take away) that he/she has.
Supported API: true- Parameters:
representation- The representation you want to set adhoc permissions onpermission- This can be either VisualizationHelper.Representation.READ or VisualizationHelper.Representation.MODIFY or VisualizationHelper.Representation.DELETEprincipal- The WTPrincipal who gets the access permissions- Returns:
- boolean
-