|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.common.MCRLinkTableManager
public class MCRLinkTableManager
This class manage all accesses to the link table database. This database holds all informations about links between MCRObjects/MCRClassifications.
| Field Summary | |
|---|---|
static String |
ENTRY_TYPE_CHILD
The list of entry types |
static String |
ENTRY_TYPE_DERIVATE
|
static String |
ENTRY_TYPE_PARENT
|
static String |
ENTRY_TYPE_REFERENCE
|
(package private) static Logger |
logger
|
protected static MCRLinkTableManager |
singleton
The link table manager singleton |
| Constructor Summary | |
|---|---|
protected |
MCRLinkTableManager()
The constructor of this class. |
| Method Summary | |
|---|---|
void |
addReferenceLink(MCRObjectID from,
MCRObjectID to,
String type,
String attr)
The method add a reference link pair. |
void |
addReferenceLink(String from,
String to,
String type,
String attr)
The method add a reference link pair. |
Map<String,Number> |
countReferenceCategory(String classid)
The method count the number of references to a category of a classification without sub ID's and returns it as a Map |
int |
countReferenceCategory(String classid,
String categid)
The method count the number of references to a category of a classification. |
int |
countReferenceLinkTo(MCRObjectID to)
The method count the reference links for a given target MCRobjectID. |
int |
countReferenceLinkTo(String to)
The method count the reference links for a given target object ID. |
int |
countReferenceLinkTo(String to,
String[] types,
String restriction)
counts the reference links for a given to object ID. |
void |
deleteReferenceLink(MCRObjectID from)
The method delete a reference link. |
void |
deleteReferenceLink(String from)
The method delete a reference link. |
void |
deleteReferenceLink(String from,
String to,
String type)
The method delete a reference link pair for the given type to the store. |
Collection<String> |
getDestinationOf(MCRObjectID from,
String type)
Returns a List of all link destinations of from and a
special type |
Collection<String> |
getDestinationOf(String from,
String type)
Returns a List of all link destination of from and a
special type |
Collection<String> |
getSourceOf(MCRObjectID to)
Returns a List of all link sources of to |
Collection<String> |
getSourceOf(MCRObjectID to,
String type)
Returns a List of all link sources of to and a special
type |
Collection<String> |
getSourceOf(String to)
Returns a List of all link sources of to |
Collection<String> |
getSourceOf(String[] to,
String type)
The method return a list of all source ID's of the refernce target to with the given type. |
Collection<String> |
getSourceOf(String to,
String type)
Returns a List of all link sources of to and a special
type |
static MCRLinkTableManager |
instance()
Returns the link table manager singleton. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ENTRY_TYPE_CHILD
public static final String ENTRY_TYPE_DERIVATE
public static final String ENTRY_TYPE_PARENT
public static final String ENTRY_TYPE_REFERENCE
protected static MCRLinkTableManager singleton
static Logger logger
| Constructor Detail |
|---|
protected MCRLinkTableManager()
| Method Detail |
|---|
public static MCRLinkTableManager instance()
public void addReferenceLink(MCRObjectID from,
MCRObjectID to,
String type,
String attr)
from - the source of the reference as MCRObjectIDto - the target of the reference as MCRObjectIDtype - the type of the reference as Stringattr - the optional attribute of the reference as String
public void addReferenceLink(String from,
String to,
String type,
String attr)
from - the source of the reference as Stringto - the target of the reference as Stringtype - the type of the reference as Stringattr - the optional attribute of the reference as Stringpublic void deleteReferenceLink(MCRObjectID from)
from - the source of the reference as MCRObjectIDpublic void deleteReferenceLink(String from)
from - the source of the reference as String
public void deleteReferenceLink(String from,
String to,
String type)
from - the source of the reference as Stringto - the target of the reference as Stringtype - the type of the reference as Stringpublic int countReferenceLinkTo(MCRObjectID to)
to - the object ID as MCRObjectID, they was referenced
public int countReferenceLinkTo(String to)
to - the object ID as String, they was referenced
public int countReferenceLinkTo(String to,
String[] types,
String restriction)
types - Array of document type slected by the mcrfrom contentrestriction - a first part of the to ID as String, it can be null
public Map<String,Number> countReferenceCategory(String classid)
classid - the classification ID as MCRObjectID
public int countReferenceCategory(String classid,
String categid)
classid - the classification ID as Stringcategid - the category ID as String
public Collection<String> getSourceOf(MCRObjectID to)
to
to - The MCRObjectID to referenced.
public Collection<String> getSourceOf(String to)
to
to - The ID to referenced.
public Collection<String> getSourceOf(MCRObjectID to,
String type)
to and a special
type
to - Destination-IDtype - link reference type
public Collection<String> getSourceOf(String to,
String type)
to and a special
type
to - Destination-IDtype - link reference type
public Collection<String> getSourceOf(String[] to,
String type)
to - the refernce target totype - type of the refernce
public Collection<String> getDestinationOf(MCRObjectID from,
String type)
from and a
special type
from - Destination-IDtype - link reference type
public Collection<String> getDestinationOf(String from,
String type)
from and a
special type
from - Source-IDtype - Link reference type, this can be null. Current types are
classid, child, parent, reference and derivate.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||