Class GlobalPdcManager
- java.lang.Object
-
- org.silverpeas.core.pdc.pdc.service.GlobalPdcManager
-
- All Implemented Interfaces:
PdcManager
@Service public class GlobalPdcManager extends Object implements PdcManager
-
-
Field Summary
-
Fields inherited from interface org.silverpeas.core.pdc.pdc.service.PdcManager
PRIMARY_AXIS, SECONDARY_AXIS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GlobalPdcManager()
Constructor declaration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addPosition(int silverObjectId, ClassifyPosition position, String sComponentId)
int
addPosition(int silverObjectId, ClassifyPosition position, String sComponentId, boolean alertSubscribers)
void
addPositions(List<ClassifyPosition> positions, int objectId, String instanceId)
int
addUsedAxis(UsedAxis usedAxis)
Method declarationvoid
copyPositions(int fromObjectId, String fromInstanceId, int toObjectId, String toInstanceId)
int
createAxis(AxisHeader axisHeader)
Create an axe into the data base.int
createDaughterValue(Value valueToInsert, String refValue, String treeId)
insert a value which is defined like a daughter valueString
createDaughterValueWithId(Value valueToInsert, String refValue, String treeId)
insert a value which is defined like a daughter valuevoid
deleteAxis(Connection con, String axisId)
delete the axe from the data base and all its subtrees.void
deleteGroupManager(String groupId)
void
deleteManager(String userId)
void
deletePosition(int positionId, String sComponentId)
void
deleteUsedAxis(String usedAxisId)
Method declarationvoid
deleteUsedAxis(Collection<String> usedAxisIds)
Method declarationString
deleteValue(Connection con, String valueId, String axisId, String treeId)
Delete the selected value.void
deleteValueAndSubtree(Connection con, String valueId, String axisId, String treeId)
Delete a value and it's sub treeServiceList<GlobalSilverContent>
findGlobalSilverContents(SearchContext containerPosition, List<String> componentIds, boolean recursiveSearch, boolean visibilitySensitive)
List<Integer>
findSilverContentIdByPosition(SearchContext containerPosition, List<String> alComponentId)
Find all the SilverContentId with the given positionList<Integer>
findSilverContentIdByPosition(SearchContext containerPosition, List<String> alComponentId, String authorId, LocalDate afterDate, LocalDate beforeDate)
List<AxisHeader>
getAxis()
Returns a list of axes sorted.List<AxisHeader>
getAxisByType(String type)
Returns a list of axes sorted in according to the axe type.Axis
getAxisDetail(String axisId)
Returns a detail axe (header,values).AxisHeader
getAxisHeader(String axisId)
Method declarationAxisHeader
getAxisHeader(String axisId, boolean setTranslations)
Value
getAxisValue(String valueId, String treeId)
Returns a value from an axe.List<Value>
getAxisValues(int treeId)
List<Value>
getAxisValuesByName(String valueName)
Return a list of axis values having the value name in parameterList<Value>
getDaughters(String axisId, String valueId)
List<String>
getDaughterValues(String axisId, String valueId)
Return a list of String corresponding to the valueId of the value in parameterList<Value>
getFirstLevelAxisValuesByInstanceId(SearchContext searchContext, String axisId, String instanceId)
List<Value>
getFirstLevelAxisValuesByInstanceIds(SearchContext searchContext, String axisId, List<String> instanceIds)
List<Value>
getFullPath(String valueId, String treeId)
Returns the full path of the valueList<List<String>>
getInheritedManagers(Value value)
retourne les droits hérités sur la valeurList<List<String>>
getManagers(String axisId, String valueId)
retourne les droits sur la valeurint
getNbAxis()
Return the number of axe.int
getNbMaxAxis()
Return the max number of axis.List<SearchAxis>
getPertinentAxisByInstanceId(SearchContext searchContext, String axisType, String instanceId)
List<SearchAxis>
getPertinentAxisByInstanceIds(SearchContext searchContext, String axisType, List<String> instanceIds)
List<Value>
getPertinentDaughterValuesByInstanceId(SearchContext searchContext, String axisId, String valueId, String instanceId)
List<Value>
getPertinentDaughterValuesByInstanceIds(SearchContext searchContext, String axisId, String valueId, List<String> instanceIds)
List<ClassifyPosition>
getPositions(int silverObjectId, String sComponentId)
Value
getRoot(String axisId)
Return the Value corresponding to the axis doneSearchContext
getSilverContentIdSearchContext(int nSilverContentId, String sComponentId)
Get the SearchContext of the first position for the given SilverContentIdList<GlobalSilverContent>
getSilverContentsByIds(List<Integer> silverContentIds, String userId)
String
getTreeId(String axisId)
UsedAxis
getUsedAxis(String usedAxisId)
************************************************** ******** PDC Utilization Settings Methods ******** **************************************************List<UsedAxis>
getUsedAxisByInstanceId(String instanceId)
Method declarationList<UsedAxis>
getUsedAxisToClassify(String instanceId, int silverObjectId)
Gets the axis used by the specified component instance to classify the specified Silverpeas object.Value
getValue(String axisId, String valueId)
Returns a value from an axe.void
indexAllAxis()
int
insertMotherValue(Value valueToInsert, String refValue, String axisId)
insert a value which is defined like a mother valueboolean
isClassifyingMandatory(String componentId)
To know if classifying is mandatory on a given componentboolean
isUserManager(String userId)
int
moveValueToNewFatherId(Axis axis, Value valueToMove, String newFatherId, int orderNumber)
Move a value under a new fathervoid
razManagers(String axisId, String valueId)
supprime tous les droits sur la valeurvoid
setManagers(List<String> userIds, List<String> groupIds, String axisId, String valueId)
met à jour les droits sur la valeurint
updateAxis(AxisHeader axisHeader)
Update an axe into the data base.int
updatePosition(ClassifyPosition position, String instanceId, int silverObjectId)
int
updatePosition(ClassifyPosition position, String instanceId, int silverObjectId, boolean alertSubscribers)
int
updateUsedAxis(UsedAxis usedAxis)
Method declarationint
updateValue(Value value, String treeId)
Update the selected value
-
-
-
Method Detail
-
findGlobalSilverContents
public List<GlobalSilverContent> findGlobalSilverContents(SearchContext containerPosition, List<String> componentIds, boolean recursiveSearch, boolean visibilitySensitive)
- Specified by:
findGlobalSilverContents
in interfacePdcManager
-
getAxisByType
public List<AxisHeader> getAxisByType(String type) throws PdcException
Returns a list of axes sorted in according to the axe type.- Specified by:
getAxisByType
in interfacePdcManager
- Parameters:
type
- - the whished type of the axe.- Returns:
- a sorted list.
- Throws:
PdcException
-
getAxis
public List<AxisHeader> getAxis() throws PdcException
Returns a list of axes sorted.- Specified by:
getAxis
in interfacePdcManager
- Returns:
- a list sorted or null otherwise
- Throws:
PdcException
-
getNbAxis
public int getNbAxis() throws PdcException
Return the number of axe.- Specified by:
getNbAxis
in interfacePdcManager
- Returns:
- the number of axe
- Throws:
PdcException
-
getNbMaxAxis
public int getNbMaxAxis()
Return the max number of axis.- Specified by:
getNbMaxAxis
in interfacePdcManager
- Returns:
- the max number of axis
-
createAxis
public int createAxis(AxisHeader axisHeader) throws PdcException
Create an axe into the data base.- Specified by:
createAxis
in interfacePdcManager
- Parameters:
axisHeader
- - the object which contains all data about an axe- Returns:
- 1 if the maximun of axe is atteignable, 2 if the axe already exist, 0 otherwise
- Throws:
PdcException
-
updateAxis
public int updateAxis(AxisHeader axisHeader) throws PdcException
Update an axe into the data base.- Specified by:
updateAxis
in interfacePdcManager
- Parameters:
axisHeader
- - the object which contains all data about an axe- Returns:
- 2 if the axe already exist, 0 otherwise
- Throws:
PdcException
-
deleteAxis
public void deleteAxis(Connection con, String axisId) throws PdcException
delete the axe from the data base and all its subtrees.- Specified by:
deleteAxis
in interfacePdcManager
- Parameters:
axisId
- - the id of the selected axe- Throws:
PdcException
-
getAxisDetail
public Axis getAxisDetail(String axisId) throws PdcException
Returns a detail axe (header,values).- Specified by:
getAxisDetail
in interfacePdcManager
- Parameters:
axisId
- - the id of the selected axe.- Returns:
- the Axis Object
- Throws:
PdcException
-
getTreeId
public String getTreeId(String axisId) throws PdcException
- Specified by:
getTreeId
in interfacePdcManager
- Throws:
PdcException
-
getValue
public Value getValue(String axisId, String valueId) throws PdcException
Returns a value from an axe.- Specified by:
getValue
in interfacePdcManager
- Parameters:
valueId
- - the id of the selected value- Returns:
- the Value object
- Throws:
PdcException
-
getAxisValue
public Value getAxisValue(String valueId, String treeId) throws PdcException
Returns a value from an axe.- Specified by:
getAxisValue
in interfacePdcManager
- Parameters:
valueId
- - the id of the selected value- Returns:
- the Value object
- Throws:
PdcException
-
getAxisValuesByName
public List<Value> getAxisValuesByName(String valueName) throws PdcException
Return a list of axis values having the value name in parameter- Specified by:
getAxisValuesByName
in interfacePdcManager
- Parameters:
valueName
- the name of the value.- Returns:
- a list of axis values.
- Throws:
PdcException
- if an error occurs while getting the axis values.
-
getDaughterValues
public List<String> getDaughterValues(String axisId, String valueId) throws PdcException
Return a list of String corresponding to the valueId of the value in parameter- Specified by:
getDaughterValues
in interfacePdcManager
- Parameters:
axisId
- axis identifiervalueId
- value identifier- Returns:
- List of String
- Throws:
PdcException
- if an error occurs while getting the values
-
getRoot
public Value getRoot(String axisId) throws PdcException
Return the Value corresponding to the axis done- Specified by:
getRoot
in interfacePdcManager
- Parameters:
axisId
- the axis identifier- Returns:
- org.silverpeas.core.pdc.pdc.model.Value
- Throws:
PdcException
- while getting the root value of the specified axis.
-
getAxisValues
public List<Value> getAxisValues(int treeId) throws PdcException
- Specified by:
getAxisValues
in interfacePdcManager
- Parameters:
treeId
- The id of the selected axis.- Returns:
- The list of values of the axis.
- Throws:
PdcException
-
insertMotherValue
public int insertMotherValue(Value valueToInsert, String refValue, String axisId) throws PdcException
insert a value which is defined like a mother value- Specified by:
insertMotherValue
in interfacePdcManager
- Parameters:
valueToInsert
- - a Value objectrefValue
- - the id of the Value to insert- Returns:
- 1 if the name already exist 0 otherwise
- Throws:
PdcException
-
moveValueToNewFatherId
public int moveValueToNewFatherId(Axis axis, Value valueToMove, String newFatherId, int orderNumber) throws PdcException
Move a value under a new father- Specified by:
moveValueToNewFatherId
in interfacePdcManager
- Parameters:
axis
- : l'axe concernévalueToMove
- - a Value objectnewFatherId
- - the id of the new father- Returns:
- 1 if the name already exist 0 otherwise
- Throws:
PdcException
-
getInheritedManagers
public List<List<String>> getInheritedManagers(Value value) throws PdcException
Description copied from interface:PdcManager
retourne les droits hérités sur la valeur- Specified by:
getInheritedManagers
in interfacePdcManager
- Returns:
- ArrayList( ArrayList UsersId, ArrayList GroupsId)
- Throws:
PdcException
-
getManagers
public List<List<String>> getManagers(String axisId, String valueId) throws PdcException
Description copied from interface:PdcManager
retourne les droits sur la valeur- Specified by:
getManagers
in interfacePdcManager
- Returns:
- ArrayList( ArrayList UsersId, ArrayList GroupsId)
- Throws:
PdcException
-
isUserManager
public boolean isUserManager(String userId) throws PdcException
- Specified by:
isUserManager
in interfacePdcManager
- Throws:
PdcException
-
setManagers
public void setManagers(List<String> userIds, List<String> groupIds, String axisId, String valueId) throws PdcException
Description copied from interface:PdcManager
met à jour les droits sur la valeur- Specified by:
setManagers
in interfacePdcManager
- Throws:
PdcException
-
razManagers
public void razManagers(String axisId, String valueId) throws PdcException
Description copied from interface:PdcManager
supprime tous les droits sur la valeur- Specified by:
razManagers
in interfacePdcManager
- Throws:
PdcException
-
deleteManager
public void deleteManager(String userId) throws PdcException
- Specified by:
deleteManager
in interfacePdcManager
- Throws:
PdcException
-
deleteGroupManager
public void deleteGroupManager(String groupId) throws PdcException
- Specified by:
deleteGroupManager
in interfacePdcManager
- Throws:
PdcException
-
createDaughterValue
public int createDaughterValue(Value valueToInsert, String refValue, String treeId) throws PdcException
insert a value which is defined like a daughter value- Specified by:
createDaughterValue
in interfacePdcManager
- Parameters:
valueToInsert
- - a Value objectrefValue
- - the id of the Value to insert- Returns:
- 1 if the name already exist 0 otherwise
- Throws:
PdcException
-
createDaughterValueWithId
public String createDaughterValueWithId(Value valueToInsert, String refValue, String treeId) throws PdcException
insert a value which is defined like a daughter value- Specified by:
createDaughterValueWithId
in interfacePdcManager
- Parameters:
valueToInsert
- - a Value objectrefValue
- - the id of the Value to insert- Returns:
- -1 if the name already exists id otherwise
- Throws:
PdcException
-
updateValue
public int updateValue(Value value, String treeId) throws PdcException
Update the selected value- Specified by:
updateValue
in interfacePdcManager
- Parameters:
value
- - a Value object- Returns:
- 1 if the name already exist 0 otherwise
- Throws:
PdcException
-
deleteValueAndSubtree
public void deleteValueAndSubtree(Connection con, String valueId, String axisId, String treeId) throws PdcException
Delete a value and it's sub treeService- Specified by:
deleteValueAndSubtree
in interfacePdcManager
- Parameters:
valueId
- - the id of the select value- Throws:
PdcException
-
deleteValue
public String deleteValue(Connection con, String valueId, String axisId, String treeId) throws PdcException
Delete the selected value. If a daughter of the selected value is named like a sister of her mother the delete is not possible.- Specified by:
deleteValue
in interfacePdcManager
- Parameters:
valueId
- - the id of the select value- Returns:
- null if the delete is possible, the name of her daughter else.
- Throws:
PdcException
-
getFullPath
public List<Value> getFullPath(String valueId, String treeId) throws PdcException
Returns the full path of the value- Specified by:
getFullPath
in interfacePdcManager
- Parameters:
valueId
- - the id of the selected value (value is not empty)- Returns:
- the complet path - It's a List of ArrayList. Each ArrayList contains the name, the id and the treeId of the value in the path.
- Throws:
PdcException
-
getAxisHeader
public AxisHeader getAxisHeader(String axisId)
Description copied from interface:PdcManager
Method declaration- Specified by:
getAxisHeader
in interfacePdcManager
- Returns:
-
getAxisHeader
public AxisHeader getAxisHeader(String axisId, boolean setTranslations)
-
getDaughters
public List<Value> getDaughters(String axisId, String valueId)
- Specified by:
getDaughters
in interfacePdcManager
-
getUsedAxis
public UsedAxis getUsedAxis(String usedAxisId) throws PdcException
************************************************** ******** PDC Utilization Settings Methods ******** **************************************************- Specified by:
getUsedAxis
in interfacePdcManager
- Throws:
PdcException
-
getUsedAxisByInstanceId
public List<UsedAxis> getUsedAxisByInstanceId(String instanceId) throws PdcException
Description copied from interface:PdcManager
Method declaration- Specified by:
getUsedAxisByInstanceId
in interfacePdcManager
- Returns:
- Throws:
PdcException
-
addUsedAxis
public int addUsedAxis(UsedAxis usedAxis) throws PdcException
Description copied from interface:PdcManager
Method declaration- Specified by:
addUsedAxis
in interfacePdcManager
- Returns:
- Throws:
PdcException
-
updateUsedAxis
public int updateUsedAxis(UsedAxis usedAxis) throws PdcException
Description copied from interface:PdcManager
Method declaration- Specified by:
updateUsedAxis
in interfacePdcManager
- Returns:
- Throws:
PdcException
-
deleteUsedAxis
public void deleteUsedAxis(String usedAxisId) throws PdcException
Description copied from interface:PdcManager
Method declaration- Specified by:
deleteUsedAxis
in interfacePdcManager
- Throws:
PdcException
-
deleteUsedAxis
public void deleteUsedAxis(Collection<String> usedAxisIds) throws PdcException
Description copied from interface:PdcManager
Method declaration- Specified by:
deleteUsedAxis
in interfacePdcManager
- Throws:
PdcException
-
getUsedAxisToClassify
public List<UsedAxis> getUsedAxisToClassify(String instanceId, int silverObjectId) throws PdcException
Description copied from interface:PdcManager
Gets the axis used by the specified component instance to classify the specified Silverpeas object. If there is no axis configured to be used in the component instance, then all PdC axis are returned as axis that can be used for classifying a content. If the content is already classified, then the values on invariant axis are used as invariant values.- Specified by:
getUsedAxisToClassify
in interfacePdcManager
- Parameters:
instanceId
- the unique identifier of the component instance.silverObjectId
- the Silverpeas object identifier representing the content to classify.- Returns:
- a list of axis to use in the classification of a content.
- Throws:
PdcException
- if an error occurs while getting the PdC axis for the specified component instance.
-
addPositions
public void addPositions(List<ClassifyPosition> positions, int objectId, String instanceId) throws PdcException
- Specified by:
addPositions
in interfacePdcManager
- Throws:
PdcException
-
copyPositions
public void copyPositions(int fromObjectId, String fromInstanceId, int toObjectId, String toInstanceId) throws PdcException
- Specified by:
copyPositions
in interfacePdcManager
- Throws:
PdcException
-
addPosition
public int addPosition(int silverObjectId, ClassifyPosition position, String sComponentId) throws PdcException
- Specified by:
addPosition
in interfacePdcManager
- Throws:
PdcException
-
addPosition
public int addPosition(int silverObjectId, ClassifyPosition position, String sComponentId, boolean alertSubscribers) throws PdcException
- Specified by:
addPosition
in interfacePdcManager
- Throws:
PdcException
-
updatePosition
public int updatePosition(ClassifyPosition position, String instanceId, int silverObjectId) throws PdcException
- Specified by:
updatePosition
in interfacePdcManager
- Throws:
PdcException
-
updatePosition
public int updatePosition(ClassifyPosition position, String instanceId, int silverObjectId, boolean alertSubscribers) throws PdcException
- Specified by:
updatePosition
in interfacePdcManager
- Throws:
PdcException
-
deletePosition
public void deletePosition(int positionId, String sComponentId) throws PdcException
- Specified by:
deletePosition
in interfacePdcManager
- Throws:
PdcException
-
getPositions
public List<ClassifyPosition> getPositions(int silverObjectId, String sComponentId) throws PdcException
- Specified by:
getPositions
in interfacePdcManager
- Throws:
PdcException
-
getPertinentAxisByInstanceId
public List<SearchAxis> getPertinentAxisByInstanceId(SearchContext searchContext, String axisType, String instanceId) throws PdcException
- Specified by:
getPertinentAxisByInstanceId
in interfacePdcManager
- Throws:
PdcException
-
getPertinentAxisByInstanceIds
public List<SearchAxis> getPertinentAxisByInstanceIds(SearchContext searchContext, String axisType, List<String> instanceIds) throws PdcException
- Specified by:
getPertinentAxisByInstanceIds
in interfacePdcManager
- Throws:
PdcException
-
getPertinentDaughterValuesByInstanceId
public List<Value> getPertinentDaughterValuesByInstanceId(SearchContext searchContext, String axisId, String valueId, String instanceId) throws PdcException
- Specified by:
getPertinentDaughterValuesByInstanceId
in interfacePdcManager
- Throws:
PdcException
-
getPertinentDaughterValuesByInstanceIds
public List<Value> getPertinentDaughterValuesByInstanceIds(SearchContext searchContext, String axisId, String valueId, List<String> instanceIds) throws PdcException
- Specified by:
getPertinentDaughterValuesByInstanceIds
in interfacePdcManager
- Throws:
PdcException
-
getFirstLevelAxisValuesByInstanceId
public List<Value> getFirstLevelAxisValuesByInstanceId(SearchContext searchContext, String axisId, String instanceId) throws PdcException
- Specified by:
getFirstLevelAxisValuesByInstanceId
in interfacePdcManager
- Throws:
PdcException
-
getFirstLevelAxisValuesByInstanceIds
public List<Value> getFirstLevelAxisValuesByInstanceIds(SearchContext searchContext, String axisId, List<String> instanceIds) throws PdcException
- Specified by:
getFirstLevelAxisValuesByInstanceIds
in interfacePdcManager
- Throws:
PdcException
-
isClassifyingMandatory
public boolean isClassifyingMandatory(String componentId) throws PdcException
To know if classifying is mandatory on a given component- Specified by:
isClassifyingMandatory
in interfacePdcManager
- Parameters:
componentId
- - id of the component to test- Returns:
- true if at least one axis has been selected on component AND at least one axis is mandatory
- Throws:
PdcException
- if an error occurs.
-
indexAllAxis
public void indexAllAxis() throws PdcException
- Specified by:
indexAllAxis
in interfacePdcManager
- Throws:
PdcException
-
getSilverContentIdSearchContext
public SearchContext getSilverContentIdSearchContext(int nSilverContentId, String sComponentId) throws PdcException
Get the SearchContext of the first position for the given SilverContentId- Specified by:
getSilverContentIdSearchContext
in interfacePdcManager
- Throws:
PdcException
-
findSilverContentIdByPosition
public List<Integer> findSilverContentIdByPosition(SearchContext containerPosition, List<String> alComponentId, String authorId, LocalDate afterDate, LocalDate beforeDate) throws PdcException
- Specified by:
findSilverContentIdByPosition
in interfacePdcManager
- Throws:
PdcException
-
findSilverContentIdByPosition
public List<Integer> findSilverContentIdByPosition(SearchContext containerPosition, List<String> alComponentId) throws PdcException
Description copied from interface:PdcManager
Find all the SilverContentId with the given position- Specified by:
findSilverContentIdByPosition
in interfacePdcManager
- Throws:
PdcException
-
getSilverContentsByIds
public List<GlobalSilverContent> getSilverContentsByIds(List<Integer> silverContentIds, String userId)
- Specified by:
getSilverContentsByIds
in interfacePdcManager
-
-