本文整理汇总了Java中org.apache.chemistry.opencmis.commons.data.Properties.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Properties.getProperties方法的具体用法?Java Properties.getProperties怎么用?Java Properties.getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.chemistry.opencmis.commons.data.Properties
的用法示例。
在下文中一共展示了Properties.getProperties方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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);
}
示例8: addNodeFromSource
import org.apache.chemistry.opencmis.commons.data.Properties; //导入方法依赖的package包/类
/**
* See CMIS 1.0 section 2.2.4.2 createDocumentFromSource
*
* @throws CmisStorageException
*/
public RegistryObject addNodeFromSource(RegistryDocument source, Properties properties) {
try {
String filename = source.getNodeName();
String destPath = getRepository().copy(source.getNode().getPath(), getNode().getPath() + "/" + filename);
RegistryObject gregObject = create(getRepository().get(destPath));
// overlay new properties
if (properties != null && properties.getProperties() != null) {
updateProperties(gregObject.getNode(), gregObject.getTypeId(), properties);
}
//session.save();
return gregObject;
}
catch (RegistryException e) {
String msg = "Failed to add the node " + source.getId();
log.error(msg, e);
throw new CmisStorageException(msg, e);
}
}
示例9: 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);
}
示例10: getProperties
import org.apache.chemistry.opencmis.commons.data.Properties; //导入方法依赖的package包/类
private Properties getProperties(NodeRef nodeRef)
{
CMISNodeInfoImpl nodeInfo = cmisConnector.createNodeInfo(nodeRef);
final Properties properties = cmisConnector.getNodeProperties(nodeInfo, null);
// fake the title property, which CMIS doesn't give us
String title = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE);
final PropertyStringImpl titleProp = new PropertyStringImpl(ContentModel.PROP_TITLE.toString(), title);
Properties wrapProperties = new Properties()
{
@Override
public List<CmisExtensionElement> getExtensions()
{
return properties.getExtensions();
}
@Override
public void setExtensions(List<CmisExtensionElement> extensions)
{
properties.setExtensions(extensions);
}
@Override
public Map<String, PropertyData<?>> getProperties()
{
Map<String, PropertyData<?>> updatedProperties = new HashMap<String, PropertyData<?>>(properties.getProperties());
updatedProperties.put(titleProp.getId(), titleProp);
return updatedProperties;
}
@Override
public List<PropertyData<?>> getPropertyList()
{
List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>(properties.getPropertyList());
propertyList.add(titleProp);
return propertyList;
}
};
return wrapProperties;
}
示例11: checkAddProperty
import org.apache.chemistry.opencmis.commons.data.Properties; //导入方法依赖的package包/类
private boolean checkAddProperty(Properties properties, String typeId, Set<String> filter, String id) {
if ((properties == null) || (properties.getProperties() == null)) {
throw new IllegalArgumentException("Properties must not be null!");
}
if (id == null) {
throw new IllegalArgumentException("Id must not be null!");
}
TypeDefinition type = types.getType(typeId);
if (type == null) {
throw new IllegalArgumentException("Unknown type: " + typeId);
}
if (!type.getPropertyDefinitions().containsKey(id)) {
throw new IllegalArgumentException("Unknown property: " + id);
}
String queryName = type.getPropertyDefinitions().get(id).getQueryName();
if ((queryName != null) && (filter != null)) {
if (!filter.contains(queryName)) {
return false;
} else {
filter.remove(queryName);
}
}
return true;
}
示例12: checkAddProperty
import org.apache.chemistry.opencmis.commons.data.Properties; //导入方法依赖的package包/类
private boolean checkAddProperty(Properties properties, String typeId, Set<String> filter, String id) {
if ((properties == null) || (properties.getProperties() == null)) {
throw new IllegalArgumentException("Properties must not be null!");
}
if (id == null) {
throw new IllegalArgumentException("Id must not be null!");
}
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new IllegalArgumentException("Unknown type: " + typeId);
}
if (!type.getPropertyDefinitions().containsKey(id)) {
throw new IllegalArgumentException("Unknown property: " + id);
}
String queryName = type.getPropertyDefinitions().get(id).getQueryName();
if ((queryName != null) && (filter != null)) {
if (!filter.contains(queryName)) {
return false;
} else {
filter.remove(queryName);
}
}
return true;
}
示例13: checkAddProperty
import org.apache.chemistry.opencmis.commons.data.Properties; //导入方法依赖的package包/类
/**
* Validate a set of properties against a filter and its definitions
*/
protected final boolean checkAddProperty(Properties properties, String typeId, Set<String> filter, String id) {
if (properties == null || properties.getProperties() == null) {
throw new IllegalArgumentException("Properties must not be null!");
}
if (id == null) {
throw new IllegalArgumentException("Id must not be null!");
}
TypeDefinition type = typeManager.getType(typeId);
if (type == null) {
throw new IllegalArgumentException("Unknown type: " + typeId);
}
if (!type.getPropertyDefinitions().containsKey(id)) {
throw new IllegalArgumentException("Unknown property: " + id);
}
String queryName = type.getPropertyDefinitions().get(id).getQueryName();
if (queryName != null && filter != null) {
if (filter.contains(queryName)) {
filter.remove(queryName);
} else {
return false;
}
}
return true;
}
示例14: checkAddProperty
import org.apache.chemistry.opencmis.commons.data.Properties; //导入方法依赖的package包/类
private boolean checkAddProperty(Properties properties, String typeId,
Set<String> filter, String id) {
if ((properties == null) || (properties.getProperties() == null)) {
throw new IllegalArgumentException("Properties must not be null!");
}
if (id == null) {
throw new IllegalArgumentException("Id must not be null!");
}
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new IllegalArgumentException("Unknown type: " + typeId);
}
if (!type.getPropertyDefinitions().containsKey(id)) {
throw new IllegalArgumentException("Unknown property: " + id);
}
String queryName = type.getPropertyDefinitions().get(id).getQueryName();
if ((queryName != null) && (filter != null)) {
if (!filter.contains(queryName)) {
return false;
} else {
filter.remove(queryName);
}
}
return true;
}
示例15: 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)
{
checkRepositoryId(repositoryId);
// check properties
if (properties == null || properties.getProperties() == null)
{
throw new CmisInvalidArgumentException("Properties must be set!");
}
// get the type
String objectTypeId = connector.getObjectTypeIdProperty(properties);
// find the type
TypeDefinitionWrapper type = connector.getOpenCMISDictionaryService().findType(objectTypeId);
if (type == null)
{
throw new CmisInvalidArgumentException("Type '" + objectTypeId + "' is unknown!");
}
// create object
String newId = null;
switch (type.getBaseTypeId())
{
case CMIS_DOCUMENT:
versioningState = getDocumentDefaultVersioningState(versioningState, type);
newId = createDocument(repositoryId, properties, folderId, contentStream, versioningState, policies, null,
null, extension);
break;
case CMIS_FOLDER:
newId = createFolder(repositoryId, properties, folderId, policies, null, null, extension);
break;
case CMIS_POLICY:
newId = createPolicy(repositoryId, properties, folderId, policies, null, null, extension);
break;
case CMIS_ITEM:
newId = createItem(repositoryId, properties, folderId, policies, null, null, extension);
break;
default:
break;
}
// check new object id
if (newId == null)
{
throw new CmisRuntimeException("Creation failed!");
}
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
if (isObjectInfoRequired)
{
try
{
getObjectInfo(repositoryId, newId, "*", IncludeRelationships.NONE);
}
catch (InvalidNodeRefException e)
{
throw new CmisRuntimeException("Creation failed! New object not found!");
}
}
// return the new object id
return newId;
}