本文整理汇总了Java中org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl类的典型用法代码示例。如果您正苦于以下问题:Java ObjectInfoImpl类的具体用法?Java ObjectInfoImpl怎么用?Java ObjectInfoImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectInfoImpl类属于org.apache.chemistry.opencmis.commons.impl.server包,在下文中一共展示了ObjectInfoImpl类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compileObjectType
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
/**
* Compiles an object type object from a file or folder.
*/
private ObjectData compileObjectType(CallContext context, Node node, Set<String> filter, boolean includeAllowableActions,
boolean includeAcl, ObjectInfoHandler objectInfos) {
ObjectDataImpl result = new ObjectDataImpl();
ObjectInfoImpl objectInfo = new ObjectInfoImpl();
result.setProperties(compileProperties(node, filter, objectInfo));
if (includeAllowableActions) {
result.setAllowableActions(compileAllowableActions(node));
}
if (includeAcl) {
result.setAcl(compileAcl(node));
result.setIsExactAcl(true);
}
if (context.isObjectInfoRequired()) {
objectInfo.setObject(result);
objectInfos.addObjectInfo(objectInfo);
}
return result;
}
示例2: compileObjectData
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
/**
* Compiles an object type object from a file or folder.
*/
private ObjectData compileObjectData(CallContext context, File file, Set<String> filter,
boolean includeAllowableActions, boolean includeAcl, boolean userReadOnly, ObjectInfoHandler objectInfos) {
ObjectDataImpl result = new ObjectDataImpl();
ObjectInfoImpl objectInfo = new ObjectInfoImpl();
result.setProperties(compileProperties(context, file, filter, objectInfo));
if (includeAllowableActions) {
result.setAllowableActions(compileAllowableActions(file, userReadOnly));
}
if (includeAcl) {
result.setAcl(compileAcl(file));
result.setIsExactAcl(true);
}
if (context.isObjectInfoRequired()) {
objectInfo.setObject(result);
objectInfos.addObjectInfo(objectInfo);
}
return result;
}
示例3: setRelaionshipsToObjectInfo
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
private void setRelaionshipsToObjectInfo(ObjectData object, ObjectInfoImpl info)
{
info.setRelationshipSourceIds(null);
info.setRelationshipTargetIds(null);
List<ObjectData> relationships = object.getRelationships();
if (relationships != null && relationships.size() > 0)
{
List<String> sourceIds = new ArrayList<String>();
List<String> targetIds = new ArrayList<String>();
for (ObjectData relationship : relationships)
{
String sourceId = getIdProperty(relationship, PropertyIds.SOURCE_ID);
String targetId = getIdProperty(relationship, PropertyIds.TARGET_ID);
if (object.getId().equals(sourceId))
{
sourceIds.add(relationship.getId());
}
if (object.getId().equals(targetId))
{
targetIds.add(relationship.getId());
}
}
if (sourceIds.size() > 0)
{
info.setRelationshipSourceIds(sourceIds);
}
if (targetIds.size() > 0)
{
info.setRelationshipTargetIds(targetIds);
}
}
}
示例4: compileObjectType
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
/**
* Compile the <code>ObjectData</code> for this node
*/
public ObjectData compileObjectType(Set<String> filter, Boolean includeAllowableActions,
ObjectInfoHandler objectInfos, boolean requiresObjectInfo) {
try {
ObjectDataImpl result = new ObjectDataImpl();
ObjectInfoImpl objectInfo = new ObjectInfoImpl();
PropertiesImpl properties = new PropertiesImpl();
//filter = filter == null ? null : new HashSet<String>(filter);
if (filter != null)
filter = new HashSet<String>(filter);
compileProperties(properties, filter, objectInfo);
result.setProperties(properties);
if (filter != null && !filter.isEmpty()) {
log.debug("Unknown filter properties: " + filter.toString());
}
if (Boolean.TRUE.equals(includeAllowableActions)) {
result.setAllowableActions(getAllowableActions());
}
if (requiresObjectInfo) {
objectInfo.setObject(result);
objectInfos.addObjectInfo(objectInfo);
}
return result;
} catch (RegistryException e) {
String msg = "";
log.error(msg, e);
throw new CmisRuntimeException(msg, e);
}
}
示例5: compileProperties
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
@Override
protected void compileProperties(PropertiesImpl properties, Set<String> filter, ObjectInfoImpl objectInfo)
throws RegistryException {
super.compileProperties(properties, filter, objectInfo);
objectInfo.setWorkingCopyOriginalId(getBaseNodeId());
objectInfo.setWorkingCopyId(getPwcId());
}
示例6: compileObjectData
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
/**
* Compiles an object type object from a file or folder.
*/
private ObjectData compileObjectData(CallContext context, File file,
Set<String> filter, boolean includeAllowableActions,
boolean includeAcl, boolean userReadOnly,
ObjectInfoHandler objectInfos) {
ObjectDataImpl result = new ObjectDataImpl();
ObjectInfoImpl objectInfo = new ObjectInfoImpl();
result.setProperties(compileProperties(context, file, filter,
objectInfo));
if (includeAllowableActions) {
result.setAllowableActions(compileAllowableActions(file,
userReadOnly));
}
if (includeAcl) {
result.setAcl(compileAcl(file));
result.setIsExactAcl(true);
}
if (context.isObjectInfoRequired()) {
objectInfo.setObject(result);
objectInfos.addObjectInfo(objectInfo);
}
return result;
}
示例7: setRelaionshipsToObjectInfo
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
private void setRelaionshipsToObjectInfo(ObjectData object, ObjectInfoImpl info)
{
info.setRelationshipSourceIds(null);
info.setRelationshipTargetIds(null);
IncludeRelationships includeRelationships = getRequestParameterIncludeRelationships();
if (includeRelationships != IncludeRelationships.NONE)
{
List<ObjectData> relationships = object.getRelationships();
if (relationships != null && relationships.size() > 0)
{
List<String> sourceIds = new ArrayList<String>();
List<String> targetIds = new ArrayList<String>();
for (ObjectData relationship : relationships)
{
String sourceId = getIdProperty(relationship, PropertyIds.SOURCE_ID);
String targetId = getIdProperty(relationship, PropertyIds.TARGET_ID);
if (object.getId().equals(sourceId))
{
sourceIds.add(relationship.getId());
}
if (object.getId().equals(targetId))
{
targetIds.add(relationship.getId());
}
}
if (sourceIds.size() > 0 &&
(includeRelationships == IncludeRelationships.SOURCE ||
includeRelationships == IncludeRelationships.BOTH))
{
info.setRelationshipSourceIds(sourceIds);
}
if (targetIds.size() > 0 &&
(includeRelationships == IncludeRelationships.TARGET ||
includeRelationships == IncludeRelationships.BOTH))
{
info.setRelationshipTargetIds(targetIds);
}
}
}
}
示例8: readCustomProperties
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
/**
* Reads and adds properties.
*/
private void readCustomProperties(Node node, PropertiesImpl properties, Set<String> filter, ObjectInfoImpl objectInfo) {
ObjectData obj = new ObjectDataImpl();
if (obj.getProperties() != null) {
// add it to properties
for (PropertyData<?> prop : obj.getProperties().getPropertyList()) {
// overwrite object info
if (prop instanceof PropertyString) {
String firstValueStr = ((PropertyString) prop).getFirstValue();
if (PropertyIds.NAME.equals(prop.getId())) {
objectInfo.setName(firstValueStr);
} else if (PropertyIds.OBJECT_TYPE_ID.equals(prop.getId())) {
objectInfo.setTypeId(firstValueStr);
} else if (PropertyIds.CREATED_BY.equals(prop.getId())) {
objectInfo.setCreatedBy(firstValueStr);
} else if (PropertyIds.CONTENT_STREAM_MIME_TYPE.equals(prop.getId())) {
objectInfo.setContentType(firstValueStr);
} else if (PropertyIds.CONTENT_STREAM_FILE_NAME.equals(prop.getId())) {
objectInfo.setFileName(firstValueStr);
}
}
if (prop instanceof PropertyDateTime) {
GregorianCalendar firstValueCal = ((PropertyDateTime) prop).getFirstValue();
if (PropertyIds.CREATION_DATE.equals(prop.getId())) {
objectInfo.setCreationDate(firstValueCal);
} else if (PropertyIds.LAST_MODIFICATION_DATE.equals(prop.getId())) {
objectInfo.setLastModificationDate(firstValueCal);
}
}
// check filter
if (filter != null) {
if (!filter.contains(prop.getId())) {
continue;
} else {
filter.remove(prop.getId());
}
}
// don't overwrite id
if (PropertyIds.OBJECT_ID.equals(prop.getId())) {
continue;
}
// don't overwrite base type
if (PropertyIds.BASE_TYPE_ID.equals(prop.getId())) {
continue;
}
// add it
properties.replaceProperty(prop);
}
}
}
示例9: compileProperties
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
@Override
protected void compileProperties(PropertiesImpl properties, Set<String> filter, ObjectInfoImpl objectInfo)
throws RegistryException {
super.compileProperties(properties, filter, objectInfo);
if(getNode().getContent()!=null){
objectInfo.setHasContent(true);
} else{
objectInfo.setHasContent(false);
}
objectInfo.setHasParent(true);
objectInfo.setSupportsDescendants(false);
objectInfo.setSupportsFolderTree(false);
String typeId = getTypeIdInternal();
Resource contextNode = getContextNode();
// mutability
addPropertyBoolean(properties, typeId, filter, PropertyIds.IS_IMMUTABLE, getIsImmutable());
// content stream
long length = getPropertyLength(contextNode,CMISConstants.GREG_DATA);
addPropertyInteger(properties, typeId, filter, PropertyIds.CONTENT_STREAM_LENGTH, length);
// mime type
String mimeType = getPropertyOrElse(contextNode, CMISConstants.GREG_MIMETYPE, MIME_UNKNOWN);
addPropertyString(properties, typeId, filter, PropertyIds.CONTENT_STREAM_MIME_TYPE, mimeType);
objectInfo.setContentType(mimeType);
// file name
String fileName = getNodeName();
addPropertyString(properties, typeId, filter, PropertyIds.CONTENT_STREAM_FILE_NAME, fileName);
objectInfo.setFileName(fileName);
addPropertyId(properties, typeId, filter, PropertyIds.CONTENT_STREAM_ID, getObjectId() + "/stream");
// versioning
addPropertyBoolean(properties, typeId, filter, PropertyIds.IS_LATEST_VERSION, isLatestVersion());
addPropertyBoolean(properties, typeId, filter, PropertyIds.IS_MAJOR_VERSION, isMajorVersion());
addPropertyBoolean(properties, typeId, filter, PropertyIds.IS_LATEST_MAJOR_VERSION, isLatestMajorVersion());
addPropertyString(properties, typeId, filter, PropertyIds.VERSION_LABEL, getVersionLabel());
addPropertyId(properties, typeId, filter, PropertyIds.VERSION_SERIES_ID, getVersionSeriesId());
addPropertyString(properties, typeId, filter, PropertyIds.CHECKIN_COMMENT, getCheckInComment());
boolean isCheckedOut = isCheckedOut();
addPropertyBoolean(properties, typeId, filter, PropertyIds.IS_VERSION_SERIES_CHECKED_OUT, isCheckedOut);
if (isCheckedOut) {
addPropertyId(properties, typeId, filter, PropertyIds.VERSION_SERIES_CHECKED_OUT_ID, getCheckedOutId());
//addPropertyString(properties, typeId, filter, PropertyIds.VERSION_SERIES_CHECKED_OUT_BY, getCheckedOutBy());
} else{
addPropertyId(properties, typeId, filter, PropertyIds.VERSION_SERIES_CHECKED_OUT_ID, CMISConstants.GREG_PROPERTY_NOT_SET);
//addPropertyString(properties, typeId, filter, PropertyIds.VERSION_SERIES_CHECKED_OUT_BY, null);
}
addPropertyString(properties, typeId, filter, PropertyIds.VERSION_SERIES_CHECKED_OUT_BY, getCheckedOutBy());
}
示例10: compileProperties
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
protected void compileProperties(PropertiesImpl properties, Set<String> filter, ObjectInfoImpl objectInfo)
throws RegistryException {
String typeId = getTypeIdInternal();
BaseTypeId baseTypeId = getBaseTypeId();
objectInfo.setBaseType(baseTypeId);
objectInfo.setTypeId(typeId);
objectInfo.setHasAcl(false);
objectInfo.setVersionSeriesId(getVersionSeriesId());
objectInfo.setRelationshipSourceIds(null);
objectInfo.setRelationshipTargetIds(null);
objectInfo.setRenditionInfos(null);
objectInfo.setSupportsPolicies(false);
objectInfo.setSupportsRelationships(false);
// id
String objectId = getObjectId();
addPropertyId(properties, typeId, filter, PropertyIds.OBJECT_ID, objectId);
objectInfo.setId(objectId);
// name
String name = getName();
addPropertyString(properties, typeId, filter, PropertyIds.NAME, name);
objectInfo.setName(name);
// base type and type name
addPropertyId(properties, typeId, filter, PropertyIds.BASE_TYPE_ID, baseTypeId.value());
addPropertyId(properties, typeId, filter, PropertyIds.OBJECT_TYPE_ID, typeId);
// created and modified by
String createdBy = getCreatedBy();
addPropertyString(properties, typeId, filter, PropertyIds.CREATED_BY, createdBy);
objectInfo.setCreatedBy(createdBy);
addPropertyString(properties, typeId, filter, PropertyIds.LAST_MODIFIED_BY, getLastModifiedBy());
// creation and modification date
GregorianCalendar created = getCreated();
addPropertyDateTime(properties, typeId, filter, PropertyIds.CREATION_DATE, created);
objectInfo.setCreationDate(created);
GregorianCalendar lastModified = getLastModified();
addPropertyDateTime(properties, typeId, filter, PropertyIds.LAST_MODIFICATION_DATE, lastModified);
objectInfo.setLastModificationDate(lastModified);
addPropertyString(properties, typeId, filter, PropertyIds.CHANGE_TOKEN, getChangeToken());
}
示例11: compileProperties
import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl; //导入依赖的package包/类
@Override
protected void compileProperties(PropertiesImpl properties, Set<String> filter, ObjectInfoImpl objectInfo)
throws RegistryException {
super.compileProperties(properties, filter, objectInfo);
objectInfo.setHasContent(false);
objectInfo.setSupportsDescendants(true);
objectInfo.setSupportsFolderTree(true);
String typeId = getTypeIdInternal();
addPropertyString(properties, typeId, filter, PropertyIds.PATH, getNode().getPath());
// folder properties
/*
* TODO
*
* */
//The PARENT_ID is "not set" since all my types are base types. See spec 2.1.3.2.1
//if (pathManager.isRoot(getNode())) {
// objectInfo.setHasParent(false);
//}
//else {
// objectInfo.setHasParent(true);
//}
//ParentId must be set for all folder objects except for root folder
if(pathManager.isRoot(getNode())){
addPropertyId(properties, typeId, filter, PropertyIds.PARENT_ID, CMISConstants.GREG_PROPERTY_NOT_SET);
} else{
addPropertyId(properties, typeId, filter, PropertyIds.PARENT_ID, getNode().getPath());
}
//Allowable child object type ids
List<String> allowableChildObjectTypeIds = new ArrayList<String>();
allowableChildObjectTypeIds.add(RegistryTypeManager.FOLDER_TYPE_ID);
allowableChildObjectTypeIds.add(RegistryTypeManager.DOCUMENT_TYPE_ID);
addPropertyId(properties, typeId, filter, PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS, allowableChildObjectTypeIds);
}