本文整理汇总了Java中org.apache.chemistry.opencmis.commons.data.Properties类的典型用法代码示例。如果您正苦于以下问题:Java Properties类的具体用法?Java Properties怎么用?Java Properties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Properties类属于org.apache.chemistry.opencmis.commons.data包,在下文中一共展示了Properties类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createFolder
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* CMIS createFolder.
*/
public String createFolder(CallContext context, Properties properties, String folderId) {
checkUser(context, true);
// check properties
checkNewProperties(properties, BaseTypeId.CMIS_FOLDER);
// get parent File
File parent = getFile(folderId);
if (!parent.isDirectory()) {
throw new CmisObjectNotFoundException("Parent is not a folder!");
}
// create the folder
String name = FileBridgeUtils.getStringProperty(properties, PropertyIds.NAME);
File newFolder = new File(parent, name);
if (!newFolder.mkdir()) {
throw new CmisStorageException("Could not create folder!");
}
return getId(newFolder);
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:25,代码来源:FileBridgeRepository.java
示例2: getNodeProperties
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public Properties getNodeProperties(CMISNodeInfo info, String filter)
{
PropertiesImpl result = new PropertiesImpl();
Set<String> filterSet = splitFilter(filter);
for (PropertyDefinitionWrapper propDef : info.getType().getProperties())
{
if (!propDef.getPropertyId().equals(PropertyIds.OBJECT_ID))
{
// don't filter the object id
if ((filterSet != null) && (!filterSet.contains(propDef.getPropertyDefinition().getQueryName())))
{
// skip properties that are not in the filter
continue;
}
}
Serializable value = propDef.getPropertyAccessor().getValue(info);
result.addProperty(getProperty(propDef.getPropertyDefinition().getPropertyType(), propDef, value));
}
addAspectProperties(info, filter, result);
return result;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:CMISConnector.java
示例3: getAssocProperties
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public Properties getAssocProperties(CMISNodeInfo info, String filter)
{
PropertiesImpl result = new PropertiesImpl();
Set<String> filterSet = splitFilter(filter);
for (PropertyDefinitionWrapper propDefWrap : info.getType().getProperties())
{
PropertyDefinition<?> propDef = propDefWrap.getPropertyDefinition();
if ((filterSet != null) && (!filterSet.contains(propDef.getQueryName())))
{
// skip properties that are not in the filter
continue;
}
CMISPropertyAccessor cmisPropertyAccessor = propDefWrap.getPropertyAccessor();
Serializable value = cmisPropertyAccessor.getValue(info);
PropertyType propType = propDef.getPropertyType();
PropertyData<?> propertyData = getProperty(propType, propDefWrap, value);
result.addProperty(propertyData);
}
return result;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:CMISConnector.java
示例4: getStringProperty
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* Returns the value of the given property if it exists and is of the
* correct type.
*/
public String getStringProperty(Properties properties, String propertyId)
{
if ((properties == null) || (properties.getProperties() == null))
{
return null;
}
PropertyData<?> property = properties.getProperties().get(propertyId);
if (!(property instanceof PropertyString))
{
return null;
}
return ((PropertyString) property).getFirstValue();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:CMISConnector.java
示例5: getIdProperty
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* Returns the value of the given property if it exists and is of the
* correct type.
*/
public String getIdProperty(Properties properties, String propertyId)
{
if ((properties == null) || (properties.getProperties() == null))
{
return null;
}
PropertyData<?> property = properties.getProperties().get(propertyId);
if (!(property instanceof PropertyId))
{
return null;
}
return ((PropertyId) property).getFirstValue();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:CMISConnector.java
示例6: getNameProperty
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public String getNameProperty(Properties properties, String fallback)
{
String name = getStringProperty(properties, PropertyIds.NAME);
if ((name == null) || (name.trim().length() == 0))
{
if (fallback == null)
{
throw new CmisInvalidArgumentException("Property " + PropertyIds.NAME + " must be set!");
}
else
{
name = fallback;
}
}
return name;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:CMISConnector.java
示例7: createPolicy
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
@Override
public String createPolicy(
String repositoryId, Properties properties, String folderId, List<String> policies,
Acl addAces, Acl removeAces, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
// get the parent folder
getOrCreateFolderInfo(folderId, "Parent Folder");
String objectTypeId = connector.getObjectTypeIdProperty(properties);
connector.getTypeForCreate(objectTypeId, BaseTypeId.CMIS_POLICY);
// we should never get here - policies are not creatable!
throw new CmisRuntimeException("Polcies cannot be created!");
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:AlfrescoCmisServiceImpl.java
示例8: getProperties
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
@Override
public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
// what kind of object is it?
CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
if (isObjectInfoRequired)
{
getObjectInfo(repositoryId, info.getObjectId(), IncludeRelationships.NONE);
}
if (info.isVariant(CMISObjectVariant.ASSOC))
{
return connector.getAssocProperties(info, filter);
}
else
{
return connector.getNodeProperties(info, filter);
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:AlfrescoCmisServiceImpl.java
示例9: create
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
@Override
public String create(String repositoryId, Properties properties, String folderId,
ContentStream contentStream, VersioningState versioningState,
List<String> policies, ExtensionsData extension)
{
FileFilterMode.setClient(Client.cmis);
try
{
return super.create(
repositoryId,
properties,
folderId,
contentStream,
versioningState,
policies,
extension);
}
finally
{
FileFilterMode.clearClient();
}
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:23,代码来源:PublicApiAlfrescoCmisService.java
示例10: createDocument
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* Overridden to capture content upload for publishing to analytics service.
*/
@Override
public String createDocument(String repositoryId, Properties properties, String folderId,
ContentStream contentStream, VersioningState versioningState,
List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension)
{
String newId = super.createDocument(
repositoryId,
properties,
folderId,
contentStream,
versioningState,
policies,
addAces,
removeAces,
extension);
return newId;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:21,代码来源:PublicApiAlfrescoCmisService.java
示例11: getDocument
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public FavouriteDocument getDocument(String networkId, final NodeRef nodeRef)
{
return TenantUtil.runAsSystemTenant(new TenantRunAsWork<FavouriteDocument>()
{
@Override
public FavouriteDocument doWork() throws Exception
{
FavouriteDocument document = null;
QName type = nodeService.getType(nodeRef);
if(dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT))
{
Properties properties = getProperties(nodeRef);
document = FavouriteDocument.getDocument(nodeRef.getId(), nodeRef.getId(), properties);
}
else
{
throw new IllegalArgumentException("Not a document node");
}
return document;
}
}, networkId);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:25,代码来源:RepoService.java
示例12: getFolder
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public FavouriteFolder getFolder(String networkId, final NodeRef nodeRef)
{
return TenantUtil.runAsSystemTenant(new TenantRunAsWork<FavouriteFolder>()
{
@Override
public FavouriteFolder doWork() throws Exception
{
FavouriteFolder folder = null;
QName type = nodeService.getType(nodeRef);
if(dictionaryService.isSubClass(type, ContentModel.TYPE_FOLDER))
{
Properties properties = getProperties(nodeRef);
folder = FavouriteFolder.getFolder(nodeRef.getId(), nodeRef.getId(), properties);
}
else
{
throw new IllegalArgumentException("Not a folder node");
}
return folder;
}
}, networkId);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:25,代码来源:RepoService.java
示例13: getDocument
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public static FavouriteDocument getDocument(String id, String guid, Properties props)
{
FavouriteDocument document = new FavouriteDocument(id, guid);
Map<String, PropertyData<?>> properties = props.getProperties();
document.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
document.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
document.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
document.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
document.setModifiedAt(modifiedAt.getTime());
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
document.setCreatedAt(createdAt.getTime());
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
document.setMimeType((String)properties.get(PropertyIds.CONTENT_STREAM_MIME_TYPE).getFirstValue());
document.setSizeInBytes((BigInteger)properties.get(PropertyIds.CONTENT_STREAM_LENGTH).getFirstValue());
document.setVersionLabel((String)properties.get(PropertyIds.VERSION_LABEL).getFirstValue());
return document;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:FavouriteDocument.java
示例14: getFolder
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public static FavouriteFolder getFolder(String id, String guid, Properties props)
{
FavouriteFolder folder = new FavouriteFolder(id, guid);
Map<String, PropertyData<?>> properties = props.getProperties();
folder.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
folder.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
folder.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
folder.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
folder.setModifiedAt(modifiedAt.getTime());
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
folder.setCreatedAt(createdAt.getTime());
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
return folder;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:17,代码来源:FavouriteFolder.java
示例15: create
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* Create* dispatch for AtomPub.
*/
public ObjectData create(CallContext context, Properties properties, String folderId, ContentStream contentStream,
VersioningState versioningState, ObjectInfoHandler objectInfos) {
log.debug("create({}, {})", properties, folderId);
String typeId = getTypeId(properties);
TypeDefinition type = types.getType(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
}
String objectId = null;
if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) {
objectId = createDocument(context, properties, folderId, contentStream, versioningState);
} else if (type.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) {
objectId = createFolder(context, properties, folderId);
} else {
throw new CmisObjectNotFoundException("Cannot create object of type '" + typeId + "'!");
}
return compileObjectType(context, getNode(objectId), null, false, false, objectInfos);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:25,代码来源:CmisRepository.java
示例16: getDocument
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public static FavouriteDocument getDocument(String id, String guid, Properties props)
{
FavouriteDocument document = new FavouriteDocument(id, guid);
Map<String, PropertyData<?>> properties = props.getProperties();
document.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
document.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
document.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
document.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
document.setModifiedAt(modifiedAt.getTime());
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
document.setCreatedAt(createdAt.getTime());
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
document.setMimeType((String)properties.get(PropertyIds.CONTENT_STREAM_MIME_TYPE).getFirstValue());
document.setSizeInBytes((BigInteger)properties.get(PropertyIds.CONTENT_STREAM_LENGTH).getFirstValue());
document.setVersionLabel((String)properties.get(PropertyIds.VERSION_LABEL).getFirstValue());
return document;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:20,代码来源:FavouriteDocument.java
示例17: getFolder
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
public static FavouriteFolder getFolder(String id, String guid, Properties props)
{
FavouriteFolder folder = new FavouriteFolder(id, guid);
Map<String, PropertyData<?>> properties = props.getProperties();
folder.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
folder.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
folder.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
folder.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
folder.setModifiedAt(modifiedAt.getTime());
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
folder.setCreatedAt(createdAt.getTime());
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
return folder;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:17,代码来源:FavouriteFolder.java
示例18: create
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* Create* dispatch for AtomPub.
*/
public ObjectData create(CallContext context, Properties properties, String folderId, ContentStream contentStream,
VersioningState versioningState, ObjectInfoHandler objectInfos) {
boolean userReadOnly = checkUser(context, true);
String typeId = FileBridgeUtils.getObjectTypeId(properties);
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
}
String objectId = null;
if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) {
objectId = createDocument(context, properties, folderId, contentStream, versioningState);
} else if (type.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) {
objectId = createFolder(context, properties, folderId);
} else {
throw new CmisObjectNotFoundException("Cannot create object of type '" + typeId + "'!");
}
return compileObjectData(context, getFile(objectId), null, false, false, userReadOnly, objectInfos);
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:25,代码来源:FileBridgeRepository.java
示例19: checkUpdateProperties
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* Checks a property set for an update.
*/
private void checkUpdateProperties(Properties properties, String typeId) {
// check properties
if (properties == null || properties.getProperties() == null) {
throw new CmisInvalidArgumentException("Properties must be set!");
}
// check the name
String name = FileBridgeUtils.getStringProperty(properties, PropertyIds.NAME);
if (name != null) {
if (!isValidName(name)) {
throw new CmisNameConstraintViolationException("Name is not valid!");
}
}
// check type properties
checkTypeProperties(properties, typeId, false);
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:21,代码来源:FileBridgeRepository.java
示例20: updateProperties
import org.apache.chemistry.opencmis.commons.data.Properties; //导入依赖的package包/类
/**
* See CMIS 1.0 section 2.2.4.12 updateProperties
*/
public ObjectData updateProperties(Holder<String> objectId, Properties properties,
ObjectInfoHandler objectInfos, boolean objectInfoRequired) {
if(log.isTraceEnabled()){
log.trace("<<<<<<< updateProperties for object id: " + objectId.getValue());
}
if (objectId == null) {
throw new CmisInvalidArgumentException("Id is not valid!");
}
// get the node
RegistryObject gregNode = getGregNode(objectId.getValue());
String id = gregNode.updateProperties(properties).getId();
objectId.setValue(id);
return gregNode.compileObjectType(null, false, objectInfos, objectInfoRequired);
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:21,代码来源:CMISRepository.java
注:本文中的org.apache.chemistry.opencmis.commons.data.Properties类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论