com.fatwire.gst.foundation.wra
Class AssetApiWraCoreFieldDao

java.lang.Object
  extended by com.fatwire.gst.foundation.wra.AssetApiWraCoreFieldDao
All Implemented Interfaces:
WraCoreFieldDao
Direct Known Subclasses:
WraCoreFieldApiBypassDao

public class AssetApiWraCoreFieldDao
extends Object
implements WraCoreFieldDao

Dao for dealing with core fields in a WRA This DAO is not aware of Aliases. To work with Alias assets, see AliasCoreFieldDao.}

Since:
Jul 21, 2010
Author:
Tony Field

Field Summary
 
Fields inherited from interface com.fatwire.gst.foundation.wra.WraCoreFieldDao
VANITY_ATTRIBUTE_NAMES, WRA_ATTRIBUTE_NAMES
 
Constructor Summary
AssetApiWraCoreFieldDao(COM.FutureTense.Interfaces.ICS ics)
           
 
Method Summary
 long findP(AssetIdWithSite wraAssetIdWithSite)
          Locate the page that contains the specified Web-Referenceable Asset.
static AssetApiWraCoreFieldDao getInstance(COM.FutureTense.Interfaces.ICS ics)
           
 VanityAsset getVanityWra(com.fatwire.assetapi.data.AssetId id)
           
 WebReferenceableAsset getWra(com.fatwire.assetapi.data.AssetId id)
          Return a web referenceable asset bean given an input id.
 boolean isVanityAsset(com.fatwire.assetapi.data.AssetId id)
          Method to test if an asset has a vanity url, that is has a path field.
 boolean isWebReferenceable(com.fatwire.assetapi.data.AssetId id)
          Method to test whether or not an asset is web-referenceable.
 boolean isWebReferenceable(TemplateAsset candidate)
          Method to test whether or not an asset is web-referenceable.
 boolean isWebReferenceable(WebReferenceableAsset candidate)
          Method to test whether or not an asset is web-referenceable.
 String resolveSite(String c, String cid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetApiWraCoreFieldDao

public AssetApiWraCoreFieldDao(COM.FutureTense.Interfaces.ICS ics)
Method Detail

getInstance

public static final AssetApiWraCoreFieldDao getInstance(COM.FutureTense.Interfaces.ICS ics)

isWebReferenceable

public boolean isWebReferenceable(com.fatwire.assetapi.data.AssetId id)
Method to test whether or not an asset is web-referenceable.

Specified by:
isWebReferenceable in interface WraCoreFieldDao
Parameters:
id - asset ID to check
Returns:
true if the asset is a valid web-referenceable asset, false if it is not

isWebReferenceable

public boolean isWebReferenceable(TemplateAsset candidate)
Description copied from interface: WraCoreFieldDao
Method to test whether or not an asset is web-referenceable.

Specified by:
isWebReferenceable in interface WraCoreFieldDao
Parameters:
candidate - asset to check for web-referenceable support.
Returns:
true if the asset is a valid web-referenceable asset, false if it is not

isWebReferenceable

public boolean isWebReferenceable(WebReferenceableAsset candidate)
Method to test whether or not an asset is web-referenceable.

Specified by:
isWebReferenceable in interface WraCoreFieldDao
Parameters:
candidate - asset to test
Returns:
true if the asset is a valid web-referenceable asset, false if it is not

getWra

public WebReferenceableAsset getWra(com.fatwire.assetapi.data.AssetId id)
Return a web referenceable asset bean given an input id. Required fields must be set or an exception is thrown.

Specified by:
getWra in interface WraCoreFieldDao
Parameters:
id - asset id
Returns:
WebReferenceableAsset, never null
See Also:
isWebReferenceable(com.fatwire.assetapi.data.AssetId)

resolveSite

public String resolveSite(String c,
                          String cid)
Specified by:
resolveSite in interface WraCoreFieldDao
Returns:
the name of the site that this asset belongs to.

findP

public long findP(AssetIdWithSite wraAssetIdWithSite)
Locate the page that contains the specified Web-Referenceable Asset.

A WRA is supposed to just be placed on one page (in the unnamed association block), and this method locates it. If it is not found, 0L is returned.

If multiple matches are found, a warning is logged and the first one is returned.

Specified by:
findP in interface WraCoreFieldDao
Parameters:
wraAssetIdWithSite - id of the web-referenceable asset. Site is included
Returns:
page asset ID or 0L.

isVanityAsset

public boolean isVanityAsset(com.fatwire.assetapi.data.AssetId id)
Description copied from interface: WraCoreFieldDao
Method to test if an asset has a vanity url, that is has a path field.

Specified by:
isVanityAsset in interface WraCoreFieldDao
Parameters:
id - asset ID to check
Returns:
true if the asset has a vanity url, false if it is not

getVanityWra

public VanityAsset getVanityWra(com.fatwire.assetapi.data.AssetId id)
Specified by:
getVanityWra in interface WraCoreFieldDao
Returns:
the VanityAsset for the id, null is not found or not a VanityAsset


Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.