Class FeedTaskProcessor
- java.lang.Object
-
- org.alfresco.repo.activities.feed.FeedTaskProcessor
-
- Direct Known Subclasses:
LocalFeedTaskProcessor
public abstract class FeedTaskProcessor extends Object
Responsible for processing the individual task
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFeedTaskProcessor.TemplateWebScriptLoader
-
Field Summary
Fields Modifier and Type Field Description static StringFEED_FORMAT_ATOMENTRYstatic StringFEED_FORMAT_HTMLstatic StringFEED_FORMAT_JSONstatic StringFEED_FORMAT_RSSstatic StringFEED_FORMAT_TEXTstatic StringFEED_FORMAT_XML
-
Constructor Summary
Constructors Constructor Description FeedTaskProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanacceptActivity(ActivityPostEntity activityPost, List<FeedControlEntity> feedControls)protected voidaddMissingFormats(String activityType, List<String> fmTemplates, List<String> templatesToAdd)protected StringcallWebScript(String urlString, String ticket)protected abstract booleancanRead(RepoCtx ctx, String connectedUser, Map<String,Object> model)protected abstract booleancanReadSite(RepoCtx ctx, String siteIdIn, String connectedUser, String tenantDomain)abstract voidcommitTransaction()abstract voidendTransaction()protected Map<String,List<String>>getActivityTemplates(List<String> allTemplateNames)protected Map<String,List<String>>getActivityTypeTemplates(String repoEndPoint, String ticket, String subPath)protected StringgetBaseActivityType(String activityType)protected List<FeedControlEntity>getFeedControls(String connectedUser)protected abstract Set<String>getFollowers(String userId, String tenantDomain)protected freemarker.template.ConfigurationgetFreemarkerConfiguration(RepoCtx ctx)protected Set<String>getSiteMembers(RepoCtx ctx, String siteId, String tenantDomain)protected StringgetTemplateSubPath(String activityType)protected StringgetTenantDomain(String name)protected StringgetTenantName(String name, String tenantDomain)abstract longinsertFeedEntry(ActivityFeedEntity feed)voidprocess(int jobTaskNode, long minSeq, long maxSeq, RepoCtx ctx)protected StringprocessFreemarker(Map<String,freemarker.template.Template> templateCache, String fmTemplate, freemarker.template.Configuration cfg, Map<String,Object> model)abstract voidrollbackTransaction()abstract List<ActivityPostEntity>selectPosts(ActivityPostEntity selector)abstract List<FeedControlEntity>selectUserFeedControls(String userId)voidsetUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)abstract voidstartTransaction()abstract intupdatePostStatus(long id, ActivityPostEntity.STATUS status)
-
-
-
Field Detail
-
FEED_FORMAT_JSON
public static final String FEED_FORMAT_JSON
- See Also:
- Constant Field Values
-
FEED_FORMAT_ATOMENTRY
public static final String FEED_FORMAT_ATOMENTRY
- See Also:
- Constant Field Values
-
FEED_FORMAT_HTML
public static final String FEED_FORMAT_HTML
- See Also:
- Constant Field Values
-
FEED_FORMAT_RSS
public static final String FEED_FORMAT_RSS
- See Also:
- Constant Field Values
-
FEED_FORMAT_TEXT
public static final String FEED_FORMAT_TEXT
- See Also:
- Constant Field Values
-
FEED_FORMAT_XML
public static final String FEED_FORMAT_XML
- See Also:
- Constant Field Values
-
-
Method Detail
-
setUserNamesAreCaseSensitive
public void setUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)
-
process
public void process(int jobTaskNode, long minSeq, long maxSeq, RepoCtx ctx) throws Exception- Throws:
Exception
-
startTransaction
public abstract void startTransaction() throws SQLException- Throws:
SQLException
-
commitTransaction
public abstract void commitTransaction() throws SQLException- Throws:
SQLException
-
rollbackTransaction
public abstract void rollbackTransaction() throws SQLException- Throws:
SQLException
-
endTransaction
public abstract void endTransaction() throws SQLException- Throws:
SQLException
-
selectPosts
public abstract List<ActivityPostEntity> selectPosts(ActivityPostEntity selector) throws SQLException
- Throws:
SQLException
-
selectUserFeedControls
public abstract List<FeedControlEntity> selectUserFeedControls(String userId) throws SQLException
- Throws:
SQLException
-
insertFeedEntry
public abstract long insertFeedEntry(ActivityFeedEntity feed) throws SQLException
- Throws:
SQLException
-
updatePostStatus
public abstract int updatePostStatus(long id, ActivityPostEntity.STATUS status) throws SQLException- Throws:
SQLException
-
callWebScript
protected String callWebScript(String urlString, String ticket) throws MalformedURLException, URISyntaxException, IOException
-
getSiteMembers
protected Set<String> getSiteMembers(RepoCtx ctx, String siteId, String tenantDomain) throws Exception
- Throws:
Exception
-
getFollowers
protected abstract Set<String> getFollowers(String userId, String tenantDomain) throws Exception
- Throws:
Exception
-
canReadSite
protected abstract boolean canReadSite(RepoCtx ctx, String siteIdIn, String connectedUser, String tenantDomain) throws Exception
- Throws:
Exception
-
canRead
protected abstract boolean canRead(RepoCtx ctx, String connectedUser, Map<String,Object> model) throws Exception
- Throws:
Exception
-
getActivityTypeTemplates
protected Map<String,List<String>> getActivityTypeTemplates(String repoEndPoint, String ticket, String subPath) throws Exception
- Throws:
Exception
-
getActivityTemplates
protected Map<String,List<String>> getActivityTemplates(List<String> allTemplateNames)
-
getFreemarkerConfiguration
protected freemarker.template.Configuration getFreemarkerConfiguration(RepoCtx ctx)
-
processFreemarker
protected String processFreemarker(Map<String,freemarker.template.Template> templateCache, String fmTemplate, freemarker.template.Configuration cfg, Map<String,Object> model) throws IOException, freemarker.template.TemplateException, Exception
- Throws:
IOExceptionfreemarker.template.TemplateExceptionException
-
getFeedControls
protected List<FeedControlEntity> getFeedControls(String connectedUser) throws SQLException
- Throws:
SQLException
-
acceptActivity
protected boolean acceptActivity(ActivityPostEntity activityPost, List<FeedControlEntity> feedControls)
-
addMissingFormats
protected void addMissingFormats(String activityType, List<String> fmTemplates, List<String> templatesToAdd)
-
-