Class XMLWidgetPersistenceService

    • Field Detail

      • IMPORT_ROOT_FILE

        @Deprecated(since="1808",
                    forRemoval=true)
        protected static final java.io.File IMPORT_ROOT_FILE
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 1808
        This field should become private. Access to the import root file should happen via dedicated method.
        See Also:
        DefaultConfigurationImportSupport.setImportRootFile(String)
      • DEFAULT_FILE_NAME_WIDGETS_XML

        protected static final java.lang.String DEFAULT_FILE_NAME_WIDGETS_XML
        See Also:
        Constant Field Values
    • Constructor Detail

      • XMLWidgetPersistenceService

        public XMLWidgetPersistenceService()
        Constructs the service with default implementations of the jaxb lookup and converter.
        See Also:
        XMLWidgetPersistenceJAXBLookupHandler, XMLWidgetPersistenceJAXBConverter
    • Method Detail

      • loadWidgetTree

        public Widget loadWidgetTree​(java.lang.String widgetId)
        Description copied from interface: WidgetPersistenceService
        Loads widget's tree. Widget can consist any number of children which can form a tree.
        Specified by:
        loadWidgetTree in interface WidgetPersistenceService
        Parameters:
        widgetId - an id of widget's tree root
        Returns:
        a widget tree
      • loadWidgetTree

        public Widget loadWidgetTree​(java.lang.String widgetId,
                                     java.io.InputStream inputStream)
        Loads widget's tree. Widget can consist of any number of children which can form a tree.
        Parameters:
        widgetId - an id of widget's tree root
        inputStream - from tree is loaded
        Returns:
        a widget tree
      • applyImports

        @Deprecated(since="6.5",
                    forRemoval=true)
        protected void applyImports​(Widgets widgets,
                                    java.util.Set<java.lang.String> alreadyImportedResources)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.5
        See Also:
        applyImports(File, Widgets, Set)
      • applyImports

        protected void applyImports​(Widgets widgets)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • applyImports

        @Deprecated(since="2005",
                    forRemoval=true)
        protected boolean applyImports​(java.io.File currentPath,
                                       Widgets widgets,
                                       java.util.Set<java.lang.String> importedResources)
                                throws java.io.IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
        Throws:
        java.io.IOException
      • checkRequirements

        @Deprecated(since="2005",
                    forRemoval=true)
        protected boolean checkRequirements​(java.io.File currentPath,
                                            Widgets widgets,
                                            java.util.Set<java.lang.String> importedResources)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
      • loadImports

        @Deprecated(since="2005",
                    forRemoval=true)
        protected void loadImports​(java.io.File currentPath,
                                   Widgets widgets,
                                   java.util.Set<java.lang.String> importedResources)
                            throws java.io.IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
        Throws:
        java.io.IOException
      • applyImport

        @Deprecated(since="2005",
                    forRemoval=true)
        protected void applyImport​(java.io.File currentPath,
                                   Widgets widgets,
                                   java.util.Set<java.lang.String> importedResources,
                                   Import resourceImport)
                            throws java.io.IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
        Throws:
        java.io.IOException
      • setContextId

        protected void setContextId​(Widgets importedWidgets,
                                    java.lang.String contextId)
      • resolveResource

        @Deprecated(since="2005",
                    forRemoval=true)
        protected java.io.InputStream resolveResource​(java.lang.String resourcePath,
                                                      java.util.Map<java.lang.String,​java.lang.Object> resourceParameters)
                                               throws java.io.IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
        Throws:
        java.io.IOException
      • resolveResourcePath

        protected java.lang.String resolveResourcePath​(java.io.File resource)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getImportRootFile

        @Deprecated(since="2005",
                    forRemoval=true)
        protected java.io.File getImportRootFile()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
      • loadImports

        @Deprecated(since="6.5",
                    forRemoval=true)
        protected void loadImports​(Widgets widgets,
                                   java.util.Set<java.lang.String> alreadyImportedResources)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.5
        See Also:
        loadImports(File, Widgets, Set)
      • getUndefinedParameters

        protected java.util.Set<java.lang.String> getUndefinedParameters​(Widgets widgets,
                                                                         java.util.Set<java.lang.String> definedValues)
      • mergeWidgets

        @Deprecated(since="6.5",
                    forRemoval=true)
        protected void mergeWidgets​(Widgets widgets,
                                    Widgets toAdd)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.5
        See Also:
        mergeWidgets(Widgets, Widgets, Import)
      • applyExtensions

        protected void applyExtensions​(Widgets widgets)
      • extractWidgetExtensions

        protected java.util.List<WidgetExtension> extractWidgetExtensions​(Widgets widgets)
      • extractWidgetConnections

        protected java.util.List<WidgetConnection> extractWidgetConnections​(Widgets widgets)
      • applyExtension

        protected java.util.Set<java.lang.String> applyExtension​(Widgets widgets,
                                                                 Widget widget,
                                                                 WidgetExtension extension,
                                                                 java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> addedWidgets)
      • applyExtensionVirtualSockets

        protected void applyExtensionVirtualSockets​(Widget widget,
                                                    WidgetExtension extension)
      • applyExtensionRemove

        protected void applyExtensionRemove​(Widget widget,
                                            WidgetExtension extension,
                                            java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> addedWidgets)
      • removeWidgets

        protected void removeWidgets​(Widget widget,
                                     java.util.Set<java.lang.String> removeWidgetIds)
      • applyExtensionAdd

        protected java.util.Set<java.lang.String> applyExtensionAdd​(Widget widget,
                                                                    WidgetExtension extension)
      • getWidgetsInSlot

        @Deprecated(since="6.7",
                    forRemoval=true)
        protected java.util.List<Widget> getWidgetsInSlot​(Widget widget,
                                                          java.lang.String slotId)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.7
        See Also:
        XMLWidgetPersistenceJAXBLookupHandler.findWidgetsInSlot(com.hybris.cockpitng.core.persistence.impl.jaxb.Widget, java.lang.String)
      • isChildWidget

        @Deprecated(since="6.7",
                    forRemoval=true)
        protected boolean isChildWidget​(Widget parent,
                                        Widget prospectiveChild)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.7
        See Also:
        XMLWidgetPersistenceJAXBLookupHandler.isChildWidget(com.hybris.cockpitng.core.persistence.impl.jaxb.Widget, com.hybris.cockpitng.core.persistence.impl.jaxb.Widget)
      • getWidgetById

        @Deprecated(since="6.7",
                    forRemoval=true)
        protected Widget getWidgetById​(Widgets widgets,
                                       java.lang.String widgetId)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.7, this method will be removed
        See Also:
        XMLWidgetPersistenceJAXBLookupHandler.findWidgetById(com.hybris.cockpitng.core.persistence.impl.jaxb.Widgets, java.lang.String)
      • storeWidgetTree

        public void storeWidgetTree​(Widget widget,
                                    java.io.File widgetsFile)
                             throws java.io.FileNotFoundException
        Stores widget's tree in file
        Parameters:
        widget - tree to store
        widgetsFile - file where to store
        Throws:
        java.io.FileNotFoundException - thrown if specified widgets file cannot be found
      • storeWidgetTree

        public void storeWidgetTree​(Widget widget,
                                    Widgets widgets,
                                    java.io.OutputStream outputStream)
        Stores widget's tree in file
        Parameters:
        widget - tree to store
        widgets - schema
        outputStream - stream where to store
      • getWidgetTreeAsString

        public java.lang.String getWidgetTreeAsString​(Widget widget,
                                                      Widgets widgets)
        Gets widget tree as String
        Parameters:
        widget - tree to store
        widgets - schema
        Returns:
        tree
      • deleteWidgetTree

        public void deleteWidgetTree​(Widget node,
                                     java.io.File file)
                              throws java.io.FileNotFoundException
        Deletes widget's tree.
        Parameters:
        node - root node of the widget's tree
        file - where tree is stored
        Throws:
        java.io.FileNotFoundException - thrown if specified widgets file cannot be found
      • deleteWidgetTreeRecursive

        protected void deleteWidgetTreeRecursive​(Widgets widgets,
                                                 Widget node)
      • deleteConnections

        protected void deleteConnections​(Widgets widgets,
                                         Widget widget)
      • isStubWidget

        @Deprecated(since="6.7",
                    forRemoval=true)
        protected boolean isStubWidget​(java.lang.String widgetId)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.7
        See Also:
        XMLWidgetPersistenceJAXBConverter.isStubWidget(java.lang.String, com.hybris.cockpitng.core.CockpitComponentDefinitionService)
      • deleteOrphanedConnections

        @Deprecated(since="6.7",
                    forRemoval=true)
        protected void deleteOrphanedConnections​(Widgets widgets)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.7
        See Also:
        XMLWidgetPersistenceJAXBConverter.removeOrphanedConnectionsFromJAXB(com.hybris.cockpitng.core.persistence.impl.jaxb.Widgets, com.hybris.cockpitng.core.CockpitComponentDefinitionService)
      • getWidgetsFile

        protected java.io.File getWidgetsFile()
      • getWidgetsFileAsStream

        protected java.io.InputStream getWidgetsFileAsStream()
                                                      throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • hasDefaultConfig

        protected boolean hasDefaultConfig()
      • loadWidgets

        protected Widgets loadWidgets​(java.io.InputStream inputStream)
      • loadWidgetsInternal

        protected final Widgets loadWidgetsInternal​(java.io.InputStream inputStream)
      • storeWidgets

        protected void storeWidgets​(Widgets widgets,
                                    java.io.OutputStream outputStream)
      • setMarshaller

        public void setMarshaller​(org.springframework.oxm.Marshaller marshaller)
      • setUnmarshaller

        public void setUnmarshaller​(org.springframework.oxm.Unmarshaller unmarshaller)
      • setWidgetService

        public void setWidgetService​(WidgetService widgetService)
      • getDefaultWidgetConfig

        protected java.lang.String getDefaultWidgetConfig()
      • setDefaultWidgetConfig

        public void setDefaultWidgetConfig​(java.lang.String defaultWidgetConfig)
      • setWidgetLibUtils

        public void setWidgetLibUtils​(WidgetLibUtils widgetLibUtils)
      • setStoreAsExtension

        public void setStoreAsExtension​(boolean storeAsExtension)
      • getAccessRestrictions

        @Deprecated(since="6.7",
                    forRemoval=true)
        protected java.util.List<java.lang.String> getAccessRestrictions​(java.lang.String access)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.7
        See Also:
        XMLWidgetPersistenceJAXBConverter.extractAccessRestrictions(java.lang.String)
      • setCockpitProperties

        @Autowired(required=false)
        public void setCockpitProperties​(CockpitProperties cockpitProperties)
      • getTemplateEngine

        @Deprecated(since="2005",
                    forRemoval=true)
        public TemplateEngine getTemplateEngine()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
        See Also:
        getImportSupport()
      • setTemplateEngine

        @Deprecated(since="2005",
                    forRemoval=true)
        public void setTemplateEngine​(TemplateEngine templateEngine)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005
        See Also:
        getImportSupport()
      • requestReadLock

        protected void requestReadLock()
      • releaseReadLock

        protected void releaseReadLock()
      • requestWriteLock

        protected void requestWriteLock()
      • releaseWriteLock

        protected void releaseWriteLock()