Class ComponentInstManager
- java.lang.Object
-
- org.silverpeas.core.admin.service.ComponentInstManager
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ComponentInstManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ComponentInst
copy(ComponentInst componentInstToCopy)
Return a copy of the given component instance.void
createComponentInst(ComponentInst componentInst, int spaceLocalId)
Creates a component instance in databasevoid
deleteComponentInst(ComponentInst componentInst)
Deletes component instance from Silverpeas.static ComponentInstManager
get()
List<String>
getAllActiveComponentIds()
String[]
getAllCompoIdsByComponentName(String sComponentName)
Get the component ids with the given component nameList<String>
getAllowedComponentIds(int userId, List<String> groupIds)
List<String>
getAllowedComponentIds(int userId, List<String> groupIds, Integer spaceLocalId)
List<String>
getAllowedComponentIds(int userId, List<String> groupIds, Integer spaceLocalId, String componentName)
List<Integer>
getComponentIds(Parameter parameter)
String[]
getComponentIdsInSpace(int spaceId)
ComponentInst
getComponentInst(int componentId)
Get component instance with the given id.ComponentInstLight
getComponentInstLight(int compLocalId)
Get component instance light with the given identifier.List<ComponentInstLight>
getComponentsInSpace(int spaceId)
List<Parameter>
getParameters(int compLocalId)
String
getParameterValueByComponentAndParamName(Integer componentId, String paramName, boolean ignoreCase)
Get the value of given parameter and about given component.Map<Integer,Map<String,String>>
getParameterValuesByComponentIdThenByParamName(Collection<Integer> componentIds, Collection<String> paramNames)
Gets all parameters values by component and by parameter name.List<ComponentInstLight>
getRemovedComponents()
Returns the all the root spaces ids available in Silverpeasvoid
moveComponentInst(int spaceLocalId, int componentLocalId)
void
restoreComponentFromBasket(int localComponentId)
void
sendComponentToBasket(ComponentInst componentInst, String userId)
void
updateComponentInheritance(int compLocalId, boolean inheritanceBlocked)
void
updateComponentInst(ComponentInst compoInstOld, ComponentInst compoInstNew)
void
updateComponentOrder(int compLocalId, int orderNum)
-
-
-
Field Detail
-
COMPONENT
public static final String COMPONENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public static ComponentInstManager get()
-
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.
-
sendComponentToBasket
public void sendComponentToBasket(ComponentInst componentInst, String userId) throws AdminException
- Throws:
AdminException
-
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.
-
updateComponentOrder
public void updateComponentOrder(int compLocalId, int orderNum) throws AdminException
- Throws:
AdminException
-
updateComponentInheritance
public void updateComponentInheritance(int compLocalId, boolean inheritanceBlocked) throws AdminException
- Throws:
AdminException
-
updateComponentInst
public void updateComponentInst(ComponentInst compoInstOld, ComponentInst compoInstNew) 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.
-
getComponentIdsInSpace
public String[] getComponentIdsInSpace(int spaceId) throws AdminException
- Throws:
AdminException
-
getAllActiveComponentIds
public List<String> getAllActiveComponentIds() throws AdminException
- Throws:
AdminException
-
getComponentsInSpace
public List<ComponentInstLight> getComponentsInSpace(int spaceId) throws AdminException
- Throws:
AdminException
-
getAllowedComponentIds
public List<String> getAllowedComponentIds(int userId, List<String> groupIds) throws AdminException
- Throws:
AdminException
-
getAllowedComponentIds
public List<String> getAllowedComponentIds(int userId, List<String> groupIds, Integer spaceLocalId) throws AdminException
- Throws:
AdminException
-
getAllowedComponentIds
public List<String> getAllowedComponentIds(int userId, List<String> groupIds, Integer spaceLocalId, String componentName) throws AdminException
- Throws:
AdminException
-
getParameters
public List<Parameter> getParameters(int compLocalId) throws AdminException
- Throws:
AdminException
-
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.
-
getComponentIds
public List<Integer> getComponentIds(Parameter parameter) throws AdminException
- Throws:
AdminException
-
-