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 componentInstvoid
createComponentInst(ComponentInst componentInst, int spaceLocalId)
Creates a component instance in databasevoid
deleteComponentInst(ComponentInst componentInst)
Deletes component instance from Silverpeasstatic 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 localComponentId, Integer spaceLocalId)
Get component instance with the given idComponentInstLight
getComponentInstLight(int compLocalId)
Get component instance light with the given idList<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()
Return 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
setComponentInst(ComponentInst componentInst, int compLocalId, int fatherId)
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 componentInst- Parameters:
componentInstToCopy
-- Returns:
-
createComponentInst
public void createComponentInst(ComponentInst componentInst, int spaceLocalId) throws AdminException
Creates a component instance in database- Parameters:
componentInst
-spaceLocalId
-- Throws:
AdminException
-
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 localComponentId, Integer spaceLocalId) throws AdminException
Get component instance with the given id- Parameters:
localComponentId
-spaceLocalId
-- Returns:
- Throws:
AdminException
-
getRemovedComponents
public List<ComponentInstLight> getRemovedComponents() throws AdminException
Return the all the root spaces ids available in Silverpeas- Returns:
- Throws:
AdminException
-
getComponentInstLight
public ComponentInstLight getComponentInstLight(int compLocalId) throws AdminException
Get component instance light with the given id- Parameters:
compLocalId
-- Returns:
- Throws:
AdminException
-
setComponentInst
public void setComponentInst(ComponentInst componentInst, int compLocalId, int fatherId) throws AdminException
- Throws:
AdminException
-
deleteComponentInst
public void deleteComponentInst(ComponentInst componentInst) throws AdminException
Deletes component instance from Silverpeas- Parameters:
componentInst
-- Throws:
AdminException
-
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
-- Returns:
- Throws:
AdminException
-
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
-
-