Class ComponentInstManager


  • @Service
    @Singleton
    public class ComponentInstManager
    extends Object
    • Constructor Detail

      • ComponentInstManager

        protected ComponentInstManager()
    • Method Detail

      • copy

        public ComponentInst copy​(ComponentInst componentInstToCopy)
        Return a copy of the given component instance. The local identifier is also copied.
        Parameters:
        componentInstToCopy - the component instance to copy.
        Returns:
        a copy of the component instance.
      • createComponentInst

        public void createComponentInst​(ComponentInst componentInst,
                                        int spaceLocalId)
                                 throws AdminException
        Creates a component instance in database
        Parameters:
        componentInst - the component instance to save in database.
        spaceLocalId - the local identifier of the space in which the component instance has been spawned.
        Throws:
        AdminException - if an error occurs.
      • restoreComponentFromBasket

        public void restoreComponentFromBasket​(int localComponentId)
                                        throws AdminException
        Throws:
        AdminException
      • getComponentInst

        public ComponentInst getComponentInst​(int componentId)
                                       throws AdminException
        Get component instance with the given id.
        Parameters:
        componentId - the unique component instance id.
        Returns:
        ComponentInst instance.
        Throws:
        AdminException - in case of technical error.
      • getRemovedComponents

        public List<ComponentInstLight> getRemovedComponents()
                                                      throws AdminException
        Returns the all the root spaces ids available in Silverpeas
        Returns:
        a list of the removed component instances.
        Throws:
        AdminException - if an error occurs.
      • getComponentInstLight

        public ComponentInstLight getComponentInstLight​(int compLocalId)
                                                 throws AdminException
        Get component instance light with the given identifier.
        Parameters:
        compLocalId - the local identifier of a component instance.
        Returns:
        the component instance.
        Throws:
        AdminException - if an error occurs.
      • deleteComponentInst

        public void deleteComponentInst​(ComponentInst componentInst)
                                 throws AdminException
        Deletes component instance from Silverpeas.
        Parameters:
        componentInst - the component instance.
        Throws:
        AdminException - if an error occurs.
      • updateComponentInheritance

        public void updateComponentInheritance​(int compLocalId,
                                               boolean inheritanceBlocked)
                                        throws AdminException
        Throws:
        AdminException
      • moveComponentInst

        public void moveComponentInst​(int spaceLocalId,
                                      int componentLocalId)
                               throws AdminException
        Throws:
        AdminException
      • getAllCompoIdsByComponentName

        public String[] getAllCompoIdsByComponentName​(String sComponentName)
                                               throws AdminException
        Get the component ids with the given component name
        Parameters:
        sComponentName - the name of a Silverpeas component.
        Returns:
        an array with the identifiers of all the instances of the specified component.
        Throws:
        AdminException - if an error occurs.
      • getParameterValueByComponentAndParamName

        public String getParameterValueByComponentAndParamName​(Integer componentId,
                                                               String paramName,
                                                               boolean ignoreCase)
                                                        throws AdminException
        Get the value of given parameter and about given component.
        Parameters:
        componentId - component identifier.
        paramName - parameter name.
        ignoreCase - true to ignore case on parameter name.
        Returns:
        return the value as string, or StringUtil.EMPTY if parameter has not been found.
        Throws:
        AdminException - on database error.
      • getParameterValuesByComponentIdThenByParamName

        public Map<Integer,​Map<String,​String>> getParameterValuesByComponentIdThenByParamName​(Collection<Integer> componentIds,
                                                                                                          Collection<String> paramNames)
                                                                                                   throws AdminException
        Gets all parameters values by component and by parameter name.
        Parameters:
        componentIds - list of component identifier.
        paramNames - optional list of parameter name. All parameters are retrieved if it is not filled or null
        Returns:
        a map filled with couples of parameter name / value per component instance identifier.
        Throws:
        AdminException - on database error.