Class A_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- java.lang.Object
-
- org.opencms.ade.galleries.client.preview.A_CmsResourcePreview<T>
-
- Type Parameters:
T
- the resource info bean type
- All Implemented Interfaces:
I_CmsResourcePreview<T>
- Direct Known Subclasses:
CmsBinaryResourcePreview
,CmsImageResourcePreview
public abstract class A_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean> extends java.lang.Object implements I_CmsResourcePreview<T>
Preview dialog controller.This class handles the communication between preview dialog and the server.
- Since:
- 8.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected T
m_infoBean
The info bean of the binary preview dialog.
-
Constructor Summary
Constructors Modifier Constructor Description protected
A_CmsResourcePreview(CmsGalleryDialog galleryDialog)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CmsGalleryDialog
getGalleryDialog()
Gets the gallery dialog in which this preview is displayed.org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryMode
getGalleryMode()
Returns the gallery mode.abstract I_CmsPreviewHandler<T>
getHandler()
Returns the preview handler.java.lang.String
getLocale()
Returns the current locale.java.lang.String
getResourcePath()
Returns the resource path of the current resource.protected static org.opencms.ade.galleries.shared.rpc.I_CmsPreviewServiceAsync
getService()
Returns the preview service.java.lang.String
getViewLink()
Returns the site independent perma link.void
removePreview()
Removes the preview widget.void
selectResource(java.lang.String resourcePath, org.opencms.util.CmsUUID structureId, java.lang.String title)
Sets the selected resource in the opening editor for the given gallery mode.boolean
setDataInEditor()
Checks if further user input is required and other wise sets the selected resource via the provided integrator functionssetLink
andsetImage
.void
setResource()
Sets the current resource within the editor or xml-content.void
showData(T resourceInfo)
Calls the preview handler to display the given data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opencms.ade.galleries.client.preview.I_CmsResourcePreview
getPreviewDialog, getPreviewName, loadResourceInfo, openPreview, saveProperties
-
-
-
-
Field Detail
-
m_infoBean
protected T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean m_infoBean
The info bean of the binary preview dialog.
-
-
Constructor Detail
-
A_CmsResourcePreview
protected A_CmsResourcePreview(CmsGalleryDialog galleryDialog)
Constructor.- Parameters:
galleryDialog
- the gallery dialog instance
-
-
Method Detail
-
getService
protected static org.opencms.ade.galleries.shared.rpc.I_CmsPreviewServiceAsync getService()
Returns the preview service.- Returns:
- the preview service
-
getGalleryDialog
public CmsGalleryDialog getGalleryDialog()
Description copied from interface:I_CmsResourcePreview
Gets the gallery dialog in which this preview is displayed.- Specified by:
getGalleryDialog
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Returns:
- the gallery dialog
- See Also:
I_CmsResourcePreview.getGalleryDialog()
-
getGalleryMode
public org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryMode getGalleryMode()
Description copied from interface:I_CmsResourcePreview
Returns the gallery mode.- Specified by:
getGalleryMode
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Returns:
- the gallery mode
- See Also:
I_CmsResourcePreview.getGalleryMode()
-
getHandler
public abstract I_CmsPreviewHandler<T> getHandler()
Description copied from interface:I_CmsResourcePreview
Returns the preview handler.- Specified by:
getHandler
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Returns:
- the preview handler
- See Also:
I_CmsResourcePreview.getHandler()
-
getLocale
public java.lang.String getLocale()
Description copied from interface:I_CmsResourcePreview
Returns the current locale.- Specified by:
getLocale
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Returns:
- the current locale
- See Also:
I_CmsResourcePreview.getLocale()
-
getResourcePath
public java.lang.String getResourcePath()
Description copied from interface:I_CmsResourcePreview
Returns the resource path of the current resource.- Specified by:
getResourcePath
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Returns:
- the resource path
- See Also:
I_CmsResourcePreview.getResourcePath()
-
getViewLink
public java.lang.String getViewLink()
Description copied from interface:I_CmsResourcePreview
Returns the site independent perma link.- Specified by:
getViewLink
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Returns:
- the site independent link
- See Also:
I_CmsResourcePreview.getViewLink()
-
removePreview
public void removePreview()
Description copied from interface:I_CmsResourcePreview
Removes the preview widget.- Specified by:
removePreview
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- See Also:
I_CmsPreviewController.removePreview()
-
selectResource
public void selectResource(java.lang.String resourcePath, org.opencms.util.CmsUUID structureId, java.lang.String title)
Description copied from interface:I_CmsResourcePreview
Sets the selected resource in the opening editor for the given gallery mode.- Specified by:
selectResource
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Parameters:
resourcePath
- the resource pathstructureId
- the structure idtitle
- the resource title- See Also:
I_CmsResourcePreview.selectResource(java.lang.String, org.opencms.util.CmsUUID, java.lang.String)
-
setDataInEditor
public boolean setDataInEditor()
Description copied from interface:I_CmsResourcePreview
Checks if further user input is required and other wise sets the selected resource via the provided integrator functionssetLink
andsetImage
.Returning
true
when all data has been. If there are any changes, the user will be requested to save those and the editor OK function will be called again.- Specified by:
setDataInEditor
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Returns:
true
when all data has been set,false
if there were any changes that need saving- See Also:
I_CmsResourcePreview.setDataInEditor()
-
setResource
public void setResource()
Sets the current resource within the editor or xml-content.- Specified by:
setResource
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
-
showData
public void showData(T resourceInfo)
Calls the preview handler to display the given data.- Specified by:
showData
in interfaceI_CmsResourcePreview<T extends org.opencms.ade.galleries.shared.CmsResourceInfoBean>
- Parameters:
resourceInfo
- the resource info data
-
-