当前位置: 首页>>代码示例>>Java>>正文


Java ClientType类代码示例

本文整理汇总了Java中org.alfresco.repo.Client.ClientType的典型用法代码示例。如果您正苦于以下问题:Java ClientType类的具体用法?Java ClientType怎么用?Java ClientType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClientType类属于org.alfresco.repo.Client包,在下文中一共展示了ClientType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postFileFolderActivity

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
private void postFileFolderActivity(
            String activityType,
            String siteId,
            String tenantDomain,
            String path,
            NodeRef parentNodeRef,
            FileInfo contentNodeInfo) throws WebDAVServerException
{
    String fileName = contentNodeInfo.getName();
    NodeRef nodeRef = contentNodeInfo.getNodeRef();
    
    try
    {
        poster.postFileFolderActivity(activityType, path, tenantDomain, siteId,
                               parentNodeRef, nodeRef, fileName,
                               appTool, Client.asType(ClientType.webdav),contentNodeInfo);
    }
    catch (AlfrescoRuntimeException are)
    {
        logger.error("Failed to post activity.", are);
        throw new WebDAVServerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:ActivityPosterImpl.java

示例2: postFileFolderUpdated

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void postFileFolderUpdated(boolean isFolder, NodeRef nodeRef)
{
    if(activitiesEnabled && !hiddenAspect.hasHiddenAspect(nodeRef))
    {
        SiteInfo siteInfo = siteService.getSite(nodeRef);
        String siteId = (siteInfo != null ? siteInfo.getShortName() : null);
        if(siteId != null && !siteId.equals(""))
        {
            // post only for nodes within sites
            String fileName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
            
            if (!isFolder)
            {
                FileInfo fileInfo = fileFolderService.getFileInfo(nodeRef);
                poster.postFileFolderActivity(ActivityType.FILE_UPDATED, null, getCurrentTenantDomain(),
                                              siteId, null, nodeRef, fileName, APP_TOOL, Client.asType(ClientType.cmis), fileInfo);
            }
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ActivityPosterImpl.java

示例3: publishReadEvent

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
/**
 * Notifies listeners that a read has taken place.
 *
 * @param nodeRef NodeRef
 * @param name String
 * @param mimeType String
 * @param contentSize long
 * @param encoding String
 * @param range String
 */
protected void publishReadEvent(final NodeRef nodeRef, final String name, final String mimeType, final long contentSize, final String encoding, final String range)
{
    final QName nodeType = nodeRef==null?null:nodeService.getType(nodeRef);

    eventPublisher.publishEvent(new EventPreparator(){
        @Override
        public Event prepareEvent(String user, String networkId, String transactionId)
        {
            if (StringUtils.hasText(range))
            {
                return new ContentReadRangeEvent(user, networkId, transactionId,
                            nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding, range);
            }
            else
            {
                return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId,
                            nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding);
            }
        }
    });


}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:34,代码来源:CMISConnector.java

示例4: publishReadEvent

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
/**
 * Notifies listeners that a read has taken place
 * @param realNodeInfo FileInfo
 * @param mimetype String
 * @param size Long
 * @param contentEncoding String
 * @param range String
 */
protected void publishReadEvent(final FileInfo realNodeInfo, final String mimetype, final Long size, final String contentEncoding, final String range)
{
 
    if (!StringUtils.hasText(range))
    {
        // Its not a range request
        eventPublisher.publishEvent(new EventPreparator()
        {
            @Override
            public Event prepareEvent(String user, String networkId, String transactionId)
            {
                return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId, realNodeInfo.getNodeRef().getId(), null,
                            realNodeInfo.getType().toString(), Client.asType(ClientType.webdav), realNodeInfo.getName(), mimetype,
                            size, contentEncoding);
            }
        });

    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:28,代码来源:WebDAVHelper.java

示例5: publishReadEvent

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
/**
 * Notifies listeners that a read has taken place.
 * 
 * @param nodeRef NodeRef
 * @param name String
 * @param mimeType String
 * @param contentSize long
 * @param encoding String
 * @param range String
 */
protected void publishReadEvent(final NodeRef nodeRef, final String name, final String mimeType, final long contentSize, final String encoding, final String range)
{
    final QName nodeType = nodeRef==null?null:nodeService.getType(nodeRef);
    
    eventPublisher.publishEvent(new EventPreparator(){
        @Override
        public Event prepareEvent(String user, String networkId, String transactionId)
        {
            if (StringUtils.hasText(range))
            {
                return new ContentReadRangeEvent(user, networkId, transactionId,
                            nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding, range); 
            } 
            else 
            {
                return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId,
                            nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding);            
            }
        }
    });
    

}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:34,代码来源:CMISConnector.java

示例6: addFavouriteDocumentOrFolder

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
private PersonFavourite addFavouriteDocumentOrFolder(String userName, Type type, NodeRef nodeRef)
  {
Map<PersonFavouriteKey, PersonFavourite> personFavourites = getFavouriteNodes(userName, type);
PersonFavourite personFavourite = getPersonFavourite(userName, type, nodeRef);
if(personFavourite == null)
{
	Date createdAt = new Date();
	final String name = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
	personFavourite = new PersonFavourite(userName, nodeRef, type, name, createdAt);
	personFavourites.put(personFavourite.getKey(), personFavourite);
	updateFavouriteNodes(userName, type, personFavourites);
	
	QName nodeClass = nodeService.getType(nodeRef);
	final String finalRef = nodeRef.getId();
	final QName nodeType = nodeClass;
	
          eventPublisher.publishEvent(new EventPreparator(){
              @Override
              public Event prepareEvent(String user, String networkId, String transactionId)
              {            
                  return new ActivityEvent("favorite.added", transactionId, networkId, user, finalRef,
                              null, nodeType==null?null:nodeType.toString(),  Client.asType(ClientType.script), null,
                              name, null, 0l, null);
              }
          });
          
       OnAddFavouritePolicy policy = onAddFavouriteDelegate.get(nodeRef, nodeClass);
       policy.onAddFavourite(userName, nodeRef);
}

return personFavourite;
  }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:FavouritesServiceImpl.java

示例7: removeFavouriteNode

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
private boolean removeFavouriteNode(String userName, Type type, NodeRef nodeRef)
  {
boolean exists = false;

Map<PersonFavouriteKey, PersonFavourite> personFavourites = getFavouriteNodes(userName, type);

PersonFavouriteKey personFavouriteKey = new PersonFavouriteKey(userName, null, type, nodeRef);
PersonFavourite personFavourite = personFavourites.remove(personFavouriteKey);
exists = personFavourite != null;
updateFavouriteNodes(userName, type, personFavourites);

QName nodeClass = nodeService.getType(nodeRef);
      final String finalRef = nodeRef.getId();
      final QName nodeType = nodeClass;
      
      eventPublisher.publishEvent(new EventPreparator(){
          @Override
          public Event prepareEvent(String user, String networkId, String transactionId)
          {            
              return new ActivityEvent("favorite.removed", transactionId, networkId, user, finalRef,
                          null, nodeType==null?null:nodeType.toString(),  Client.asType(ClientType.script), null,
                          null, null, 0l, null);
          }
      });
      
      OnRemoveFavouritePolicy policy = onRemoveFavouriteDelegate.get(nodeRef, nodeClass);
      policy.onRemoveFavourite(userName, nodeRef);

  	return exists;
  }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:FavouritesServiceImpl.java

示例8: postFileFolderDeleted

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void postFileFolderDeleted(ActivityInfo activityInfo)
{
    if(activitiesEnabled && activityInfo.getSiteId() != null)
    {
        poster.postFileFolderActivity((activityInfo.isFolder() ? ActivityType.FOLDER_DELETED : ActivityType.FILE_DELETED), activityInfo.getParentPath(), getCurrentTenantDomain(),
                                       activityInfo.getSiteId(), activityInfo.getParentNodeRef(), activityInfo.getNodeRef(), activityInfo.getFileName(), APP_TOOL, Client.asType(ClientType.cmis), null);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:ActivityPosterImpl.java

示例9: postFileFolderAdded

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void postFileFolderAdded(NodeRef nodeRef)
{
    if(activitiesEnabled && !hiddenAspect.hasHiddenAspect(nodeRef))
    {
        SiteInfo siteInfo = siteService.getSite(nodeRef);
        String siteId = (siteInfo != null ? siteInfo.getShortName() : null);
        
        if(siteId != null && !siteId.equals(""))
        {
            // post only for nodes within sites
            NodeRef parentNodeRef = nodeService.getPrimaryParent(nodeRef).getParentRef();

            String path = null;
            boolean isFolder = isFolder(nodeRef);
            String name = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);

            if(isFolder)
            {
                NodeRef documentLibrary = siteService.getContainer(siteId, SiteService.DOCUMENT_LIBRARY);
                path = "/";
                try
                {
                    path = getPathFromNode(documentLibrary, nodeRef);
                }
                catch (FileNotFoundException error)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("No " + SiteService.DOCUMENT_LIBRARY + " container found.");
                    }
                }
            }
            FileInfo fileInfo = fileFolderService.getFileInfo(nodeRef);
            poster.postFileFolderActivity((isFolder ? ActivityType.FOLDER_ADDED : ActivityType.FILE_ADDED), path, getCurrentTenantDomain(),
                                           siteId, parentNodeRef, nodeRef, name, APP_TOOL, Client.asType(ClientType.cmis), fileInfo);
            
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:44,代码来源:ActivityPosterImpl.java

示例10: postActivity

import org.alfresco.repo.Client.ClientType; //导入依赖的package包/类
/**
 * Post a custom activity type
 *
 * @param activityType - required
 * @param siteId - optional, if null will be stored as empty string
 * @param appTool - optional, if null will be stored as empty string
 * @param jsonActivityData - required
 */
public void postActivity(String activityType, String siteId, String appTool, String jsonActivityData)
{
    activityService.postActivity(activityType, siteId, appTool, jsonActivityData, Client.asType(ClientType.webclient));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:Activity.java


注:本文中的org.alfresco.repo.Client.ClientType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。