public abstract class AbstractSiteServiceImpl extends AlfrescoService implements SiteService
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_ROLE
When user wants to join a site, the default role is SiteConsumer.
|
protected android.util.LruCache<String,CacheSiteExtraProperties> |
extraPropertiesCache
extraPropertiesCache is a LRUCache responsible to maintain extra
informations about the site object.
|
CONTENT_CACHE, RENDITION_CACHE, session
SORT_PROPERTY_SHORTNAME, SORT_PROPERTY_TITLE
Constructor and Description |
---|
AbstractSiteServiceImpl(AlfrescoSession repositorySession)
Default constructor for service.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelJoinSiteRequest(JoinSiteRequestImpl joinSiteRequest) |
Site |
cancelRequestToJoinSite(Site site)
Cancels a previous request to join a site made by the current user.
|
void |
clear()
Clear all caches informations used by the service.
|
protected abstract PagingResult<Site> |
computeAllSites(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url,
ListingContext listingContext) |
protected abstract PagingResult<Site> |
computeFavoriteSites(ListingContext listingContext) |
protected PagingResult<Site> |
computeLegacySites(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url,
ListingContext listingContext) |
protected abstract PagingResult<Site> |
computeSites(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url,
ListingContext listingContext) |
List<Site> |
getAllSites() |
PagingResult<Site> |
getAllSites(ListingContext listingContext) |
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder |
getAllSitesUrl(ListingContext listingContext)
Allows to retrieve URL to list all sites.
|
protected abstract String |
getCancelJoinSiteRequestUrl(JoinSiteRequestImpl joinSiteRequest)
Allow to retrieve specific cancel join site url.
|
protected abstract String |
getDocContainerSiteUrl(Site site)
Allow to retrieve specific site document container URL.
|
Folder |
getDocumentLibrary(Site site)
Get the documents container folder for the given site.
|
List<Site> |
getFavoriteSites() |
PagingResult<Site> |
getFavoriteSites(ListingContext listingContext) |
protected abstract List<JoinSiteRequestImpl> |
getJoinSiteRequests() |
protected abstract PagingResult<JoinSiteRequestImpl> |
getJoinSiteRequests(ListingContext listingContext) |
protected abstract String |
getLeaveSiteUrl(Site site)
Retrieve specific leave site url.
|
List<Site> |
getPendingSites()
Returns a list of join site requests from the current user that have yet
to be actioned.
|
PagingResult<Site> |
getPendingSites(ListingContext listingContext)
Returns a list of join site requests from the current user that have yet
to be actioned.
|
Site |
getSite(String siteIdentifier) |
List<Site> |
getSites() |
PagingResult<Site> |
getSites(ListingContext listingContext) |
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder |
getSiteUrl(String siteIdentifier)
Allows to retrieve specific site url.
|
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder |
getUserSitesUrl(String personIdentifier,
ListingContext listingContext)
Allows to retrieve URL to list sites for a specific user.
|
Site |
leaveSite(Site site)
Removes the current user from the given site.
|
protected abstract String |
parseContainer(String link) |
protected abstract Site |
parseData(String siteIdentifier,
Map<String,Object> json)
Responsible to create a Site object based on json response from the
server.
|
Site |
refresh(Site site)
Create a new site with the refreshed value from the cacheExtraProperties.
|
protected void |
retrieveExtraProperties(List<String> favoriteSites,
List<String> userSites,
List<JoinSiteRequestImpl> request)
Responsible to create the extra properties cache.
|
protected abstract void |
retrieveExtraProperties(String personIdentifier)
Retrieve sites extra properties.
|
List<Site> |
search(String keyword) |
PagingResult<Site> |
search(String keyword,
ListingContext listingContext) |
protected void |
updateExtraPropertyCache(String siteIdentifier,
boolean isPendingMember,
boolean isMember,
boolean isFavorite)
Update the defined entry cache.
|
protected void |
validateUpdateSite(Site updatedSite,
int errorCode) |
convertException, convertNode, convertNode, convertStatusCode, delete, describeContents, getHttpInvoker, getSessionHttp, isCloudSession, isListNull, isMapNull, isObjectNull, isOnPremiseSession, isStringNull, post, put, read, saveContentStream, writeToParcel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addFavoriteSite, getAllMembers, getAllMembers, isMember, joinSite, removeFavoriteSite, searchMembers, searchMembers
protected static final String DEFAULT_ROLE
protected android.util.LruCache<String,CacheSiteExtraProperties> extraPropertiesCache
public AbstractSiteServiceImpl(AlfrescoSession repositorySession)
AbstractServiceRegistry
.repositorySession
- public List<Site> getAllSites()
getAllSites
in interface SiteService
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder getAllSitesUrl(ListingContext listingContext)
listingContext
- : determine characteristics of the result (paging)public PagingResult<Site> getAllSites(ListingContext listingContext)
getAllSites
in interface SiteService
listingContext
- : Listing context that define the behavior of
paging results
ListingContext
public List<Site> getSites()
getSites
in interface SiteService
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder getUserSitesUrl(String personIdentifier, ListingContext listingContext)
personIdentifier
- : unique identifier of the userlistingContext
- : determine characteristics of the result (paging)public PagingResult<Site> getSites(ListingContext listingContext)
getSites
in interface SiteService
listingContext
- : Listing context that define the behaviour of
paging results
ListingContext
public List<Site> getFavoriteSites()
getFavoriteSites
in interface SiteService
public PagingResult<Site> getFavoriteSites(ListingContext listingContext)
getFavoriteSites
in interface SiteService
listingContext
- : Listing context that define the behaviour of
paging results
ListingContext
public List<Site> search(String keyword)
search
in interface SiteService
public PagingResult<Site> search(String keyword, ListingContext listingContext)
search
in interface SiteService
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder getSiteUrl(String siteIdentifier)
siteIdentifier
- : Unique identifier of the site.protected abstract Site parseData(String siteIdentifier, Map<String,Object> json)
siteIdentifier
- json
- : response from the server.public Site getSite(String siteIdentifier)
getSite
in interface SiteService
siteIdentifier
- : Unique identifier name of the site.protected abstract String getDocContainerSiteUrl(Site site)
site
- : Sitepublic Folder getDocumentLibrary(Site site)
getDocumentLibrary
in interface SiteService
site
- : Unique identifier name of the site.protected abstract String getCancelJoinSiteRequestUrl(JoinSiteRequestImpl joinSiteRequest)
public void cancelJoinSiteRequest(JoinSiteRequestImpl joinSiteRequest)
public Site cancelRequestToJoinSite(Site site)
SiteService
cancelRequestToJoinSite
in interface SiteService
site
- : site objectprotected abstract String getLeaveSiteUrl(Site site)
site
- : Sitepublic Site leaveSite(Site site)
leaveSite
in interface SiteService
site
- : site objectprotected abstract List<JoinSiteRequestImpl> getJoinSiteRequests()
protected abstract PagingResult<JoinSiteRequestImpl> getJoinSiteRequests(ListingContext listingContext)
public List<Site> getPendingSites()
getPendingSites
in interface SiteService
public PagingResult<Site> getPendingSites(ListingContext listingContext)
getPendingSites
in interface SiteService
protected void validateUpdateSite(Site updatedSite, int errorCode)
protected void updateExtraPropertyCache(String siteIdentifier, boolean isPendingMember, boolean isMember, boolean isFavorite)
siteIdentifier
- : Unique identifier of the siteisPendingMember
- : has a pending request to join the siteisMember
- : member of the siteisFavorite
- : member has favorite the sitepublic void clear()
clear
in interface Service
clear
in class AlfrescoService
protected abstract void retrieveExtraProperties(String personIdentifier)
personIdentifier
- protected void retrieveExtraProperties(List<String> favoriteSites, List<String> userSites, List<JoinSiteRequestImpl> request)
favoriteSites
- : List of user favorite site Identifier.userSites
- : List of user site Identifier.request
- : List of user request.public Site refresh(Site site)
site
- : old site to refresh.protected abstract PagingResult<Site> computeFavoriteSites(ListingContext listingContext)
protected abstract PagingResult<Site> computeSites(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url, ListingContext listingContext)
protected abstract PagingResult<Site> computeAllSites(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url, ListingContext listingContext)
protected PagingResult<Site> computeLegacySites(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url, ListingContext listingContext)
Copyright © 2012-2018 Alfresco Software. All Rights Reserved.