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


Java ContentEvent类代码示例

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


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

示例1: publishReadEvent

import org.alfresco.events.types.ContentEvent; //导入依赖的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

示例2: publishReadEvent

import org.alfresco.events.types.ContentEvent; //导入依赖的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

示例3: publishReadEvent

import org.alfresco.events.types.ContentEvent; //导入依赖的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


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