|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdekoh.portal.fwk.persistence.Share
public class Share
A Share stores the relationship between DigitalObjects shared with buddies by the owner.
Comments can be made on this share.
| Nested Class Summary | |
|---|---|
static class |
Share.BuddyVisitEvent
Describes a buddy's visit to a share. |
| Field Summary | |
|---|---|
static String |
FIND_ALL_NOT_EMPTY_SHARES_BY_OWNER_OF_TYPE
|
static String |
FIND_ALL_SHARES_BY_OWNER_OF_TYPE
|
static String |
FIND_SHARE_BY_ID_OWNER
|
static String |
QUERY_VISIT_COUNT
|
| Constructor Summary | |
|---|---|
protected |
Share()
|
|
Share(String name,
String applicationId)
|
| Method Summary | |
|---|---|
void |
addBuddyToShare(Buddy buddy)
|
void |
addDigitalObjectToShare(DigitalObject digitalObject)
Adds a DigitalObject to this share. |
static int |
deleteShareByIdAndOwner(DIOEntityManager em,
int id,
LocalUser owner)
Delete specified share, if it was created by the given owner. |
void |
disableShare()
|
void |
enableShare()
|
static Share |
findShareByIdAndOwner(DIOEntityManager em,
int id,
LocalUser owner)
|
static Share |
findShareByIdAndOwner(DIOEntityManager em,
int id,
String ownerName)
|
static List |
getAllNonEmptySharesOfTypeByOwner(LocalUser owner,
String applicationId,
DIOEntityManager dioEntityManager)
Gets all shared created by the user owner whose buddies and shared dios are not empty. |
static List |
getAllSharesOfTypeByOwner(LocalUser owner,
String applicationId,
DIOEntityManager dioEntityManager)
Gets all the Shares that are created by the user using a dekoh application with id applicationId. |
String |
getApplicationId()
|
Set |
getBuddies()
Gets the current list of buddies that have been given access to this Share. |
List |
getComments()
|
List |
getComments(int dioId)
Gets comments (Comment threads) made on the given digital object in this share. |
Timestamp |
getCreationTime()
|
int |
getId()
|
String |
getName()
|
int |
getNumberOfViews(DIOEntityManager em)
|
LocalUser |
getOwner()
|
static List |
getRecentBuddyShareVisits(DIOEntityManager em,
String applicationId,
String owner)
|
static List |
getShareByNameOfType(LocalUser owner,
String applicationId,
String shareName,
DIOEntityManager dioEntityManager)
Gets a Shares that this user has created with given name. |
Set |
getSharedDigitalObjects()
|
static List |
getSharesForDigitalObject(DigitalObject dio,
DIOEntityManager em,
String owner)
Gets all the shares the given digitalObject belongs to. |
boolean |
isDisabled()
|
boolean |
isPublic()
|
Comment |
postComment(Buddy buddy,
String comment,
int dioId,
DIOEntityManager em,
String accessPath)
Starts a new Comment Thread with this as the first comment. |
Comment |
postComment(String comment,
int dioId,
DIOEntityManager em,
String accessPath)
Starts a new Comment Thread with this as the first comment. |
void |
recordBuddyVisit(Buddy buddy,
DIOEntityManager em)
|
void |
setBuddies(Set buddies)
|
void |
setComments(List allCommentThreads)
|
void |
setCreationTime(Timestamp creationTime)
|
void |
setDisabled(boolean disabled)
|
void |
setName(String name)
|
void |
setOwner(LocalUser owner)
|
void |
setPublic(boolean aPublic)
|
void |
setSharedDigitalObjects(Set sharedDigitalObjects)
|
void |
shareDigitalObject(DigitalObject digitalObject,
Buddy[] buddies)
Adds given digital object to share and adds buddies to this Share. |
void |
shareDigitalObject(DigitalObject digitalObject,
Set buddies)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FIND_ALL_SHARES_BY_OWNER_OF_TYPE
public static final String FIND_ALL_NOT_EMPTY_SHARES_BY_OWNER_OF_TYPE
public static final String FIND_SHARE_BY_ID_OWNER
public static final String QUERY_VISIT_COUNT
| Constructor Detail |
|---|
protected Share()
public Share(String name,
String applicationId)
| Method Detail |
|---|
public static Share findShareByIdAndOwner(DIOEntityManager em,
int id,
String ownerName)
public static Share findShareByIdAndOwner(DIOEntityManager em,
int id,
LocalUser owner)
NoSuchEntityException - if there is no Share entity by given id created by the passed user
public static int deleteShareByIdAndOwner(DIOEntityManager em,
int id,
LocalUser owner)
em - id - Share Idowner - creator of the share
public boolean isPublic()
public void setPublic(boolean aPublic)
public LocalUser getOwner()
public void setOwner(LocalUser owner)
public Timestamp getCreationTime()
public void setCreationTime(Timestamp creationTime)
public boolean isDisabled()
public void setDisabled(boolean disabled)
public void addBuddyToShare(Buddy buddy)
public void addDigitalObjectToShare(DigitalObject digitalObject)
DigitalObject to this share. All the buddies in this share can now access this
DigitalObject.
digitalObject -
public void shareDigitalObject(DigitalObject digitalObject,
Buddy[] buddies)
share.getBuddies().add(Buddy.getOrCreateBuddyByName("buddy",em));
share.shareDigitalObject(dio);
digitalObject - to be sharedbuddies - people who will have access to this share. cannot be null
NullPointerException - if buddies or digitalObject is NULLDioCollection,
Buddy#getOrCreateBuddyByContactKey(String,dekoh.persistence.DIOEntityManager)
public void shareDigitalObject(DigitalObject digitalObject,
Set buddies)
public List getComments(int dioId)
dioId - id of the digital object that belongs to this share.
public Comment postComment(Buddy buddy,
String comment,
int dioId,
DIOEntityManager em,
String accessPath)
Comment by
calling Comment.replyToThisComment(Buddy,String)
comment - dioId - accessPath -
public Comment postComment(String comment,
int dioId,
DIOEntityManager em,
String accessPath)
Comment by
calling Comment.replyToThisComment(Buddy,String)
comment - dioId - accessPath -
public List getComments()
public void setComments(List allCommentThreads)
public int getId()
public String getName()
public void setName(String name)
public String getApplicationId()
public Set getBuddies()
Share.addBuddyToShare(Buddy) to add a new accessor to this share.
public void setBuddies(Set buddies)
public Set getSharedDigitalObjects()
public void setSharedDigitalObjects(Set sharedDigitalObjects)
public static List getSharesForDigitalObject(DigitalObject dio,
DIOEntityManager em,
String owner)
dio - digitalObjectem - EntityMangerowner - owner
public static List getAllSharesOfTypeByOwner(LocalUser owner,
String applicationId,
DIOEntityManager dioEntityManager)
owner - applicationId - is the contextPath for web applications on DekohdioEntityManager -
public static List getAllNonEmptySharesOfTypeByOwner(LocalUser owner,
String applicationId,
DIOEntityManager dioEntityManager)
owner whose buddies and shared dios are not empty.
owner - applicationId - dioEntityManager -
public static List getShareByNameOfType(LocalUser owner,
String applicationId,
String shareName,
DIOEntityManager dioEntityManager)
owner - applicationId - shareName - dioEntityManager -
NoResultException in excuting the query.
public static List getRecentBuddyShareVisits(DIOEntityManager em,
String applicationId,
String owner)
public int getNumberOfViews(DIOEntityManager em)
public void recordBuddyVisit(Buddy buddy,
DIOEntityManager em)
public void enableShare()
public void disableShare()
|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
© 2009 Pramati Technologies - Dekoh - Portal for Developers