com.stratelia.silverpeas.pdc.control
Class PdcClassifyBmImpl

java.lang.Object
  extended by com.stratelia.silverpeas.pdc.control.PdcClassifyBmImpl
All Implemented Interfaces:
PdcClassifyBm

public class PdcClassifyBmImpl
extends Object
implements PdcClassifyBm


Constructor Summary
PdcClassifyBmImpl()
           
 
Method Summary
 int addPosition(int silverObjectId, ClassifyPosition position, String sComponentId)
          Add new position for an object
 void createValuesAndReplace(Connection con, String axisId, List<String> oldPath, List<String> newPath)
          Create two lists of Value.
 void deletePosition(int nPositionId, String sComponentId)
          Delete the position of an object
 List<Integer> findSilverContentIdByPosition(ContainerPositionInterface containerPosition, List<String> alComponentId)
           
 List<Integer> findSilverContentIdByPosition(ContainerPositionInterface containerPosition, List<String> alComponentId, String authorId, String afterDate, String beforeDate)
          Find all the SilverContentId with the given position.
 List<Integer> findSilverContentIdByPosition(ContainerPositionInterface containerPosition, List<String> alComponentId, String authorId, String afterDate, String beforeDate, boolean recursiveSearch, boolean visibilitySensitive)
          Find all the SilverContentId with the given position.
 List<Integer> getObjectsByInstance(String instanceId)
          Returns a list of object for one instance
 List<ObjectValuePair> getObjectValuePairs(SearchContext searchContext, int axisId, JoinStatement joinStatementAllPositions)
           
 List<PertinentAxis> getPertinentAxis(SearchContext searchContext, List<Integer> axisIds)
           
 List<PertinentAxis> getPertinentAxis(SearchContext searchContext, List<Integer> axisIds, JoinStatement joinStatementAllPositions)
           
 PertinentAxis getPertinentAxis(SearchContext searchContext, String axisId, String sRootValue, JoinStatement joinStatementAllPositions)
           
 List<PertinentValue> getPertinentValues(SearchContext searchContext, int axisId)
           
 List<PertinentValue> getPertinentValues(SearchContext searchContext, int axisId, JoinStatement joinStatementAllPositions)
           
 List<Position> getPositions(int silverObjectId, String sComponentId)
          Returns all positions of an object
 JoinStatement getPositionsJoinStatement(List<String> alComponentId)
           
 JoinStatement getPositionsJoinStatement(String sComponentId)
           
 boolean hasAlreadyPositions(List<Integer> objectIdList, UsedAxis usedAxis)
          search a defined position for one usedAxis
 int isPositionAlreadyExists(int silverObjectId, ClassifyPosition position)
          Check if the object is already classified on the position
 void registerAxis(Connection con, int axisId)
           
 List<Integer> removePosition(Connection connection, int nSilverContentId)
          Remove all the positions of the given content.
 void unregisterAxis(Connection con, int axisId)
           
 int updatePosition(ClassifyPosition position)
          Update the position of an object
 int updatePositions(List<Value> classifyValues, int silverObjectId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdcClassifyBmImpl

public PdcClassifyBmImpl()
Method Detail

isPositionAlreadyExists

public int isPositionAlreadyExists(int silverObjectId,
                                   ClassifyPosition position)
                            throws PdcException
Description copied from interface: PdcClassifyBm
Check if the object is already classified on the position

Specified by:
isPositionAlreadyExists in interface PdcClassifyBm
Returns:
the positionId if the object is already classified, -1 otherwise.
Throws:
PdcException

addPosition

public int addPosition(int silverObjectId,
                       ClassifyPosition position,
                       String sComponentId)
                throws PdcException
Description copied from interface: PdcClassifyBm
Add new position for an object

Specified by:
addPosition in interface PdcClassifyBm
Parameters:
silverObjectId - - id of the object to classify
position - - the position of the object
Returns:
0 position is OK, insertion have been done. 1 if variant constraint not respected
Throws:
PdcException

updatePosition

public int updatePosition(ClassifyPosition position)
                   throws PdcException
Description copied from interface: PdcClassifyBm
Update the position of an object

Specified by:
updatePosition in interface PdcClassifyBm
Parameters:
position - - the position of the object
Returns:
0 position is OK, insertion have been done. 1 if variant constraint not respected
Throws:
PdcException

updatePositions

public int updatePositions(List<Value> classifyValues,
                           int silverObjectId)
                    throws PdcException
Specified by:
updatePositions in interface PdcClassifyBm
Throws:
PdcException

deletePosition

public void deletePosition(int nPositionId,
                           String sComponentId)
                    throws PdcException
Description copied from interface: PdcClassifyBm
Delete the position of an object

Specified by:
deletePosition in interface PdcClassifyBm
Throws:
PdcException

getPositions

public List<Position> getPositions(int silverObjectId,
                                   String sComponentId)
                            throws PdcException
Description copied from interface: PdcClassifyBm
Returns all positions of an object

Specified by:
getPositions in interface PdcClassifyBm
Parameters:
silverObjectId - - id of the object
Returns:
a Position List
Throws:
PdcException

getPositionsJoinStatement

public JoinStatement getPositionsJoinStatement(String sComponentId)
                                        throws PdcException
Specified by:
getPositionsJoinStatement in interface PdcClassifyBm
Throws:
PdcException

getPositionsJoinStatement

public JoinStatement getPositionsJoinStatement(List<String> alComponentId)
                                        throws PdcException
Specified by:
getPositionsJoinStatement in interface PdcClassifyBm
Throws:
PdcException

registerAxis

public void registerAxis(Connection con,
                         int axisId)
                  throws PdcException
Specified by:
registerAxis in interface PdcClassifyBm
Throws:
PdcException

unregisterAxis

public void unregisterAxis(Connection con,
                           int axisId)
                    throws PdcException
Specified by:
unregisterAxis in interface PdcClassifyBm
Throws:
PdcException

createValuesAndReplace

public void createValuesAndReplace(Connection con,
                                   String axisId,
                                   List<String> oldPath,
                                   List<String> newPath)
                            throws PdcException
Create two lists of Value. Then, we replace the first Value list by the second

Specified by:
createValuesAndReplace in interface PdcClassifyBm
Parameters:
con - - a connection to the database
axisId - - the id of the axis
oldPath - - a list of path
newPath - - a list of path
Throws:
PdcException

getObjectsByInstance

public List<Integer> getObjectsByInstance(String instanceId)
                                   throws PdcException
Description copied from interface: PdcClassifyBm
Returns a list of object for one instance

Specified by:
getObjectsByInstance in interface PdcClassifyBm
Throws:
PdcException

hasAlreadyPositions

public boolean hasAlreadyPositions(List<Integer> objectIdList,
                                   UsedAxis usedAxis)
                            throws PdcException
search a defined position for one usedAxis

Specified by:
hasAlreadyPositions in interface PdcClassifyBm
Parameters:
objectIdList -
usedAxis - - the UsedAxis object
Returns:
true if for one UsedAxis, a position exists, false otherwise
Throws:
PdcException

getPertinentAxis

public List<PertinentAxis> getPertinentAxis(SearchContext searchContext,
                                            List<Integer> axisIds)
                                     throws PdcException
Specified by:
getPertinentAxis in interface PdcClassifyBm
Throws:
PdcException

getPertinentValues

public List<PertinentValue> getPertinentValues(SearchContext searchContext,
                                               int axisId)
                                        throws PdcException
Specified by:
getPertinentValues in interface PdcClassifyBm
Throws:
PdcException

getPertinentAxis

public List<PertinentAxis> getPertinentAxis(SearchContext searchContext,
                                            List<Integer> axisIds,
                                            JoinStatement joinStatementAllPositions)
                                     throws PdcException
Specified by:
getPertinentAxis in interface PdcClassifyBm
Throws:
PdcException

getPertinentAxis

public PertinentAxis getPertinentAxis(SearchContext searchContext,
                                      String axisId,
                                      String sRootValue,
                                      JoinStatement joinStatementAllPositions)
                               throws PdcException
Specified by:
getPertinentAxis in interface PdcClassifyBm
Throws:
PdcException

getPertinentValues

public List<PertinentValue> getPertinentValues(SearchContext searchContext,
                                               int axisId,
                                               JoinStatement joinStatementAllPositions)
                                        throws PdcException
Specified by:
getPertinentValues in interface PdcClassifyBm
Throws:
PdcException

getObjectValuePairs

public List<ObjectValuePair> getObjectValuePairs(SearchContext searchContext,
                                                 int axisId,
                                                 JoinStatement joinStatementAllPositions)
                                          throws PdcException
Specified by:
getObjectValuePairs in interface PdcClassifyBm
Throws:
PdcException

removePosition

public List<Integer> removePosition(Connection connection,
                                    int nSilverContentId)
                             throws PdcException
Remove all the positions of the given content.

Specified by:
removePosition in interface PdcClassifyBm
Parameters:
connection -
nSilverContentId -
Returns:
Throws:
PdcException

findSilverContentIdByPosition

public List<Integer> findSilverContentIdByPosition(ContainerPositionInterface containerPosition,
                                                   List<String> alComponentId,
                                                   String authorId,
                                                   String afterDate,
                                                   String beforeDate)
                                            throws PdcException
Find all the SilverContentId with the given position.

Specified by:
findSilverContentIdByPosition in interface PdcClassifyBm
Parameters:
containerPosition -
alComponentId -
authorId -
afterDate -
beforeDate -
Returns:
Throws:
PdcException

findSilverContentIdByPosition

public List<Integer> findSilverContentIdByPosition(ContainerPositionInterface containerPosition,
                                                   List<String> alComponentId,
                                                   String authorId,
                                                   String afterDate,
                                                   String beforeDate,
                                                   boolean recursiveSearch,
                                                   boolean visibilitySensitive)
                                            throws PdcException
Find all the SilverContentId with the given position.

Specified by:
findSilverContentIdByPosition in interface PdcClassifyBm
Parameters:
containerPosition -
alComponentId -
authorId -
afterDate -
beforeDate -
recursiveSearch -
visibilitySensitive -
Returns:
Throws:
PdcException

findSilverContentIdByPosition

public List<Integer> findSilverContentIdByPosition(ContainerPositionInterface containerPosition,
                                                   List<String> alComponentId)
                                            throws PdcException
Specified by:
findSilverContentIdByPosition in interface PdcClassifyBm
Throws:
PdcException


Copyright © 2016 Silverpeas. All Rights Reserved.