Skip navigation links


com.fatwire.assetapi.def
Interface AssetTypeDefManager

All Known Implementing Classes:
AssetTypeDefManagerImpl

public interface AssetTypeDefManager

This interface provides management services for Asset type definitions.

Note: Only read operations are implemented as of now. Attempt to perform a write operation results in UnsupportedOperationException.

One can look up an asset type's definition using AssetTypeDefManager.findByName(String,String). In addition, this interface provides access names of all asset types AssetTypeDefManager.getAssetTypes() and subtypes AssetTypeDefManager.getSubTypes(String).


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 multiValued, java.util.List<java.lang.String> subtypes)
          Add a named association to an asset type
 void create(AssetTypeDef def)
          This could only be used to create a flex definition.
 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)
          NOTE: This method is not implemented yet.
 AssetTypeDef findByName(java.lang.String assetTypeName, java.lang.String subtype)
          Finds an asset type definition by its name The method expects a valid asset type to be passed in.
 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()
          NOTE: This method is not implemented yet.
 AssetAssociationDef newAssociationDef()
          NOTE: This method is not implemented yet.
 AttributeDef newAttributeDef()
          NOTE: This method is not implemented yet.

 

Method Detail

findByName

AssetTypeDef findByName(java.lang.String assetTypeName,
                        java.lang.String subtype)
                        throws AssetAccessException
Finds an asset type definition by its name The method expects a valid asset type to be passed in. If the asset type does not exist in the system, an AssetAccessException would be thrown. Subtye is optional and only is effective if the asset type is flex asset type. When the asset type is flex asset type and null is passed in for subtype, only the basic standard attributes would be returned in AssetTypeDef. If the asset type is flex asset type and an invalid subtype is passed in, an AssetAccessException would be thrown.
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 - is thrown if no asset type/subtype exist with given names. AssetAccessException also wraps any internal exceptions generated by the framework.

getAssetTypes

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

getSubTypes

java.util.List<java.lang.String> getSubTypes(java.lang.String assetType)
                                             throws AssetAccessException
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.
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

void create(AssetTypeDef def)
            throws AssetAccessException
This could only be used to create a flex definition. Neither asset maker asset type nor Flex asset family could be created this way Creates an assetTypeDef in the database
Parameters:
def - Asset definition to create
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

delete

void delete(java.util.List<java.lang.String> assetTypeNames)
            throws AssetAccessException
NOTE: This method is not implemented yet. Deletes asset types from the database and all their instances.
Parameters:
assetTypeNames - name of the asset types to be deleted.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

newAttributeDef

AttributeDef newAttributeDef()
NOTE: This method is not implemented yet. Creates a new instance of AttributeTypeDefinition
Returns:
new (blank) AttributeTypeDef

newAssetTypeDef

AssetTypeDef newAssetTypeDef()
NOTE: This method is not implemented yet. Create an empty AssetTypeDef
Returns:
empty asset type definition.

newAssociationDef

AssetAssociationDef newAssociationDef()
NOTE: This method is not implemented yet. Creates a new instance of Association by a given name.
Returns:
AssetAssociationDef

createAssetMakerAssetType

boolean createAssetMakerAssetType(java.lang.String assetTypeName,
                                  java.lang.String descriptorFileName,
                                  java.lang.String descriptorXML,
                                  boolean addGeneralCategory,
                                  boolean enableAssetTypeIndex)
                                  throws AssetAccessException
Creates a Content Server Asset Maker asset type using the passed in descriptor
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

boolean createFlexFamily(FlexAssetFamilyInfo flexAssetFamilyInfo)
                         throws AssetAccessException
Creating a flex asset family in Content Server
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

boolean addAssociation(java.lang.String assettype,
                       java.lang.String name,
                       java.lang.String description,
                       java.lang.String childtype,
                       java.lang.String depType,
                       boolean multiValued,
                       java.util.List<java.lang.String> subtypes)
                       throws AssetAccessException
Add a named association to an asset type
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.