Dekoh platform API

dekoh.portal.fwk.persistence
Class Tag

java.lang.Object
  extended by dekoh.portal.fwk.persistence.Tag

public class Tag
extends Object

Tag is a word or a phrase that describes one or more DigitalObjects. Tags are typically chosen by the owner of the content. Once content is tagged, owner can retrieve the relavant content by searching by the tag.

Since:
Oct 6, 2006

Constructor Summary
protected Tag()
           
  Tag(String tag, String applicationId)
           
  Tag(String tag, String applicationId, LocalUser owner)
           
 
Method Summary
 boolean equals(Object o)
           
static List findAccessibleTags(DIOEntityManager em, String tag, String applicationId, LocalUser owner)
           
static Tag findTag(DIOEntityManager em, String tag, String applicationId, LocalUser owner)
           
static Tag findTag(String tag, String applicationId, DIOEntityManager em)
           
static Tag findTag(String tag, String applicationId, LocalUser owner, DIOEntityManager em)
           
 String getApplicationId()
           
 Timestamp getCreationTime()
           
 Page getDigitalObjectPage(DIOEntityManager em, int pageNumber, int pageSize, int totalDios)
           
 Set getDigitalObjects()
           
 int getId()
           
static Tag getOrCreateTag(DIOEntityManager em, String tag, String applicationId)
           
static Tag getOrCreateTag(DIOEntityManager em, String tag, String applicationId, LocalUser owner)
           
 LocalUser getOwner()
           
 String getTag()
           
 int hashCode()
           
static void main(String[] args)
           
 Tag merge(DIOEntityManager em, String tagToMergeInto)
          Merge this tag with the specified tag.
 void setCreationTime(Timestamp creationTime)
           
 void setDigitalObjects(Set digitalObjects)
           
 void setOwner(LocalUser owner)
           
 void setTag(String tag)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tag

protected Tag()

Tag

public Tag(String tag,
           String applicationId)

Tag

public Tag(String tag,
           String applicationId,
           LocalUser owner)
Method Detail

getId

public int getId()

getTag

public String getTag()

setTag

public void setTag(String tag)

getCreationTime

public Timestamp getCreationTime()

setCreationTime

public void setCreationTime(Timestamp creationTime)

getDigitalObjects

public Set getDigitalObjects()

getApplicationId

public String getApplicationId()

getDigitalObjectPage

public Page getDigitalObjectPage(DIOEntityManager em,
                                 int pageNumber,
                                 int pageSize,
                                 int totalDios)

setDigitalObjects

public void setDigitalObjects(Set digitalObjects)

toString

public String toString()
Overrides:
toString in class Object

getOrCreateTag

public static Tag getOrCreateTag(DIOEntityManager em,
                                 String tag,
                                 String applicationId)

getOrCreateTag

public static Tag getOrCreateTag(DIOEntityManager em,
                                 String tag,
                                 String applicationId,
                                 LocalUser owner)

findTag

public static Tag findTag(DIOEntityManager em,
                          String tag,
                          String applicationId,
                          LocalUser owner)

findAccessibleTags

public static List findAccessibleTags(DIOEntityManager em,
                                      String tag,
                                      String applicationId,
                                      LocalUser owner)

merge

public Tag merge(DIOEntityManager em,
                 String tagToMergeInto)
Merge this tag with the specified tag. All the digitalObjects associalted with this tag will be associated with the new tag. This tag will be removed. If the new tagToMergeInto does not exist, a new Tag will be created and returned. Since the current tag is removed any operation on it will not be persisted to database.

Parameters:
em -
tagToMergeInto -
Returns:
the merged tag

findTag

public static Tag findTag(String tag,
                          String applicationId,
                          DIOEntityManager em)

findTag

public static Tag findTag(String tag,
                          String applicationId,
                          LocalUser owner,
                          DIOEntityManager em)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setOwner

public void setOwner(LocalUser owner)

getOwner

public LocalUser getOwner()

main

public static void main(String[] args)

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers