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