Skip navigation links


com.fatwire.assetapi.def
Class AssetTypeDefManagerImpl

java.lang.Object
  extended by com.fatwire.assetapi.def.AssetTypeDefManagerImpl

All Implemented Interfaces:
AssetTypeDefManager

public final class AssetTypeDefManagerImpl
extends java.lang.Object
implements AssetTypeDefManager

Sample implementation for Asset type definitions.


Constructor Summary
AssetTypeDefManagerImpl(ICS ics)
           

 

Method Summary
 boolean addAssociation(java.lang.String assettype, java.lang.String name, java.lang.String description, java.lang.String childtype, java.lang.String depType, boolean multiValues, java.util.List<java.lang.String> subtypes)
          Add a named association to an asset type
 void create(AssetTypeDef def)
          Creates an assetTypeDef in the database
 boolean createAssetMakerAssetType(java.lang.String assetTypeName, java.lang.String descriptorFileName, java.lang.String descriptorXML, boolean addGeneralCategory, boolean enableAssetTypeIndex)
          Creates a Content Server Asset Maker asset type using the passed in descriptor
 boolean createFlexFamily(FlexAssetFamilyInfo flexAssetFamilyInfo)
          Creating a flex asset family in Content Server
 void delete(java.util.List<java.lang.String> assetTypeNames)
          Deletes asset types from the database and all their instances.
 AssetTypeDef findByName(java.lang.String assetTypeName, java.lang.String subtype)
          Finds an asset type definition by its name
 java.util.List<java.lang.String> getAssetTypes()
          Returns all asset type names in the system.
 java.util.List<java.lang.String> getSubTypes(java.lang.String assetType)
          Returns subtype names given the asset type name If the asset type name specified is not existed in System, the method would return an empty List and will not throw exception.
 AssetTypeDef newAssetTypeDef()
          Create an empty AssetTypeDef
 AssetAssociationDef newAssociationDef()
          Creates a new instance of Association by a given name.
 AttributeDef newAttributeDef()
          Creates a new instance of AttributeTypeDefinition

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

AssetTypeDefManagerImpl

public AssetTypeDefManagerImpl(ICS ics)

Method Detail

findByName

public AssetTypeDef findByName(java.lang.String assetTypeName,
                               java.lang.String subtype)
                        throws AssetAccessException
Finds an asset type definition by its name
Specified by:
findByName in interface AssetTypeDefManager
Parameters:
assetTypeName - name of the asset type definition.
subtype - Subtype of asset definition, if any.
Returns:
AssetTypeDef if the asset type by that name can be found.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

getAssetTypes

public java.util.List<java.lang.String> getAssetTypes()
                                               throws AssetAccessException
Description copied from interface: AssetTypeDefManager
Returns all asset type names in the system.
Specified by:
getAssetTypes in interface AssetTypeDefManager
Returns:
List of asset type names.
Throws:
AssetAccessException - wraps any internal exceptions generated by the framework.

getSubTypes

public java.util.List<java.lang.String> getSubTypes(java.lang.String assetType)
                                             throws AssetAccessException
Description copied from interface: AssetTypeDefManager
Returns subtype names given the asset type name If the asset type name specified is not existed in System, the method would return an empty List and will not throw exception.
Specified by:
getSubTypes in interface AssetTypeDefManager
Parameters:
assetType - name of the asset type to get subtypes for
Returns:
List of valid subtype names.
Throws:
AssetAccessException - wraps any internal exceptions generated by the framework.

create

public void create(AssetTypeDef def)
            throws AssetAccessException
Creates an assetTypeDef in the database
Specified by:
create in interface AssetTypeDefManager
Parameters:
def -
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

delete

public void delete(java.util.List<java.lang.String> assetTypeNames)
            throws AssetAccessException
Deletes asset types from the database and all their instances.
Specified by:
delete in interface AssetTypeDefManager
Parameters:
assetTypeNames - name of the asset types to be deleted.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

newAttributeDef

public AttributeDef newAttributeDef()
Creates a new instance of AttributeTypeDefinition
Specified by:
newAttributeDef in interface AssetTypeDefManager
Returns:
new (blank) AttributeTypeDef

newAssetTypeDef

public AssetTypeDef newAssetTypeDef()
Create an empty AssetTypeDef
Specified by:
newAssetTypeDef in interface AssetTypeDefManager
Returns:
empty asset type definition.

newAssociationDef

public AssetAssociationDef newAssociationDef()
Creates a new instance of Association by a given name.
Specified by:
newAssociationDef in interface AssetTypeDefManager
Returns:
AssetAssociationDef

createAssetMakerAssetType

public boolean createAssetMakerAssetType(java.lang.String assetTypeName,
                                         java.lang.String descriptorFileName,
                                         java.lang.String descriptorXML,
                                         boolean addGeneralCategory,
                                         boolean enableAssetTypeIndex)
                                  throws AssetAccessException
Description copied from interface: AssetTypeDefManager
Creates a Content Server Asset Maker asset type using the passed in descriptor
Specified by:
createAssetMakerAssetType in interface AssetTypeDefManager
Parameters:
assetTypeName - the asset type name, the name has to be the same with the one in desriptorXML, or an Exception will be thrown
descriptorFileName - the name of the descriptor xml, we now requires it ends with .xml or .XML
descriptorXML - the descriptor xml String
addGeneralCategory - indicating whether a General Category will be created by default; true indicates the General Category will be created, false indicates otherwise
enableAssetTypeIndex - indicating whether the asset type will be enabled for Asset Type specific indexing if available
Returns:
boolean indicates whether the creation is successful or not; true indicates the creation succeeded, false indicates it failed.
Throws:
AssetAccessException - throw Exception when errors met

createFlexFamily

public boolean createFlexFamily(FlexAssetFamilyInfo flexAssetFamilyInfo)
                         throws AssetAccessException
Description copied from interface: AssetTypeDefManager
Creating a flex asset family in Content Server
Specified by:
createFlexFamily in interface AssetTypeDefManager
Parameters:
flexAssetFamilyInfo - the name/description/plural information for the flex asset family members
Returns:
true if the family is created correctly; false indicates otherwise
Throws:
AssetAccessException - throw this exception if error met

addAssociation

public boolean addAssociation(java.lang.String assettype,
                              java.lang.String name,
                              java.lang.String description,
                              java.lang.String childtype,
                              java.lang.String depType,
                              boolean multiValues,
                              java.util.List<java.lang.String> subtypes)
                       throws AssetAccessException
Description copied from interface: AssetTypeDefManager
Add a named association to an asset type
Specified by:
addAssociation in interface AssetTypeDefManager
Parameters:
assettype - the asset type to add the assocation
name - the name of the association
description - the description of the assocation
childtype - the child asset types allowed for this association
depType - the dependency type that will be logged. Legal values are: "E" -- IApprovalDependency.DEPTYPE_EXISTS : "V" -- IApprovalDependency.DEPTYPE_EXACT Default value if the input is wrong is E
subtypes - the subtypes for the association in the format of subtype name to required map For example, FSII Product - true indicates that subtype FSII Product is needed and it is required
Returns:
true if the association is created correctly; false indicates otherwise
Throws:
AssetAccessException - throw this exception if error met

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.