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


Java CmisObject.getPropertyValue方法代码示例

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


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

示例1: getTracks

import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
/**
 * Returns tracks of an album.
 * 
 * @param session
 *          OpenCMIS session
 * @param albumObject
 *          the album object
 * @return a list of track documents, or an empty list if the object
 *         is not an album or the album has no tracks
 */
public static List<Document> getTracks(Session session,
		CmisObject albumObject) {
	List<Document> tracks = new ArrayList<Document>();

	@SuppressWarnings("unchecked")
	List<String> trackIds = (List<String>) albumObject
			.getPropertyValue(IdMapping
					.getRepositoryPropertyId("cmisbook:tracks"));

	if (trackIds != null) {
		for (String trackId : trackIds) {
			try {
				CmisObject track = session.getObject(trackId,
						CMISHelper.FULL_OPERATION_CONTEXT);
				if (track instanceof Document) {
					tracks.add((Document) track);
				}
			} catch (CmisBaseException cbe) {
				// ignore
			}
		}
	}

	return tracks;
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:36,代码来源:TheBlendHelper.java

示例2: getObjectTypeId

import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
public static Object getObjectTypeId(CmisObject child) {
    return child.getPropertyValue(PropertyIds.OBJECT_TYPE_ID); //BASE_TYPE_ID?
}
 
开发者ID:xenit-eu,项目名称:move2alf,代码行数:4,代码来源:CMISHelper.java

示例3: getBaseTypeId

import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
public static Object getBaseTypeId(CmisObject child) {
    return child.getPropertyValue(PropertyIds.BASE_TYPE_ID);
}
 
开发者ID:xenit-eu,项目名称:move2alf,代码行数:4,代码来源:CMISHelper.java

示例4: getArtworkId

import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
/**
 * Returns the id of the artwork document of a given document.
 * 
 * A non-null value is returned only if
 * <ul>
 * <li>the document has an cmisbook:artwork property</li>
 * <li>this property is set</li>
 * <li>the property value points to an existing document</li>
 * <li>this document has content and its MIME type starts with
 * "image/"</li>
 * </ul>
 * 
 * @param session
 *          OpenCMIS session
 * @param cmisObject
 *          the object
 * @return the id of artwork document or <code>null</code> if no
 *         artwork is set or it is invalid
 */
public static String getArtworkId(Session session,
		CmisObject cmisObject) {
	ObjectType type = cmisObject.getType();

	if (!type.getPropertyDefinitions().containsKey(
			IdMapping.getRepositoryPropertyId("cmisbook:artwork"))) {
		return null;
	}

	String artworkId = cmisObject.getPropertyValue(IdMapping
			.getRepositoryPropertyId("cmisbook:artwork"));
	if (artworkId == null) {
		return null;
	}

	CmisObject artworkObject = null;
	try {
		artworkObject = session.getObject(artworkId,
				CMISHelper.FULL_OPERATION_CONTEXT);
	} catch (CmisBaseException cbe) {
		// we couldn't get the artwork object for some reason
		return null;
	}

	if (!(artworkObject instanceof Document)) {
		return null;
	}

	String artworkMimeType = ((Document) artworkObject)
			.getContentStreamMimeType();

	if (artworkMimeType == null) {
		return null;
	}

	if (!artworkMimeType.toLowerCase().startsWith("image/")) {
		return null;
	}

	return artworkId;
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:61,代码来源:TheBlendHelper.java


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