本文整理汇总了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);
}
}
});
}
示例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);
}
});
}
}
示例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);
}
}
});
}