Class DefaultConfigurationPersistingStrategy<CONFIG extends UIComponentConfiguration,JAXBCLASS>
- java.lang.Object
-
- de.hybris.platform.cockpit.services.config.impl.DefaultConfigurationPersistingStrategy<CONFIG,JAXBCLASS>
-
- All Implemented Interfaces:
ConfigurationPersistingStrategy<CONFIG>
- Direct Known Subclasses:
AdvancedSearchConfigurationPersistingStrategy,DashboardPersistingStrategy,EditorConfigurationPersistingStrategy,ListViewConfigurationPersistingStrategy
public class DefaultConfigurationPersistingStrategy<CONFIG extends UIComponentConfiguration,JAXBCLASS> extends java.lang.Object implements ConfigurationPersistingStrategy<CONFIG>
-
-
Field Summary
-
Fields inherited from interface de.hybris.platform.cockpit.services.config.ConfigurationPersistingStrategy
COMPONENT_PERMISSION_CODE
-
-
Constructor Summary
Constructors Constructor Description DefaultConfigurationPersistingStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckPermissions(UserModel user)java.lang.StringcreateXml(JAXBCLASS root)CockpitUIComponentConfigurationDaogetCockpitUIComponentConfigurationDao()java.lang.Class<CONFIG>getComponentClass()Provides the class this strategy is valid for.java.lang.StringgetComponentClassName()java.lang.StringgetConfigurationFactory()protected java.lang.ObjectgetJaxbElement(CONFIG config, java.lang.Object element)MediaServicegetMediaService()ModelServicegetModelService()protected JAXBCLASSgetRootJaxbElement(CONFIG config)voidpersistComponentConfiguration(CONFIG configuration, UserModel user, ObjectTemplate objectTemplate, java.lang.String code)Stores the configuration according to the strategy implementationvoidsetCockpitUIComponentConfigurationDao(CockpitUIComponentConfigurationDao cockpitConfigurationDao)voidsetComponentClassName(java.lang.String componentClass)voidsetConfigurationFactory(java.lang.String factory)voidsetJaxbClass(java.lang.Class<JAXBCLASS> jaxbClass)voidsetJaxbContextCache(JAXBContextCache jaxbContextCache)voidsetMediaService(MediaService mediaService)voidsetModelService(ModelService modelService)voidsetSchemaResource(org.springframework.core.io.Resource schemaResource)voidsetUiAccessRightService(UIAccessRightService uiAccessRightService)protected voidstoreConfigurationMedia(PrincipalModel principal, java.lang.String xmlContent, java.lang.String code, java.lang.String objectTemplateCode, java.lang.String factoryBeanId)JAXBCLASSupdateJaxb(CONFIG configuration)Converts/updates given configuration to the corresponding JAXB class - this method must be overriden by subclass!
-
-
-
Method Detail
-
updateJaxb
public JAXBCLASS updateJaxb(CONFIG configuration)
Converts/updates given configuration to the corresponding JAXB class - this method must be overriden by subclass!- Parameters:
configuration- the java configuration- Returns:
- the corresponding JAXB class
-
persistComponentConfiguration
public void persistComponentConfiguration(CONFIG configuration, UserModel user, ObjectTemplate objectTemplate, java.lang.String code)
Description copied from interface:ConfigurationPersistingStrategyStores the configuration according to the strategy implementation- Specified by:
persistComponentConfigurationin interfaceConfigurationPersistingStrategy<CONFIG extends UIComponentConfiguration>- Parameters:
configuration- the configuration to storeuser- the user the configuration should be valid forobjectTemplate- the object template the configuration should be valid forcode- the component code of the configuration
-
checkPermissions
protected boolean checkPermissions(UserModel user)
-
storeConfigurationMedia
protected void storeConfigurationMedia(PrincipalModel principal, java.lang.String xmlContent, java.lang.String code, java.lang.String objectTemplateCode, java.lang.String factoryBeanId)
-
getComponentClass
public java.lang.Class<CONFIG> getComponentClass()
Description copied from interface:ConfigurationPersistingStrategyProvides the class this strategy is valid for. Used for mapping strategies to classes via spring.- Specified by:
getComponentClassin interfaceConfigurationPersistingStrategy<CONFIG extends UIComponentConfiguration>- Returns:
- the class of the configuration which this strategy can handle
-
createXml
public java.lang.String createXml(JAXBCLASS root)
-
setJaxbClass
public void setJaxbClass(java.lang.Class<JAXBCLASS> jaxbClass)
-
getComponentClassName
public java.lang.String getComponentClassName()
-
setComponentClassName
public void setComponentClassName(java.lang.String componentClass)
-
getConfigurationFactory
public java.lang.String getConfigurationFactory()
-
setConfigurationFactory
public void setConfigurationFactory(java.lang.String factory)
-
getJaxbElement
protected java.lang.Object getJaxbElement(CONFIG config, java.lang.Object element)
-
setSchemaResource
public void setSchemaResource(org.springframework.core.io.Resource schemaResource)
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getMediaService
public MediaService getMediaService()
-
setMediaService
public void setMediaService(MediaService mediaService)
-
setUiAccessRightService
public void setUiAccessRightService(UIAccessRightService uiAccessRightService)
-
getCockpitUIComponentConfigurationDao
public CockpitUIComponentConfigurationDao getCockpitUIComponentConfigurationDao()
-
setCockpitUIComponentConfigurationDao
public void setCockpitUIComponentConfigurationDao(CockpitUIComponentConfigurationDao cockpitConfigurationDao)
-
setJaxbContextCache
public void setJaxbContextCache(JAXBContextCache jaxbContextCache)
-
-