org.olat.resource.references
Class ReferenceManager

java.lang.Object
  extended by org.olat.resource.references.ReferenceManager

public class ReferenceManager
extends java.lang.Object

Initial Date: May 27, 2004

Author:
Mike Stock Comment:

Method Summary
 void addReference(OLATResourceable source, OLATResourceable target, java.lang.String userdata)
          Add a new reference.
 void delete(ReferenceImpl ref)
           
static ReferenceManager getInstance()
           
 java.util.List getReferences(OLATResourceable source)
          List all references the source holds.
 java.util.List getReferencesTo(OLATResourceable target)
          List all sources which hold references to the target.
 java.lang.String getReferencesToSummary(OLATResourceable target, java.util.Locale locale)
          Get an HTML summary of existing references or null if no references exist.
 boolean hasReferencesTo(OLATResourceable target)
          Check wether any references to the target exist.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ReferenceManager getInstance()
Returns:
Singleton.

addReference

public void addReference(OLATResourceable source,
                         OLATResourceable target,
                         java.lang.String userdata)
Add a new reference. The meaning of source and target is such as the source references the target.

Parameters:
source -
target -
userdata -

getReferences

public java.util.List getReferences(OLATResourceable source)
List all references the source holds.

Parameters:
source -
Returns:
List of renerences.

getReferencesTo

public java.util.List getReferencesTo(OLATResourceable target)
List all sources which hold references to the target.

Parameters:
target -
Returns:
List of references.

hasReferencesTo

public boolean hasReferencesTo(OLATResourceable target)
Check wether any references to the target exist.

Parameters:
target -
Returns:
True if references exist.

getReferencesToSummary

public java.lang.String getReferencesToSummary(OLATResourceable target,
                                               java.util.Locale locale)
Get an HTML summary of existing references or null if no references exist.

Parameters:
target -
locale -
Returns:
HTML fragment or null if no references exist.

delete

public void delete(ReferenceImpl ref)
Parameters:
ref -