Package de.xima.fc.gui.bean.templates
Class TemplatesBean
- java.lang.Object
-
- de.xima.fc.gui.common.utils.msg.I18nUtils
-
- de.xima.fc.gui.common.utils.msg.MessageUtils
-
- de.xima.fc.gui.common.utils.msg.AMessaging
-
- de.xima.fc.gui.bean.templates.TemplatesBean
-
- All Implemented Interfaces:
IAssetImportConflictHandler,IDataContainer,Serializable
@Named @ViewScoped public class TemplatesBean extends AMessaging implements IDataContainer, IAssetImportConflictHandler
Bean für die aktuelle Session und deren Informationen- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTemplatesBean.EntityListModelImplstatic classTemplatesBean.TemplateBulkDeleteModelModel that holds the data for the bulk delete confirmation dialog, when the user selects multiple templates and wants to delete or reset them.
-
Field Summary
Fields Modifier and Type Field Description static StringPARAM_TEMPLATE_TYPE
-
Constructor Summary
Constructors Constructor Description TemplatesBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidapplyAssetImportConflicts()Imports all conflicting uploads according to their chosen resolution.List<Textbaustein>getAllByType(ETextbausteinKategorie kat)AssetImportConflictsgetAssetImportConflicts()Uploaded template exports that have the same UUID as an existing template, to be resolved by the user.IAssetManagementServicegetAssetManagementService()TemplatesBean.TemplateBulkDeleteModelgetBulkDeleteModel()Gets the model for the bulk delete confirmation dialog, when the user selects multiple templates and wants to delete or reset them.ETextbausteinKategoriegetCurrentTyp()LocaleBeangetLocaleBean()IEntityListModelSelectByView<Textbaustein>getModel()FormThemeReferencegetPreviewFormTheme()Only for HTML text templates: sets the form theme to use for previewing the selected text template.List<javax.faces.model.SelectItem>getPreviewFormThemeOptions()Only for HTML text templates: gets the options that can be selected in the form theme dropdown for previewing the selected text template, seeSessionBeangetSessionBean()Deprecated.StringgetTemplateBodyStyleClass()TemplateKeywordsBeangetTemplateKeywordsBean()TemplatesSheetBeangetTemplatesSheetBean()StringgetTextRteContentsCss()Creates the CSS URLs for CKEditor's contentsCss option, i.e. the CSS stylesheets that should be included inside the editor's editing area (which is an encapsulated iframe).SessionUserManagergetUserManager()ViewContextBeangetViewContext()ViewEventBusBeangetViewEventBusBean()booleanhasAvailableExportFunctionality()voidonAssetImportConflictDialogClose()Called when the conflict dialog was closed.voidonBulkDeleteConfirmed()When the confirmation button to delete or reset all selected templates was clicked, see alsoonBulkDeleteRequested().voidonBulkDeleteRequested()When the button to delete or reset all selected templates was clicked.voidreset()Resets the currently selected template to its default value.voidresetSingle()(I18N variables only) Resets the selected grid cells to their default value.voidsetAssetManagementService(IAssetManagementService assetManagementService)voidsetBulkDeleteModel(TemplatesBean.TemplateBulkDeleteModel bulkDeleteModel)Gets the model for the bulk delete confirmation dialog, when the user selects multiple templates and wants to delete or reset them.voidsetCurrentTyp(ETextbausteinKategorie currentTyp)voidsetLocaleBean(LocaleBean localeBean)voidsetModel(IEntityListModelSelectByView<Textbaustein> model)voidsetPreviewFormTheme(FormThemeReference previewFormTheme)Only for HTML text templates: sets the form theme to use for previewing the selected text template.voidsetPreviewFormThemeOptions(List<javax.faces.model.SelectItem> previewFormThemeOptions)Only for HTML text templates: gets the options that can be selected in the form theme dropdown for previewing the selected text template, seevoidsetSessionBean(SessionBean sessionBean)Deprecated.voidsetTemplateKeywordsBean(TemplateKeywordsBean templateKeywordsBean)voidsetTemplatesSheetBean(TemplatesSheetBean templatesSheetBean)voidsetUserManager(SessionUserManager userManager)voidsetViewContext(ViewContextBean viewContext)voidsetViewEventBusBean(ViewEventBusBean viewEventBusBean)voidupdateData()Should update data when calledvoidupdateModel()voiduploadAndPersist(org.primefaces.event.FileUploadEvent event)Uploads a template export and imports it as a new template if possible.-
Methods inherited from class de.xima.fc.gui.common.utils.msg.MessageUtils
addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsgFromString, addErrorMsgFromString, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsgFromString, addInfoMsgFromString, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addMsg, addMsg, addMsg, addMsg, addMsgs, addMsgs, addMsgToComponent, addMsgToComponent, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsgFromString, addWarnMsgFromString, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, cleanErrorMsg, errorMsg, errorMsg, getErrorMessage, getNewErrorMsg, getNewErrorMsg, getNewErrorMsg, getNewInfoMsg, getNewInfoMsg, getNewMsg, getNewWarnMsg, getNewWarnMsg, msg
-
Methods inherited from class de.xima.fc.gui.common.utils.msg.I18nUtils
getFacesContext, getLocale, rbValue, rbValue, rbValue, rbValueOrDefault, rbValueOrDefault
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.gui.bean.resource.model.IAssetImportConflictHandler
resolveAllAssetImportConflicts, showAssetImportConflicts
-
-
-
-
Field Detail
-
PARAM_TEMPLATE_TYPE
public static final String PARAM_TEMPLATE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasAvailableExportFunctionality
public boolean hasAvailableExportFunctionality()
-
onBulkDeleteRequested
public void onBulkDeleteRequested()
When the button to delete or reset all selected templates was clicked. Checks which templates must be deleted and which must be reset, and opens the confirmation dialog.System templates must be reset, all other templates created by the user must be deleted.
-
onBulkDeleteConfirmed
public void onBulkDeleteConfirmed()
When the confirmation button to delete or reset all selected templates was clicked, see alsoonBulkDeleteRequested(). Resets all selected system templates, and deletes all selected user templates.
-
uploadAndPersist
public void uploadAndPersist(org.primefaces.event.FileUploadEvent event)
Uploads a template export and imports it as a new template if possible. If the export has the same UUID as an existing template, the upload is remembered as a conflict that the user resolves once all uploads have completed, seeIAssetImportConflictHandler.showAssetImportConflicts().- Parameters:
event-FileUploadEventcontaining the new template
-
applyAssetImportConflicts
public void applyAssetImportConflicts()
Description copied from interface:IAssetImportConflictHandlerImports all conflicting uploads according to their chosen resolution.- Specified by:
applyAssetImportConflictsin interfaceIAssetImportConflictHandler
-
onAssetImportConflictDialogClose
public void onAssetImportConflictDialogClose()
Description copied from interface:IAssetImportConflictHandlerCalled when the conflict dialog was closed. Skips all conflicts that were not resolved yet.- Specified by:
onAssetImportConflictDialogClosein interfaceIAssetImportConflictHandler
-
getTextRteContentsCss
public String getTextRteContentsCss()
Creates the CSS URLs for CKEditor's contentsCss option, i.e. the CSS stylesheets that should be included inside the editor's editing area (which is an encapsulated iframe).- Returns:
- The CSS URLs for CKEditor's contentsCss option.
-
getTemplateBodyStyleClass
public String getTemplateBodyStyleClass()
-
updateData
public void updateData()
Description copied from interface:IDataContainerShould update data when called- Specified by:
updateDatain interfaceIDataContainer
-
updateModel
public void updateModel()
-
getModel
public IEntityListModelSelectByView<Textbaustein> getModel()
- Returns:
- the model
-
reset
public void reset()
Resets the currently selected template to its default value. This is only possible for system templates. For non-system templates, this method should never be called, but if it is: does nothing. The default value is the value provided by the formcycle app.
-
resetSingle
public void resetSingle()
(I18N variables only) Resets the selected grid cells to their default value. The default value is the value provided by the formcycle app.
-
getAllByType
public List<Textbaustein> getAllByType(ETextbausteinKategorie kat)
-
getSessionBean
@Deprecated public SessionBean getSessionBean()
Deprecated.
-
setSessionBean
@Deprecated public void setSessionBean(SessionBean sessionBean)
Deprecated.
-
getCurrentTyp
public ETextbausteinKategorie getCurrentTyp()
-
getLocaleBean
public LocaleBean getLocaleBean()
-
getUserManager
public SessionUserManager getUserManager()
-
getAssetManagementService
public IAssetManagementService getAssetManagementService()
-
getPreviewFormTheme
public FormThemeReference getPreviewFormTheme()
Only for HTML text templates: sets the form theme to use for previewing the selected text template.
-
getPreviewFormThemeOptions
public List<javax.faces.model.SelectItem> getPreviewFormThemeOptions()
Only for HTML text templates: gets the options that can be selected in the form theme dropdown for previewing the selected text template, see
-
getViewContext
public ViewContextBean getViewContext()
-
getTemplateKeywordsBean
public TemplateKeywordsBean getTemplateKeywordsBean()
-
getViewEventBusBean
public ViewEventBusBean getViewEventBusBean()
-
getBulkDeleteModel
public TemplatesBean.TemplateBulkDeleteModel getBulkDeleteModel()
Gets the model for the bulk delete confirmation dialog, when the user selects multiple templates and wants to delete or reset them.
-
getAssetImportConflicts
public AssetImportConflicts getAssetImportConflicts()
Uploaded template exports that have the same UUID as an existing template, to be resolved by the user.- Specified by:
getAssetImportConflictsin interfaceIAssetImportConflictHandler- Returns:
- The uploaded asset exports that conflict with an existing asset.
-
setCurrentTyp
public void setCurrentTyp(ETextbausteinKategorie currentTyp)
-
setLocaleBean
public void setLocaleBean(LocaleBean localeBean)
-
setUserManager
public void setUserManager(SessionUserManager userManager)
-
setAssetManagementService
public void setAssetManagementService(IAssetManagementService assetManagementService)
-
setModel
public void setModel(IEntityListModelSelectByView<Textbaustein> model)
-
setPreviewFormTheme
public void setPreviewFormTheme(FormThemeReference previewFormTheme)
Only for HTML text templates: sets the form theme to use for previewing the selected text template.
-
setPreviewFormThemeOptions
public void setPreviewFormThemeOptions(List<javax.faces.model.SelectItem> previewFormThemeOptions)
Only for HTML text templates: gets the options that can be selected in the form theme dropdown for previewing the selected text template, see
-
setViewContext
public void setViewContext(ViewContextBean viewContext)
-
setTemplatesSheetBean
public void setTemplatesSheetBean(TemplatesSheetBean templatesSheetBean)
-
setTemplateKeywordsBean
public void setTemplateKeywordsBean(TemplateKeywordsBean templateKeywordsBean)
-
setViewEventBusBean
public void setViewEventBusBean(ViewEventBusBean viewEventBusBean)
-
setBulkDeleteModel
public void setBulkDeleteModel(TemplatesBean.TemplateBulkDeleteModel bulkDeleteModel)
Gets the model for the bulk delete confirmation dialog, when the user selects multiple templates and wants to delete or reset them.
-
getTemplatesSheetBean
public TemplatesSheetBean getTemplatesSheetBean()
-
-