本文整理汇总了Java中org.alfresco.repo.lock.LockUtils类的典型用法代码示例。如果您正苦于以下问题:Java LockUtils类的具体用法?Java LockUtils怎么用?Java LockUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LockUtils类属于org.alfresco.repo.lock包,在下文中一共展示了LockUtils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getLockState
点赞 3
import org.alfresco.repo.lock.LockUtils; //导入依赖的package包/类
@Extend(traitAPI=LockableAspectInterceptorTrait.class,extensionAPI=LockableAspectInterceptorExtension.class)
private LockState getLockState(NodeRef nodeRef)
{
LockState lockState = lockStore.get(nodeRef);
// Disregard in-memory lock if expired
if (lockState != null)
{
String lockOwner = lockState.getOwner();
Date expiryDate = lockState.getExpires();
LockStatus status = LockUtils.lockStatus(lockOwner, lockOwner, expiryDate);
if (status.equals(LockStatus.LOCK_EXPIRED))
{
lockState = null;
}
}
return lockState;
}
开发者ID:Alfresco,
项目名称:alfresco-repository,
代码行数:18,
代码来源:LockableAspectInterceptor.java
示例2: onSetNodeType
点赞 2
import org.alfresco.repo.lock.LockUtils; //导入依赖的package包/类
/**
* On set node type behaviour
*
* @param nodeRef node reference
* @param oldType old type
* @param newType new type
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@Behaviour
(
type="cm:versionable",
kind=BehaviourKind.CLASS,
notificationFrequency=NotificationFrequency.TRANSACTION_COMMIT
)
public void onSetNodeType(NodeRef nodeRef, QName oldType, QName newType)
{
if (isAutoVersionOnTypeChange &&
nodeService.exists(nodeRef) &&
!LockUtils.isLockedAndReadOnly(nodeRef, lockService) &&
nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE) &&
!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY))
{
Map<NodeRef, NodeRef> versionedNodeRefs = (Map)alfrescoTransactionSupport.getResource(KEY_VERSIONED_NODEREFS);
if (versionedNodeRefs == null || !versionedNodeRefs.containsKey(nodeRef))
{
// Determine whether the node is auto versionable (for content updates) or not
boolean autoVersion = false;
Boolean value = (Boolean)nodeService.getProperty(nodeRef, ContentModel.PROP_AUTO_VERSION);
if (value != null)
{
// If the value is not null then
autoVersion = value.booleanValue();
}
// NOTE: auto version on type change is a global setting, if thins extension was moved into the
// core then cm:versionable could be extended with a property consistent with the current
// implementation
if (autoVersion)
{
// Create the auto-version
Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(1);
versionProperties.put(Version.PROP_DESCRIPTION, I18NUtil.getMessage(MSG_AUTO_VERSION));
createVersionImpl(nodeRef, versionProperties);
}
}
}
}
开发者ID:Alfresco,
项目名称:records-management-old,
代码行数:51,
代码来源:ExtendedVersionableAspect.java
示例3: isLockedAndReadOnly
点赞 1
import org.alfresco.repo.lock.LockUtils; //导入依赖的package包/类
/**
* Indicates if the node is unlocked or the current user has a WRITE_LOCK<p>
*
* @see LockService#isLockedAndReadOnly(NodeRef)
*
* @param nodeRef the node reference
*/
public boolean isLockedAndReadOnly(final NodeRef nodeRef)
{
return LockUtils.isLockedAndReadOnly(nodeRef, m_serviceRegistry.getLockService());
}
开发者ID:to2y,
项目名称:AlfrescoOnlineEditWebDAV,
代码行数:12,
代码来源:WebDAVHelper.java