public class UGCRepositoryImpl<T extends UGC> extends SocialJongoRepository implements UGCRepository
ugcFactory| Constructor and Description |
|---|
UGCRepositoryImpl()
Creates a instance of a Jongo Repository.
|
| Modifier and Type | Method and Description |
|---|---|
long |
countByTargetId(String contextId,
String threadId,
int levels) |
long |
countChildrenOf(String contextId,
String ugcId) |
long |
countFindByModerationStatus(SocialUgc.ModerationStatus status,
String targetId,
String contextId) |
void |
deleteAttribute(String ugcId,
String contextId,
String[] attributesName)
Deletes a attribute Has to be full "dot notation" mode
|
void |
deleteUgc(String ugcId,
String contextId)
Deletes The Given UGC and All its children.
|
Iterable<UGC> |
findAll() |
UGC |
findById(String id) |
Iterable<T> |
findByModerationStatus(SocialUgc.ModerationStatus status,
String targetId,
String contextId,
int start,
int limit,
List sortOrder) |
Iterable<T> |
findByTargetId(String targetId,
String contextId)
Finds all UGC's of a contextId that belongs to the given target-id.
|
Iterable<T> |
findByTargetId(String targetId,
String contextId,
int start,
int limit,
List sortOrder,
int upToLevel) |
Iterable<T> |
findByUserQuery(String contextId,
String query,
String sort,
int start,
int limit)
Finds Ugcs by the given user query.
|
Iterable<T> |
findChildren(String ugcId,
String targetId,
String contextId,
int start,
int limit,
List sortOrder,
int upToLevel)
Finds all the children of a given ugc.
|
List<T> |
findChildrenOf(String ugcId,
int childrenCount,
String contextId)
Finds all the ugc and all its children.
|
T |
findUGC(String contextId,
String ugcId)
Find's a ugc with the given id and contextId.
|
void |
setAttributes(String ugcId,
String contextId,
Map attributes)
Adds the given attributes to the ugc.
|
protected List<T> |
toUgcList(List<BaseTreeUgc> as) |
init, setUgcFactorycheckCommandResult, count, count, count, createSortQuery, deleteFile, deleteFile, find, find, findByStringId, findOne, findOne, getCollection, getFileInfo, getFileInfo, getQueryFor, insert, insert, readFile, readFile, remove, remove, removeById, returnList, returnSimple, save, save, saveFile, saveFile, setJongo, setQueries, update, update, update, update, updateFile, updateFile, updateFile, validateObject, validateObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcount, count, count, deleteFile, deleteFile, find, find, findByStringId, findOne, findOne, getFileInfo, getFileInfo, insert, insert, readFile, readFile, remove, remove, removeById, save, save, saveFile, saveFile, update, update, update, update, updateFile, updateFile, updateFilepublic Iterable<UGC> findAll() throws org.craftercms.commons.mongo.MongoDataException
findAll in interface org.craftercms.commons.mongo.CrudRepositoryfindAll in class org.craftercms.commons.mongo.AbstractJongoRepositoryorg.craftercms.commons.mongo.MongoDataExceptionpublic List<T> findChildrenOf(String ugcId, int childrenCount, String contextId) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositoryfindChildrenOf in interface UGCRepositoryugcId - Id of the ugc to find and its children.childrenCount - How many Children Levels.contextId - Context ID of the UGCs.org.craftercms.commons.mongo.MongoDataExceptionpublic UGC findById(String id) throws org.craftercms.commons.mongo.MongoDataException
findById in interface org.craftercms.commons.mongo.CrudRepositoryfindById in class org.craftercms.commons.mongo.AbstractJongoRepositoryorg.craftercms.commons.mongo.MongoDataExceptionpublic Iterable<T> findByTargetId(String targetId, String contextId) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositoryfindByTargetId in interface UGCRepositorytargetId - Target Id which the ugs belong.contextId - Context ID of the UGCs.org.craftercms.commons.mongo.MongoDataExceptionpublic void deleteAttribute(String ugcId, String contextId, String[] attributesName) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositorydeleteAttribute in interface UGCRepositoryugcId - Id of the ugc to remove the attribute.contextId - Context ID of the UGCs.attributesName - Attributes name(Full dot notation) to unset/deleteorg.craftercms.commons.mongo.MongoDataExceptionpublic T findUGC(String contextId, String ugcId) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositoryfindUGC in interface UGCRepositorycontextId - Context ID of the UGCs.ugcId - Id of the ugcorg.craftercms.commons.mongo.MongoDataExceptionpublic void setAttributes(String ugcId, String contextId, Map attributes) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositorysetAttributes in interface UGCRepositoryugcId - Id of the ugc to add the attributes.contextId - Context ID of the UGCs.attributes - Attributes to add/removeWatcher to the UGC.org.craftercms.commons.mongo.MongoDataExceptionpublic void deleteUgc(String ugcId, String contextId) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositorydeleteUgc in interface UGCRepositoryugcId - Id of the ugccontextId - Context ID of the UGCs.org.craftercms.commons.mongo.MongoDataExceptionpublic Iterable<T> findByUserQuery(String contextId, String query, String sort, int start, int limit) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositoryfindByUserQuery in interface UGCRepositorycontextId - Context ID of the UGCs.query - Query to execute.sort - Sort query If null or empty it will be ignorestart - Where to startlimit - How many resultsorg.craftercms.commons.mongo.MongoDataExceptionpublic Iterable<T> findChildren(String ugcId, String targetId, String contextId, int start, int limit, List sortOrder, int upToLevel) throws org.craftercms.commons.mongo.MongoDataException
UGCRepositoryfindChildren in interface UGCRepositoryugcId - Id of the ugc to find and its children.targetId - Target Id which the ugs belong.contextId - Context ID of the UGCs.start - where to start.limit - How many resultsupToLevel - how many sub-children levels to lookup.org.craftercms.commons.mongo.MongoDataExceptionpublic Iterable<T> findByTargetId(String targetId, String contextId, int start, int limit, List sortOrder, int upToLevel) throws org.craftercms.commons.mongo.MongoDataException
findByTargetId in interface UGCRepositoryorg.craftercms.commons.mongo.MongoDataExceptionpublic long countByTargetId(String contextId, String threadId, int levels) throws org.craftercms.commons.mongo.MongoDataException
countByTargetId in interface UGCRepositoryorg.craftercms.commons.mongo.MongoDataExceptionpublic long countChildrenOf(String contextId, String ugcId) throws org.craftercms.commons.mongo.MongoDataException
countChildrenOf in interface UGCRepositoryorg.craftercms.commons.mongo.MongoDataExceptionpublic Iterable<T> findByModerationStatus(SocialUgc.ModerationStatus status, String targetId, String contextId, int start, int limit, List sortOrder) throws org.craftercms.commons.mongo.MongoDataException
findByModerationStatus in interface UGCRepositoryorg.craftercms.commons.mongo.MongoDataExceptionpublic long countFindByModerationStatus(SocialUgc.ModerationStatus status, String targetId, String contextId) throws org.craftercms.commons.mongo.MongoDataException
countFindByModerationStatus in interface UGCRepositoryorg.craftercms.commons.mongo.MongoDataExceptionprotected List<T> toUgcList(List<BaseTreeUgc> as)
Copyright © 2014 CrafterCMS. All Rights Reserved.