|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.adobe.icomm.assetplacement.model.PackageDefinition
public class PackageDefinition
The "model" for the package is the XML document contained within the PackageDefinition object.
Nested Class Summary | |
---|---|
static class |
PackageDefinition.PackageType
The possible package types. |
Field Summary | |
---|---|
static String |
ALTTEXT_ATTR
XML attribute "altText". |
static String |
ASSETS_ELEMENT
XML element "assets". |
static String |
ATTACHMENT_ELEMENT
XML element "attachment". |
static String |
ATTACHMENTLOADER_ELEMENT
The AttachmentLoader controller. |
static String |
ATTACHMENTS_ELEMENT
XML element "attachments". |
static String |
CONTENTTYPE_ATTR
XML attribute "contentType". |
static String |
CONTROLLER_ATTR
XML attribute "controller". |
static String |
CONTROLLER_NS
The controller namespace. |
static String |
CONTROLLERS_ELEMENT
XML element "controllers". |
static String |
DATA_ELEMENT
XML element "data". |
static String |
DEFAULT_LOCALE
Default locale. |
static String |
DELAY_ELEMENT
XML element "delay". |
static String |
DESCRIPTION_ATTR
XML attribute "description". |
static String |
EXPIRATION_ATTR
XML attribute "expiration". |
static String |
HEIGHT_ATTR
XML attribute "height". |
static String |
ID_ATTR
XML attribute "id". |
static String |
INTERACTIVEDOCUMENT_DATA_ID
The default id used for interactive document data. |
static String |
LOCALE_ATTR
XML attribute "locale". |
static String |
NAME_ATTR
XML attribute "name". |
static String |
NAV_PACKAGE_TYPE
XML attribute "nav". |
static String |
PACKAGE_ELEMENT
XML element "package". |
static String |
PACKAGE_FILE_NAME
The package definition file name. |
static String |
PACKAGE_NS
The package namespace. |
static Float |
PACKAGE_VERSION_1_0
The package 1.0. |
static Float |
PACKAGE_VERSION_2_0
The package version 2.0. |
static Float |
PACKAGE_VERSION_CURRENT
The current package version. |
static String |
PRINTDOCUMENT_ID
The default id used for a print version of the interactive document. |
static String |
PROMOIMAGE_ELEMENT
The PromoImage controller. |
static String |
PROMOIMAGESLIDESHOW_ELEMENT
The PromoImageSlideShow controller. |
static String |
PROMOMODULELOADER_ELEMENT
The PromoModuleLoader controller. |
static String |
PROMOSWFLOADER_ELEMENT
The PromoSWFLoader controller. |
static String |
RESOURCE_ELEMENT
XML element "resource". |
static String |
RESOURCES_ELEMENT
XML element "resources". |
static String |
SCALINGMETHOD_ATTR
XML attribute "scalingMethod". |
static String |
SOURCE_ATTR
XML attribute "source". |
static String |
TARGETURL_ATTR
XML attribute "targetURL". |
static String |
TYPE_ATTR
XML attribute "type". |
static String |
VERSION_ATTR
XML attribute "version". |
static String |
WIDTH_ATTR
XML attribute "width". |
static String |
XFA_PACKAGE_TYPE
XML attribute "xfa". |
static String |
XMLDATALOADER_ELEMENT
The XMLDataLoader controller. |
Constructor Summary | |
---|---|
PackageDefinition()
Creates a new empty package definition. |
|
PackageDefinition(Document doc)
Constructs a package given an Document. |
|
PackageDefinition(InputStream stream)
Constructs a package definition from an InputStream that will read from a package.xml. |
Method Summary | |
---|---|
Attachment |
addAttachment(String controllerID,
String name)
Finds. |
AssetLoaderController |
addAttachmentLoader(String id)
Adds a new AttachmentLoader to the package definition. |
Controller |
addController(String namespaceURI,
String tagName,
String id)
Adds a new controller to the package definition with the given namespace,tagname and id. |
PromoImageController |
addPromoImage(String id)
Adds a new PromoImage to the package definition. |
PromoImageSlideShowController |
addPromoImageSlideShow(String id)
Adds a new PromoImageSlideShow to the package definition. |
PromoModuleLoaderController |
addPromoModuleLoader(String id)
Adds a new PromoModuleLoaderController to the package definition. |
PromoSWFLoaderController |
addPromoSWFLoader(String id)
Adds a new PromoSWFLoaderController to the package definition. |
Resource |
addResource(String controllerID)
Finds the <resources> entry with the given controller id and adds a new <resource> child with the given name. |
AssetLoaderController |
addXMLDataLoader(String id)
Adds a new XMLDataLoader to the package definition. |
List |
getAttachmentLoaders()
Returns a list of all AttachmentLoader controllers. |
List |
getAttachments()
Gets the list of attachments defined in this package, one for every <attachment> node in the document. |
Controller |
getController(String controllerID)
Returns the controller with the given id. |
List |
getControllers()
Gets the list of controllers defined in this package. |
List |
getControllersNS(String namespaceURI,
String tagName)
Returns a list of controllers matching a given namespace and tagname. |
AssetLoaderController |
getDocumentDataLoader()
Finds and returns the XML Data controller that is associated with the interactive document's data. |
String |
getPackageLocale()
Returns the package definition locale value. |
String |
getPackageSource()
Returns the package definition source value, as in <package source="" >. |
PackageDefinition.PackageType |
getPackageType()
Returns the package definition type value. |
Float |
getPackageVersion()
Returns the package definition version, as in <package version="" >. |
AssetLoaderController |
getPrintDocumentLoader()
Finds and returns the XML Data controller that is associated the printDocument resource entry. |
List |
getPromoImages()
Returns a list of all PromoImage controllers. |
List |
getPromoImageSlideShows()
Returns a list of all PromoImageSlideShow controllers. |
List |
getPromoModuleLoaders()
Returns a list of all PromoModuleLoaderController controllers. |
List |
getPromoSWFLoaders()
Returns a list of all PromoSWFLoader controllers. |
List |
getResources()
Gets the list of resources defined in this package, one for every <resource> node in the document. |
List |
getXMLDataLoaders()
Returns a list of all XMLDataLoader controllers. |
void |
removeAttachments(String controllerID)
Removes all <attachments> associated with the given controller id from the package definition. |
void |
removeController(String controllerID)
Removes any and all controllers with the specified id. |
void |
removeResources(String controllerID)
Removes all <resources> associated with the given controller id from the package definition. |
String |
saveXML()
Returns the package definition XML. |
byte[] |
serialize()
Returns a serialized package definition XML. |
void |
setPackageLocale(String locale)
Sets the package definition locale value. |
void |
setPackageSource(String val)
Sets the package definition source value, as in <package source="" >. |
void |
setPackageType(PackageDefinition.PackageType type)
Sets the package definition type value by modifying the <package type=""> attribute. |
void |
setPackageVersion(Float version)
Sets the package definition version value. |
void |
validate(Validator validator)
Attempt to validate this package definition element (not sub-elements). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PACKAGE_ELEMENT
public static final String ASSETS_ELEMENT
public static final String ATTACHMENTS_ELEMENT
public static final String ATTACHMENT_ELEMENT
public static final String CONTROLLERS_ELEMENT
public static final String DELAY_ELEMENT
public static final String DATA_ELEMENT
public static final String RESOURCES_ELEMENT
public static final String RESOURCE_ELEMENT
public static final String CONTENTTYPE_ATTR
public static final String TYPE_ATTR
public static final String NAME_ATTR
public static final String SCALINGMETHOD_ATTR
public static final String SOURCE_ATTR
public static final String VERSION_ATTR
public static final String ALTTEXT_ATTR
public static final String TARGETURL_ATTR
public static final String EXPIRATION_ATTR
public static final String WIDTH_ATTR
public static final String HEIGHT_ATTR
public static final String ID_ATTR
public static final String DESCRIPTION_ATTR
public static final String CONTROLLER_ATTR
public static final String NAV_PACKAGE_TYPE
public static final String XFA_PACKAGE_TYPE
public static final String LOCALE_ATTR
public static final String DEFAULT_LOCALE
public static final String CONTROLLER_NS
public static final String PACKAGE_NS
public static final Float PACKAGE_VERSION_1_0
public static final Float PACKAGE_VERSION_2_0
public static final Float PACKAGE_VERSION_CURRENT
public static final String PACKAGE_FILE_NAME
public static final String INTERACTIVEDOCUMENT_DATA_ID
public static final String PRINTDOCUMENT_ID
public static final String PROMOIMAGE_ELEMENT
public static final String PROMOIMAGESLIDESHOW_ELEMENT
public static final String XMLDATALOADER_ELEMENT
public static final String ATTACHMENTLOADER_ELEMENT
public static final String PROMOSWFLOADER_ELEMENT
public static final String PROMOMODULELOADER_ELEMENT
Constructor Detail |
---|
public PackageDefinition()
ParserConfigurationException
IOException
SAXException
public PackageDefinition(InputStream stream) throws InvalidPackageException, IOException
stream
- The package definition file.
SAXException
IOException
ParserConfigurationException
InvalidPackageException
public PackageDefinition(Document doc) throws InvalidPackageException, IOException
doc
- The parsed package document
InvalidPackageException
IOException
Method Detail |
---|
public void setPackageSource(String val)
val
- The package definition source value.public void setPackageLocale(String locale)
locale
- the locale value.public String getPackageSource()
public String getPackageLocale()
public Float getPackageVersion()
public void setPackageVersion(Float version)
version
- A Float representing the package version. Currently only '1.0' or '2.0' are recognized.
InvalidParameterException
public void validate(Validator validator)
validator
- the validatorpublic void setPackageType(PackageDefinition.PackageType type)
type
- One of the supported enumerated typespublic PackageDefinition.PackageType getPackageType()
public List getResources()
public List getControllers()
public Controller getController(String controllerID)
controllerID
- The controller id value to look for
public List getAttachments()
public List getControllersNS(String namespaceURI, String tagName)
namespaceURI
- The namespace of the controllers to be returnedtagName
- The tag name of the controller object. Passing "*" will return all controllers
under the given namespace.
public List getPromoImages()
public List getPromoImageSlideShows()
public List getXMLDataLoaders()
public List getAttachmentLoaders()
public List getPromoModuleLoaders()
public List getPromoSWFLoaders()
public Controller addController(String namespaceURI, String tagName, String id)
namespaceURI
- The namespace for the new controllertagName
- The controller nameid
- The controller id
public PromoImageController addPromoImage(String id)
id
- The id value of the controller
public PromoImageSlideShowController addPromoImageSlideShow(String id)
id
- The id value of the controller
public PromoSWFLoaderController addPromoSWFLoader(String id)
id
- The id value of the controller
public PromoModuleLoaderController addPromoModuleLoader(String id)
id
- The id value of the controller
public AssetLoaderController addXMLDataLoader(String id)
id
- The id value of the controller
public AssetLoaderController addAttachmentLoader(String id)
id
- The id value of the controller
public Resource addResource(String controllerID)
controllerID
- The id of the controller for which this resource is associated with.
public Attachment addAttachment(String controllerID, String name)
name
- The name of the new attachmentcontrollerID
- The id of the controller for which this attachment is associated with.
public AssetLoaderController getDocumentDataLoader()
null
if none.public AssetLoaderController getPrintDocumentLoader()
null
if none.public void removeController(String controllerID)
controllerID
- The id of the controller to be removedpublic void removeAttachments(String controllerID)
controllerID
- The id of the controller associated with the attachments being removed.public void removeResources(String controllerID)
controllerID
- The id of the controller associated with the resources being removedpublic String saveXML() throws TransformerException
TransformerException
public byte[] serialize() throws TransformerException
TransformerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |