本文整理汇总了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;
}
示例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?
}
示例3: getBaseTypeId
import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
public static Object getBaseTypeId(CmisObject child) {
return child.getPropertyValue(PropertyIds.BASE_TYPE_ID);
}
示例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;
}