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


Java Session.createOperationContext方法代码示例

本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.Session.createOperationContext方法的典型用法代码示例。如果您正苦于以下问题:Java Session.createOperationContext方法的具体用法?Java Session.createOperationContext怎么用?Java Session.createOperationContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.chemistry.opencmis.client.api.Session的用法示例。


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

示例1: searchDocuments

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
public static List<Document> searchDocuments(Session pSession, String pTypeId, String pWhereClause) {
	mLog.debug("START searchDocuments(String, String");

	// per evitare il problema dei documenti duplicati
	LinkedHashMap<String, Document> lHashMapResults = new LinkedHashMap<String, Document>();

	// Temporanea disabilitazione della cache
	OperationContext lOperationContext = pSession.createOperationContext();
	lOperationContext.setCacheEnabled(false);

	ItemIterable<CmisObject> lResult = pSession.queryObjects(pTypeId, pWhereClause, false, lOperationContext);
	for (CmisObject cmisObject : lResult) {
		// TODO (Alessio) gestione paginazione (in entrata e in uscita, anche se probabilmente è
		// già gestita internamente in queryObjects)
		lHashMapResults.put(cmisObject.getId(), (Document) cmisObject);
	}

	mLog.debug("END searchDocuments(String, String");
	return new ArrayList<Document>(lHashMapResults.values());
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:21,代码来源:AlfrescoHelper.java

示例2: setupOperationContext

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
protected void setupOperationContext(final int maxItems, final Session session)
{
    final OperationContext operationContext = session.createOperationContext();
    operationContext.setCacheEnabled(true);

    operationContext.setOrderBy(MessageFormat.format("{0} ASC", PropertyIds.NAME));
    operationContext.setMaxItemsPerPage(maxItems);

    operationContext.setFilterString(null);
    operationContext.setIncludePathSegments(false);

    operationContext.setIncludeAcls(false);
    operationContext.setIncludeAllowableActions(false);
    operationContext.setIncludePolicies(false);

    operationContext.setIncludeRelationships(IncludeRelationships.NONE);
    operationContext.setLoadSecondaryTypeProperties(true);
    session.setDefaultContext(operationContext);
}
 
开发者ID:AFaust,项目名称:alfresco-cmis-documentlist,代码行数:20,代码来源:CMISDocumentListTreeNodeGet.java

示例3: setupOperationContext

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
protected void setupOperationContext(final int maxItems, final Session session)
{
    final OperationContext operationContext = session.createOperationContext();
    operationContext.setCacheEnabled(true);

    // type descending => cmis:folder, cmis:document
    operationContext.setOrderBy(MessageFormat.format("{0} DESC,{1} ASC", PropertyIds.BASE_TYPE_ID, PropertyIds.NAME));
    operationContext.setMaxItemsPerPage(maxItems);

    operationContext.setFilterString(null);
    operationContext.setRenditionFilterString("*");
    operationContext.setIncludePathSegments(true);

    // TODO: need to be included once
    operationContext.setIncludeAcls(false);
    operationContext.setIncludeAllowableActions(false);
    operationContext.setIncludePolicies(false);

    operationContext.setIncludeRelationships(IncludeRelationships.NONE);
    operationContext.setLoadSecondaryTypeProperties(true);
    session.setDefaultContext(operationContext);
}
 
开发者ID:AFaust,项目名称:alfresco-cmis-documentlist,代码行数:23,代码来源:CMISDocumentListGet.java

示例4: getDocumentRenditions

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
public static List<Rendition> getDocumentRenditions(Session pSession, String pStrDocumentId, String pStrFilter) {
	mLog.debug("START getDocumentRenditions(String, String)");

	OperationContext operationContext = pSession.createOperationContext();
	operationContext.setFilterString(PropertyIds.NAME);
	operationContext.setRenditionFilterString(pStrFilter);
	CmisObject lCmisObject = pSession.getObject(pStrDocumentId);
	List<Rendition> lListResults = lCmisObject.getRenditions();

	mLog.debug("END getDocumentRenditions(String)");
	return lListResults;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:13,代码来源:AlfrescoHelper.java

示例5: getDocumentVersions

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
/**
 * Recupera l'elenco delle versioni di un documento.
 * <p>
 * La lista dei documenti restituiti ha solo un sottoinsieme delle loro proprietà, ovvero:
 * <ul>
 * <li>{@code cmis:objectId}</li>
 * <li>{@code cmis:name}</li>
 * <li>{@code cmis:versionLabel}</li>
 * <li>{@code cmis:isLatestVersion}</li>
 * <li>{@code cmis:isMajorVersion}</li>
 * <li>{@code cmis:creationDate}</li>
 * <li>{@code cmis:createdBy}</li>
 * <li>{@code cmis:lastModificationDate}</li>
 * <li>{@code cmis:lastModififiedBy}</li>
 * </ul>
 * 
 * @param pSession
 *            La sessione da utilizzare.
 * @param pStrDocumentId
 *            L'id del documento di cui recuperare le versioni.
 * 
 * @return La lista delle versioni del documento.
 */
public static List<Document> getDocumentVersions(Session pSession, String pStrDocumentId) {
	mLog.debug("START getDocumentVersions(String)");
	Document lDocument = (Document) pSession.getObject(pStrDocumentId);

	// Filtro sulle proprietà restituite
	OperationContext lOperationContext = pSession.createOperationContext();
	Set<String> lPropertyFilter = new HashSet<>();
	lPropertyFilter.addAll(Arrays.asList(PropertyIds.OBJECT_ID, PropertyIds.NAME, PropertyIds.VERSION_LABEL,
	        PropertyIds.IS_LATEST_VERSION, PropertyIds.IS_MAJOR_VERSION, PropertyIds.CREATION_DATE,
	        PropertyIds.CREATED_BY, PropertyIds.LAST_MODIFICATION_DATE, PropertyIds.LAST_MODIFIED_BY));
	lOperationContext.setFilter(lPropertyFilter);
	lOperationContext.setIncludeAllowableActions(false);
	lOperationContext.setIncludePathSegments(false);

	List<Document> lListResults = lDocument.getAllVersions(lOperationContext);
	mLog.debug("Trovate {} versioni per il documento {}", lListResults.size(), pStrDocumentId);

	mLog.debug("END getDocumentVersions(String)");
	return lListResults;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:44,代码来源:AlfrescoHelper.java


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