Class DefaultCockpitCelumDelegate
- java.lang.Object
-
- de.hybris.platform.cockpit.services.celum.impl.DefaultCockpitCelumDelegate
-
- All Implemented Interfaces:
CockpitCelumDelegate
public class DefaultCockpitCelumDelegate extends java.lang.Object implements CockpitCelumDelegate
-
-
Constructor Summary
Constructors Constructor Description DefaultCockpitCelumDelegate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateSynchPopup(org.zkoss.zk.ui.Component button, TypedObject celumAsset, EditorListener listener)Creates a Celum Asset Synchronization popup dialog to be used in a Cockpit.java.lang.IntegergetCelumAssetId(ItemModel asset)java.lang.StringgetCelumLink(ItemModel item, java.lang.String celumAssetId, java.util.Map<java.lang.String,java.lang.String> params)Returns a link to be used when opening Celum Imagine from within a Cockpit application.java.lang.StringgetCelumLink(java.lang.String celumAssetId, java.util.Map<java.lang.String,java.lang.String> params)Returns a link to be used when opening Celum Imagine from within a Cockpit application.protected CockpitCelumServicegetCockpitCelumService()java.lang.StringgetLocalMediaUrl(TypedObject celumAsset)Returns the URL of the local version of the Celum asset.java.lang.StringgetMediaUrl(TypedObject celumAsset)Returns the URL of the current Celum version of the Celum asset.java.lang.StringgetOriginalMediaFormat()Gets the original media format.booleanisCelumAssetValid(TypedObject celumAsset)Checks if is celum asset valid.booleanisCelumAvailable()Returns whether Celum is available and ready to be used.booleanisSynchronized(TypedObject celumAsset)Checks if is synchronized.voidsynchronize(TypedObject celumAsset)Synchronize celum asset with current image in celum.voidunSynchronize(TypedObject celumAsset)Un synchronize.
-
-
-
Method Detail
-
isCelumAvailable
public boolean isCelumAvailable()
Description copied from interface:CockpitCelumDelegateReturns whether Celum is available and ready to be used.- Specified by:
isCelumAvailablein interfaceCockpitCelumDelegate- Returns:
trueif Celum is available,falseotherwise
-
getCelumLink
public java.lang.String getCelumLink(ItemModel item, java.lang.String celumAssetId, java.util.Map<java.lang.String,java.lang.String> params) throws CelumNotAvailableException
Description copied from interface:CockpitCelumDelegateReturns a link to be used when opening Celum Imagine from within a Cockpit application. Note: Make sure to callCockpitCelumDelegate.isCelumAvailable()before calling this method.- Specified by:
getCelumLinkin interfaceCockpitCelumDelegate- Parameters:
item- default search parameters for this item type will be included in returned link (leavenullif no search parameters should be included)celumAssetId- celum asset ID (leavenullif no ID is available)params- custom parameters, some of which are echoed back to the Cockpit- Returns:
- the link to be used for opening Celum Imagine
- Throws:
CelumNotAvailableException- if MAM/Celum is not available
-
getCelumLink
public java.lang.String getCelumLink(java.lang.String celumAssetId, java.util.Map<java.lang.String,java.lang.String> params) throws CelumNotAvailableExceptionDescription copied from interface:CockpitCelumDelegateReturns a link to be used when opening Celum Imagine from within a Cockpit application. Note: Make sure to callCockpitCelumDelegate.isCelumAvailable()before calling this method.- Specified by:
getCelumLinkin interfaceCockpitCelumDelegate- Parameters:
celumAssetId- celum asset ID (leavenullif no ID is available)params- custom parameters, some of which are echoed back to the Cockpit- Returns:
- the link to be used for opening Celum Imagine
- Throws:
CelumNotAvailableException- if MAM/Celum is not available
-
getCockpitCelumService
protected CockpitCelumService getCockpitCelumService()
-
createSynchPopup
public void createSynchPopup(org.zkoss.zk.ui.Component button, TypedObject celumAsset, EditorListener listener) throws CelumNotAvailableException, java.lang.IllegalArgumentExceptionDescription copied from interface:CockpitCelumDelegateCreates a Celum Asset Synchronization popup dialog to be used in a Cockpit. Note: This method will add an event listener to the button, registered for handling ZK "onClickevents.- Specified by:
createSynchPopupin interfaceCockpitCelumDelegate- Parameters:
button- the button which should open the synchronization dialogcelumAsset- the celum assetlistener- the editor listener- Throws:
CelumNotAvailableException- if MAM/Celum is not availablejava.lang.IllegalArgumentException- ifcelumAssetisnull
-
getLocalMediaUrl
public java.lang.String getLocalMediaUrl(TypedObject celumAsset) throws CelumNotAvailableException, java.lang.IllegalArgumentException
Description copied from interface:CockpitCelumDelegateReturns the URL of the local version of the Celum asset.- Specified by:
getLocalMediaUrlin interfaceCockpitCelumDelegate- Parameters:
celumAsset- the celum asset- Returns:
- the URL of the local Celum asset version
- Throws:
CelumNotAvailableException- if MAM/Celum is not availablejava.lang.IllegalArgumentException- ifcelumAssetisnull- See Also:
CockpitCelumDelegate.getMediaUrl(TypedObject)
-
getMediaUrl
public java.lang.String getMediaUrl(TypedObject celumAsset) throws CelumNotAvailableException, java.lang.IllegalArgumentException
Description copied from interface:CockpitCelumDelegateReturns the URL of the current Celum version of the Celum asset.- Specified by:
getMediaUrlin interfaceCockpitCelumDelegate- Parameters:
celumAsset- the celum asset- Returns:
- the URL of the current Celum asset version
- Throws:
CelumNotAvailableException- if MAM/Celum is not availablejava.lang.IllegalArgumentException- ifcelumAssetisnull- See Also:
CockpitCelumDelegate.getLocalMediaUrl(TypedObject)
-
unSynchronize
public void unSynchronize(TypedObject celumAsset) throws CelumNotAvailableException, java.lang.IllegalArgumentException
Description copied from interface:CockpitCelumDelegateUn synchronize.- Specified by:
unSynchronizein interfaceCockpitCelumDelegate- Parameters:
celumAsset- the celum asset- Throws:
CelumNotAvailableException- the celum not available exceptionjava.lang.IllegalArgumentException- the illegal argument exception
-
synchronize
public void synchronize(TypedObject celumAsset) throws CelumNotAvailableException, java.lang.IllegalArgumentException
Description copied from interface:CockpitCelumDelegateSynchronize celum asset with current image in celum.- Specified by:
synchronizein interfaceCockpitCelumDelegate- Parameters:
celumAsset- the celum asset- Throws:
CelumNotAvailableException- the celum not available exceptionjava.lang.IllegalArgumentException- the illegal argument exception
-
isSynchronized
public boolean isSynchronized(TypedObject celumAsset) throws CelumNotAvailableException, java.lang.IllegalArgumentException
Description copied from interface:CockpitCelumDelegateChecks if is synchronized.- Specified by:
isSynchronizedin interfaceCockpitCelumDelegate- Parameters:
celumAsset- the celum asset- Returns:
- true, if is synchronized
- Throws:
CelumNotAvailableException- the celum not available exceptionjava.lang.IllegalArgumentException- the illegal argument exception
-
isCelumAssetValid
public boolean isCelumAssetValid(TypedObject celumAsset) throws CelumNotAvailableException
Description copied from interface:CockpitCelumDelegateChecks if is celum asset valid.- Specified by:
isCelumAssetValidin interfaceCockpitCelumDelegate- Parameters:
celumAsset- the celum asset- Returns:
- true, if is celum asset valid
- Throws:
CelumNotAvailableException- the celum not available exception
-
getOriginalMediaFormat
public java.lang.String getOriginalMediaFormat() throws CelumNotAvailableExceptionDescription copied from interface:CockpitCelumDelegateGets the original media format.- Specified by:
getOriginalMediaFormatin interfaceCockpitCelumDelegate- Returns:
- the original media format
- Throws:
CelumNotAvailableException- the celum not available exception
-
getCelumAssetId
public java.lang.Integer getCelumAssetId(ItemModel asset)
- Specified by:
getCelumAssetIdin interfaceCockpitCelumDelegate- Parameters:
asset- item model which might be celum asset- Returns:
- celum asset id if given item is existing celum asset or null.
-
-