• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Holder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setContentStream

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * Overridden to capture content upload for publishing to analytics service.
 */
@Override
public void setContentStream(String repositoryId, Holder<String> objectId,
            Boolean overwriteFlag, Holder<String> changeToken, ContentStream contentStream,
            ExtensionsData extension)
{
    FileFilterMode.setClient(Client.cmis);
    try
    {
        super.setContentStream(repositoryId, objectId, overwriteFlag, changeToken, contentStream, extension);
    }
    finally
    {
        FileFilterMode.clearClient();
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:19,代码来源:PublicApiAlfrescoCmisService.java


示例2: moveObject

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * See CMIS 1.0 section 2.2.4.13 moveObject
 */
public ObjectData moveObject(Holder<String> objectId, String targetFolderId,
                             ObjectInfoHandler objectInfos, boolean requiresObjectInfo) {

    if(log.isTraceEnabled()) {
	    log.trace("<<<<<<<< Moving object from " + objectId.getValue() + " to "
            + targetFolderId);
    }

    if (!CommonUtil.hasObjectId(objectId)) {
        throw new CmisInvalidArgumentException("Id is not valid!");
    }

    // get the node and parent
    RegistryObject gregNode = getGregNode(objectId.getValue());
    RegistryFolder parent = getGregNode(targetFolderId).asFolder();
    gregNode = gregNode.move(parent);
    objectId.setValue(gregNode.getId());
    return gregNode.compileObjectType(null, false, objectInfos, requiresObjectInfo);
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:23,代码来源:CMISRepository.java


示例3: updateProperties

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * See CMIS 1.0 section 2.2.4.12 updateProperties
 */
public ObjectData updateProperties(Holder<String> objectId, Properties properties,
                                   ObjectInfoHandler objectInfos, boolean objectInfoRequired) {

    if(log.isTraceEnabled()){
	    log.trace("<<<<<<< updateProperties for object id: " + objectId.getValue());
    }

    if (objectId == null) {
        throw new CmisInvalidArgumentException("Id is not valid!");
    }

    // get the node
    RegistryObject gregNode = getGregNode(objectId.getValue());
    String id = gregNode.updateProperties(properties).getId();
    objectId.setValue(id);
    return gregNode.compileObjectType(null, false, objectInfos, objectInfoRequired);
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:21,代码来源:CMISRepository.java


示例4: checkOut

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * See CMIS 1.0 section 2.2.7.1 checkOut
 */
public void checkOut(Holder<String> objectId, Holder<Boolean> contentCopied) {

    if(log.isTraceEnabled()) {
        log.trace("<<<<<<<<< checkout for object id " + objectId.getValue());
    }
    // check id
    if (objectId == null || objectId.getValue() == null) {
        throw new CmisInvalidArgumentException("Object Id must be set.");
    }

    // get the node
    RegistryObject gregNode = getGregNode(objectId.getValue());
    if (!gregNode.isVersionable()) {
        throw new CmisUpdateConflictException("Not a version: " + gregNode);
    }

    // checkout
    RegistryPrivateWorkingCopy pwc = gregNode.asVersion().checkout();
    objectId.setValue(pwc.getId());
    if (contentCopied != null) {
        contentCopied.setValue(true);
    }
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:27,代码来源:CMISRepository.java


示例5: updateProperties

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
@Override
public void updateProperties(
        String repositoryId, Holder<String> objectId, Holder<String> changeToken,
        final Properties properties, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    final CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object");

    if (info.isVariant(CMISObjectVariant.ASSOC))
    {
        throw new CmisInvalidArgumentException("Relationship properties cannot be updated!");
    }
    else
    {
        if (info.isVariant(CMISObjectVariant.VERSION))
        {
            throw new CmisInvalidArgumentException("Document is not the latest version!");
        }

        final NodeRef nodeRef = info.getNodeRef();

        connector.setProperties(nodeRef, info.getType(), properties, new String[0]);
        
        objectId.setValue(connector.createObjectId(nodeRef));

    	boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
        if (isObjectInfoRequired)
        {
            getObjectInfo(repositoryId, objectId.getValue(), "*", IncludeRelationships.NONE);
        }

        connector.getActivityPoster().postFileFolderUpdated(info.isFolder(), nodeRef);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:36,代码来源:AlfrescoCmisServiceImpl.java


示例6: checkOut

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
@Override
public void checkOut(
        String repositoryId, final Holder<String> objectId, ExtensionsData extension,
        final Holder<Boolean> contentCopied)
{
    checkRepositoryId(repositoryId);

    CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object");

    // Check for current version
    if (info.isVariant(CMISObjectVariant.CURRENT_VERSION))
    {
        // Good
    }
    else if (info.isVariant(CMISObjectVariant.VERSION))
    {
        throw new CmisInvalidArgumentException("Can't check out an old version of a document");
    }
    else {   
        throw new CmisInvalidArgumentException("Only documents can be checked out! Object was a " + info.getObjectVariant().toString());
    }

    // get object
    final NodeRef nodeRef = info.getNodeRef();

    if (!((DocumentTypeDefinition) info.getType().getTypeDefinition(false)).isVersionable())
    {
        throw new CmisConstraintException("Document is not versionable!");
    }
    
    // check out
    NodeRef pwcNodeRef = connector.getCheckOutCheckInService().checkout(nodeRef);
    CMISNodeInfo pwcNodeInfo = createNodeInfo(pwcNodeRef);
    objectId.setValue(pwcNodeInfo.getObjectId());

    if (contentCopied != null)
    {
        contentCopied.setValue(connector.getFileFolderService().getReader(pwcNodeRef) != null);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:AlfrescoCmisServiceImpl.java


示例7: getContentChanges

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
@Override
public ObjectList getContentChanges(
        String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
        String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    return connector.getContentChanges(changeLogToken, maxItems);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:AlfrescoCmisServiceImpl.java


示例8: setProperiesToObject

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
private void setProperiesToObject(CmisService cmisService, String repositoryId, String objectIdStr, String propertyStr, BigInteger bigIntValue) throws CmisConstraintException{
    Properties properties = cmisService.getProperties(repositoryId, objectIdStr, null, null);
    PropertyIntegerImpl pd = (PropertyIntegerImpl)properties.getProperties().get(propertyStr);
    pd.setValue(bigIntValue);
    
    Collection<PropertyData<?>> propsList = new ArrayList<PropertyData<?>>();
    propsList.add(pd);
    
    Properties newProps = new PropertiesImpl(propsList);
    
    cmisService.updateProperties(repositoryId, new Holder<String>(objectIdStr), null, newProps, null);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:CMISTest.java


示例9: testGetContentChanges

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
public void testGetContentChanges()
{
    // create folder with file
    String folderName = "testfolder" + GUID.generate();
    String docName = "testdoc.txt" + GUID.generate();
    createContent(folderName, docName, false);
    folderName = "testfolder" + GUID.generate();
    docName = "testdoc.txt" + GUID.generate();
    createContent(folderName, docName, false);
    Holder<String> changeLogToken = new Holder<String>();
    ObjectList ol = this.cmisConnector.getContentChanges(changeLogToken, new BigInteger("2"));
    assertEquals(2, ol.getNumItems());
    assertEquals("3", changeLogToken.getValue());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:15,代码来源:CMISTest.java


示例10: setContentStream

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * CMIS setContentStream and deleteContentStream.
 */
public void setContentStream(CallContext context, Holder<String> objectId, Boolean overwriteFlag, ContentStream contentStream) {
	log.debug("setContentStream({}, {})", objectId, overwriteFlag);

	if (objectId == null) {
		throw new CmisInvalidArgumentException("Id is not valid!");
	}

	// check overwrite
	// boolean owf = (overwriteFlag == null ? true : overwriteFlag.booleanValue());
	// if (!owf && file.length() > 0) {
	// throw new CmisContentAlreadyExistsException("Content already exists!");
	// }

	try {
		if (!OKMDocument.getInstance().isValid(null, objectId.getValue())) {
			throw new CmisStreamNotSupportedException("Not a document");
		}

		if (!OKMDocument.getInstance().isCheckedOut(null, objectId.getValue())) {
			OKMDocument.getInstance().checkout(null, objectId.getValue());
		}

		new DbDocumentModule().checkin(null, objectId.getValue(), contentStream.getStream(), contentStream.getLength(), "CMIS Client",
				null);
	} catch (Exception e) {
		throw new CmisStorageException("Could not write content: " + e.getMessage(), e);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:32,代码来源:CmisRepository.java


示例11: appendContentStream

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
@Override
public void appendContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
        ContentStream contentStream, boolean isLastChunk, ExtensionsData extension)
{
    if ((contentStream == null) || (contentStream.getStream() == null))
    {
        throw new CmisInvalidArgumentException("No content!");
    }

    checkRepositoryId(repositoryId);

    CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object");
    NodeRef nodeRef = info.getNodeRef();

    if (((DocumentTypeDefinition) info.getType().getTypeDefinition(false)).getContentStreamAllowed() == ContentStreamAllowed.NOTALLOWED)
    {
        throw new CmisStreamNotSupportedException("Document type doesn't allow content!");
    }

    try
    {
    	connector.appendContent(info, contentStream, isLastChunk);
        objectId.setValue(connector.createObjectId(nodeRef));
    }
	catch(IOException e)
	{
		throw new ContentIOException("", e);
	}
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:30,代码来源:AlfrescoCmisServiceImpl.java


示例12: deleteContentStream

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
@Override
    public void deleteContentStream(
            String repositoryId, Holder<String> objectId, Holder<String> changeToken,
            ExtensionsData extension)
    {
        checkRepositoryId(repositoryId);

        CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object");

        if (!info.isVariant(CMISObjectVariant.CURRENT_VERSION) && !info.isVariant(CMISObjectVariant.PWC))
        {
            throw new CmisStreamNotSupportedException("Content can only be deleted from ondocuments!");
        }

        final NodeRef nodeRef = info.getNodeRef();

        if (((DocumentTypeDefinition) info.getType().getTypeDefinition(false)).getContentStreamAllowed() == ContentStreamAllowed.REQUIRED)
        {
            throw new CmisInvalidArgumentException("Document type requires content!");
        }

        connector.getNodeService().setProperty(nodeRef, ContentModel.PROP_CONTENT, null);
        
//        connector.createVersion(nodeRef, VersionType.MINOR, "Delete content");

        connector.getActivityPoster().postFileFolderUpdated(info.isFolder(), nodeRef);

        objectId.setValue(connector.createObjectId(nodeRef));
    }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:30,代码来源:AlfrescoCmisServiceImpl.java


示例13: moveObject

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * CMIS moveObject.
 */
public ObjectData moveObject(CallContext context, Holder<String> objectId, String targetFolderId,
        ObjectInfoHandler objectInfos) {
    boolean userReadOnly = checkUser(context, true);

    if (objectId == null) {
        throw new CmisInvalidArgumentException("Id is not valid!");
    }

    // get the file and parent
    File file = getFile(objectId.getValue());
    File parent = getFile(targetFolderId);

    // build new path
    File newFile = new File(parent, file.getName());
    if (newFile.exists()) {
        throw new CmisStorageException("Object already exists!");
    }

    // move it
    if (!file.renameTo(newFile)) {
        throw new CmisStorageException("Move failed!");
    } else {
        // set new id
        objectId.setValue(getId(newFile));
    }

    return compileObjectData(context, newFile, null, false, false, userReadOnly, objectInfos);
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:32,代码来源:FileBridgeRepository.java


示例14: updateProperties

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * CMIS updateProperties.
 */
public ObjectData updateProperties(CallContext context, Holder<String> objectId, Properties properties,
        ObjectInfoHandler objectInfos) {
    boolean userReadOnly = checkUser(context, true);

    // check object id
    if (objectId == null || objectId.getValue() == null) {
        throw new CmisInvalidArgumentException("Id is not valid!");
    }

    // get the file or folder
    File file = getFile(objectId.getValue());

    // check the properties
    String typeId = (file.isDirectory() ? BaseTypeId.CMIS_FOLDER.value() : BaseTypeId.CMIS_DOCUMENT.value());
    checkUpdateProperties(properties, typeId);

    // get and check the new name
    String newName = FileBridgeUtils.getStringProperty(properties, PropertyIds.NAME);
    boolean isRename = (newName != null) && (!file.getName().equals(newName));
    if (isRename && !isValidName(newName)) {
        throw new CmisNameConstraintViolationException("Name is not valid!");
    }

    // rename file or folder if necessary
    File newFile = file;
    if (isRename) {
        File parent = file.getParentFile();
        newFile = new File(parent, newName);
        if (!file.renameTo(newFile)) {
            // if something went wrong, throw an exception
            throw new CmisUpdateConflictException("Could not rename object!");
        } else {
            // set new id
            objectId.setValue(getId(newFile));
        }
    }

    return compileObjectData(context, newFile, null, false, false, userReadOnly, objectInfos);
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:43,代码来源:FileBridgeRepository.java


示例15: bulkUpdateProperties

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * CMIS bulkUpdateProperties.
 */
public List<BulkUpdateObjectIdAndChangeToken> bulkUpdateProperties(CallContext context,
        List<BulkUpdateObjectIdAndChangeToken> objectIdAndChangeToken, Properties properties,
        ObjectInfoHandler objectInfos) {
    checkUser(context, true);

    if (objectIdAndChangeToken == null) {
        throw new CmisInvalidArgumentException("No object ids provided!");
    }

    List<BulkUpdateObjectIdAndChangeToken> result = new ArrayList<BulkUpdateObjectIdAndChangeToken>();

    for (BulkUpdateObjectIdAndChangeToken oid : objectIdAndChangeToken) {
        if (oid == null) {
            // ignore invalid ids
            continue;
        }
        try {
            Holder<String> oidHolder = new Holder<String>(oid.getId());
            updateProperties(context, oidHolder, properties, objectInfos);

            result.add(new BulkUpdateObjectIdAndChangeTokenImpl(oid.getId(), oidHolder.getValue(), null));
        } catch (CmisBaseException e) {
            // ignore exceptions - see specification
        }
    }

    return result;
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:32,代码来源:FileBridgeRepository.java


示例16: checkIn

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * See CMIS 1.0 section 2.2.7.3 checkedIn
 */
public void checkIn(Holder<String> objectId, Boolean major, Properties properties,
                    ContentStream contentStream, String checkinComment) {

    if(log.isTraceEnabled()) {
        log.trace("<<<<<<< checkin for object id " + objectId.getValue());
    }

    // check id
    if (objectId == null || objectId.getValue() == null) {
        throw new CmisInvalidArgumentException("Object Id must be set.");
    }

    // get the node
    RegistryObject gregNode;
    try {
        gregNode = getGregNode(objectId.getValue());
    }
    catch (CmisObjectNotFoundException e) {
        throw new CmisUpdateConflictException(e.getCause().getMessage(), e.getCause());
    }

    if (!gregNode.isVersionable()) {
        throw new CmisUpdateConflictException("Not a version: " + gregNode);
    }

    // checkin
    RegistryVersion checkedIn = gregNode.asVersion().checkin(properties, contentStream, checkinComment);
    objectId.setValue(checkedIn.getId());
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:33,代码来源:CMISRepository.java


示例17: checkIn

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
@Override
public void checkIn(String repositoryId, Holder<String> objectId, Boolean major, Properties properties,
                    ContentStream contentStream, String checkinComment, List<String> policies, Acl addAces, Acl removeAces,
                    ExtensionsData extension) {

    gregRepository.checkIn(objectId, major, properties, contentStream, checkinComment);
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:8,代码来源:CMISService.java


示例18: moveObject

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * CMIS moveObject.
 */
public ObjectData moveObject(CallContext context, Holder<String> objectId,
		String targetFolderId, ObjectInfoHandler objectInfos) {
	boolean userReadOnly = checkUser(context, true);

	if (objectId == null) {
		throw new CmisInvalidArgumentException("Id is not valid!");
	}

	// get the file and parent
	File file = getFile(objectId.getValue());
	File parent = getFile(targetFolderId);

	// build new path
	File newFile = new File(parent, file.getName());
	if (newFile.exists()) {
		throw new CmisStorageException("Object already exists!");
	}

	// move it
	if (!file.renameTo(newFile)) {
		throw new CmisStorageException("Move failed!");
	} else {
		// set new id
		objectId.setValue(getId(newFile));
	}

	return compileObjectData(context, newFile, null, false, false,
			userReadOnly, objectInfos);
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuide,代码行数:33,代码来源:FileBridgeRepository.java


示例19: bulkUpdateProperties

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
/**
 * CMIS bulkUpdateProperties.
 */
public List<BulkUpdateObjectIdAndChangeToken> bulkUpdateProperties(
		CallContext context,
		List<BulkUpdateObjectIdAndChangeToken> objectIdAndChangeToken,
		Properties properties, ObjectInfoHandler objectInfos) {
	checkUser(context, true);

	if (objectIdAndChangeToken == null) {
		throw new CmisInvalidArgumentException("No object ids provided!");
	}

	List<BulkUpdateObjectIdAndChangeToken> result = new ArrayList<BulkUpdateObjectIdAndChangeToken>();

	for (BulkUpdateObjectIdAndChangeToken oid : objectIdAndChangeToken) {
		if (oid == null) {
			// ignore invalid ids
			continue;
		}
		try {
			Holder<String> oidHolder = new Holder<String>(oid.getId());
			updateProperties(context, oidHolder, properties, objectInfos);

			result.add(new BulkUpdateObjectIdAndChangeTokenImpl(
					oid.getId(), oidHolder.getValue(), null));
		} catch (CmisBaseException e) {
			// ignore exceptions - see specification
		}
	}

	return result;
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuide,代码行数:34,代码来源:FileBridgeRepository.java


示例20: moveObject

import org.apache.chemistry.opencmis.commons.spi.Holder; //导入依赖的package包/类
@Override
public void moveObject(String repositoryId, Holder<String> objectId,
		String targetFolderId, String sourceFolderId,
		ExtensionsData extension) {
	getRepository().moveObject(getCallContext(), objectId, targetFolderId,
			this);
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuide,代码行数:8,代码来源:FileBridgeCmisService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SuperColumn类代码示例发布时间:2022-05-22
下一篇:
Java KeyParser类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap