本文整理汇总了Java中org.alfresco.service.cmr.activities.ActivityPoster类的典型用法代码示例。如果您正苦于以下问题:Java ActivityPoster类的具体用法?Java ActivityPoster怎么用?Java ActivityPoster使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActivityPoster类属于org.alfresco.service.cmr.activities包,在下文中一共展示了ActivityPoster类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: determineActivityType
import org.alfresco.service.cmr.activities.ActivityPoster; //导入依赖的package包/类
protected static String determineActivityType(Activity_Type activity_type, boolean isFolder)
{
switch (activity_type)
{
case DELETED:
return isFolder ? ActivityType.FOLDER_DELETED:ActivityType.FILE_DELETED;
case ADDED:
return isFolder ? ActivityType.FOLDER_ADDED:ActivityType.FILE_ADDED;
case UPDATED:
if (!isFolder) return ActivityType.FILE_UPDATED;
break;
case DOWNLOADED:
if (!isFolder) return ActivityPoster.DOWNLOADED;
break;
}
return null;
}
示例2: setPoster
import org.alfresco.service.cmr.activities.ActivityPoster; //导入依赖的package包/类
public void setPoster(ActivityPoster poster)
{
this.poster = poster;
}
示例3: setPoster
import org.alfresco.service.cmr.activities.ActivityPoster; //导入依赖的package包/类
/**
* @param poster ActivityPoster
*/
public void setPoster(ActivityPoster poster)
{
this.poster = poster;
}
示例4: init
import org.alfresco.service.cmr.activities.ActivityPoster; //导入依赖的package包/类
/**
* Initialize the servlet
*
* @param config ServletConfig
* @exception ServletException
*/
@SuppressWarnings("unchecked")
public void init(ServletConfig config) throws ServletException
{
super.init(config);
// Get service registry
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
// If no context has been initialised, exit silently so config changes can be made
if (context == null)
{
return;
}
// Get global configuration properties
WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
initParams = (WebDAVInitParameters) wc.getBean(BEAN_INIT_PARAMS);
// Render this servlet permanently unavailable if its enablement property is not set
if (!initParams.getEnabled())
{
logger.info("Marking servlet WebDAV as unavailable!");
return;
}
// Get root paths
String storeValue = initParams.getStoreName();
rootPath = initParams.getRootPath();
// Get beans
serviceRegistry = (ServiceRegistry)context.getBean(ServiceRegistry.SERVICE_REGISTRY);
transactionService = serviceRegistry.getTransactionService();
tenantService = (TenantService) context.getBean("tenantService");
nodeService = (NodeService) context.getBean("NodeService");
searchService = (SearchService) context.getBean("SearchService");
namespaceService = (NamespaceService) context.getBean("NamespaceService");
ActivityPoster poster = (ActivityPoster) context.getBean("activitiesPoster");
singletonCache = (SimpleCache<String, NodeRef>)context.getBean("immutableSingletonCache");
// Collaborator used by WebDAV methods to create activity posts.
activityPoster = new ActivityPosterImpl("WebDAV", poster);
// Create the WebDAV helper
m_davHelper = (WebDAVHelper) context.getBean("webDAVHelper");
// Initialize the root node
initializeRootNode(storeValue, rootPath, context, nodeService, searchService, namespaceService, tenantService, transactionService);
// Create the WebDAV methods table
m_davMethods = new Hashtable<String, Class<? extends WebDAVMethod>>();
m_davMethods.put(WebDAV.METHOD_PROPFIND, PropFindMethod.class);
m_davMethods.put(WebDAV.METHOD_PROPPATCH, PropPatchMethod.class);
m_davMethods.put(WebDAV.METHOD_COPY, CopyMethod.class);
m_davMethods.put(WebDAV.METHOD_DELETE, DeleteMethod.class);
m_davMethods.put(WebDAV.METHOD_GET, GetMethod.class);
m_davMethods.put(WebDAV.METHOD_HEAD, HeadMethod.class);
m_davMethods.put(WebDAV.METHOD_LOCK, LockMethod.class);
m_davMethods.put(WebDAV.METHOD_MKCOL, MkcolMethod.class);
m_davMethods.put(WebDAV.METHOD_MOVE, MoveMethod.class);
m_davMethods.put(WebDAV.METHOD_OPTIONS, OptionsMethod.class);
m_davMethods.put(WebDAV.METHOD_POST, PostMethod.class);
m_davMethods.put(WebDAV.METHOD_PUT, PutMethod.class);
m_davMethods.put(WebDAV.METHOD_UNLOCK, UnlockMethod.class);
}
示例5: getPoster
import org.alfresco.service.cmr.activities.ActivityPoster; //导入依赖的package包/类
protected ActivityPoster getPoster()
{
return poster;
}
示例6: testCreateUpdate
import org.alfresco.service.cmr.activities.ActivityPoster; //导入依赖的package包/类
/**
* Tests the main activites, added, updated, deleted, downloaded
*/
@Test
public void testCreateUpdate() throws Exception
{
setRequestContext(user1);
List<Activity> activities = getMyActivities();
int beforeCount = activities.size();
String folder1 = "folder" + System.currentTimeMillis() + "_1";
Folder createdFolder = createFolder(tDocLibNodeId, folder1, null);
assertNotNull(createdFolder);
String f1Id = createdFolder.getId();
String docName = "d1.txt";
Document documentResp = createEmptyTextFile(f1Id, docName);
//Update the file
Document dUpdate = new Document();
dUpdate.setName("d1b.txt");
put(URL_NODES, documentResp.getId(), toJsonAsStringNonNull(dUpdate), null, 200);
//Now download it
HttpResponse response = getSingle(NodesEntityResource.class, documentResp.getId()+"/content", null, 200);
String textContent = response.getResponse();
assertNotNull(textContent);
deleteNode(documentResp.getId());
deleteNode(createdFolder.getId());
activities = getMyActivities();
assertEquals(beforeCount+6, activities.size());
Activity act = matchActivity(activities, ActivityType.FOLDER_ADDED, user1, tSiteId, tDocLibNodeId, folder1);
assertNotNull(act);
act = matchActivity(activities, ActivityType.FILE_ADDED, user1, tSiteId, createdFolder.getId(), docName);
assertNotNull(act);
act = matchActivity(activities, ActivityType.FILE_UPDATED, user1, tSiteId, createdFolder.getId(), dUpdate.getName());
assertNotNull(act);
act = matchActivity(activities, ActivityType.FOLDER_DELETED, user1, tSiteId, tDocLibNodeId, folder1);
assertNotNull(act);
act = matchActivity(activities, ActivityType.FILE_DELETED, user1, tSiteId, createdFolder.getId(), dUpdate.getName());
assertNotNull(act);
act = matchActivity(activities, ActivityPoster.DOWNLOADED, user1, tSiteId, createdFolder.getId(), dUpdate.getName());
assertNotNull(act);
}
示例7: ActivityPosterImpl
import org.alfresco.service.cmr.activities.ActivityPoster; //导入依赖的package包/类
/**
* Constructor
*
* @param appTool String
* @param poster ActivityPoster
*/
public ActivityPosterImpl(String appTool, ActivityPoster poster)
{
this.appTool = appTool;
this.poster = poster;
}