本文整理汇总了Java中org.apache.chemistry.opencmis.commons.data.PropertyData类的典型用法代码示例。如果您正苦于以下问题:Java PropertyData类的具体用法?Java PropertyData怎么用?Java PropertyData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyData类属于org.apache.chemistry.opencmis.commons.data包,在下文中一共展示了PropertyData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAssocProperties
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的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;
}
示例2: getStringProperty
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的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();
}
示例3: getIdProperty
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的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();
}
示例4: getPropIsLatestMajorVersion
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的package包/类
private PropertyData<?> getPropIsLatestMajorVersion(ObjectData objectData)
{
List<PropertyData<?>> properties = objectData.getProperties().getPropertyList();
boolean found = false;
PropertyData<?> propIsLatestMajorVersion = null;
for (PropertyData<?> property : properties)
{
if (property.getId().equals(PropertyIds.IS_LATEST_MAJOR_VERSION))
{
found = true;
propIsLatestMajorVersion = property;
break;
}
}
//properties..contains(PropertyIds.IS_LATEST_MAJOR_VERSION);
assertTrue("The PropertyIds.IS_LATEST_MAJOR_VERSION property was not found", found);
if (found)
{
return propIsLatestMajorVersion;
}
return null;
}
示例5: getDocument
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的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.PropertyData; //导入依赖的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: fullTextQuery
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的package包/类
public static List<String> fullTextQuery(Session lSession, String pStrText) {
List<String> lListResults = null;
int lIntDocumentsFound = 0;
mLog.debug("Start fullTextQuery(String) - ", pStrText);
ItemIterable<QueryResult> lItemIterableQueryResult =
lSession.query("SELECT cmis:objectId FROM cmis:document where CONTAINS('" + pStrText + "')", false);
lListResults = new ArrayList<String>();
for (QueryResult lQueryResult : lItemIterableQueryResult) {
for (PropertyData<?> lPropertyData : lQueryResult.getProperties()) {
lListResults.add((String) lPropertyData.getFirstValue());
}
}
if (lListResults != null) {
lIntDocumentsFound = lListResults.size();
}
mLog.debug("End fullTextQuery(String) - ", pStrText, " - found ", lIntDocumentsFound, " documents.");
return lListResults;
}
示例8: getDocument
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的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;
}
示例9: getFolder
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的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;
}
示例10: getPropertyXml
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的package包/类
private XmlBuilder getPropertyXml(PropertyData property) {
XmlBuilder propertyXml = new XmlBuilder("property");
String name = property.getId();
propertyXml.addAttribute("name", name);
Object value = property.getFirstValue();
if (value == null) {
propertyXml.addAttribute("isNull", "true");
} else {
if (value instanceof BigInteger) {
BigInteger bi = (BigInteger) property.getFirstValue();
propertyXml.setValue(String.valueOf(bi));
} else if (value instanceof Boolean) {
Boolean b = (Boolean) property.getFirstValue();
propertyXml.setValue(String.valueOf(b));
} else if (value instanceof GregorianCalendar) {
GregorianCalendar gc = (GregorianCalendar) property
.getFirstValue();
SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss.SSSZ");
propertyXml.setValue(sdf.format(gc.getTime()));
} else {
propertyXml.setValue((String) property.getFirstValue());
}
}
return propertyXml;
}
示例11: getView
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
// Try to reuse previous view from the listview.
// If the view doesn't exist, create a new one.
if (convertView == null) {
holder = new ViewHolder();
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(android.R.layout.simple_list_item_2, null);
holder.topText = (TextView) convertView.findViewById(android.R.id.text1);
holder.bottomText = (TextView) convertView.findViewById(android.R.id.text2);
convertView.setTag(holder);
}
// Displays information Name + Number of tracks available
holder = (ViewHolder) convertView.getTag();
holder.topText.setText((String) albumsLibrary.get(position).getName());
PropertyData<Object> trackList = albumsLibrary.get(position).getProperty(CmisBookIds.TRACKS);
holder.bottomText.setText(((trackList != null) ? trackList.getValues().size() : 0) + " tracks");
return convertView;
}
示例12: getValue
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的package包/类
private Serializable getValue(PropertyData<?> property, boolean isMultiValue)
{
if ((property.getValues() == null) || (property.getValues().isEmpty()))
{
return null;
}
if (isMultiValue)
{
return (Serializable) property.getValues();
}
return (Serializable) property.getValues().get(0);
}
示例13: setProperiesToObject
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的package包/类
private void setProperiesToObject(CmisService cmisService, String repositoryId, String objectIdStr, String propertyStr, BigInteger bigIntValue) throws CmisConstraintException{
Properties properties = cmisService.getProperties(repositoryId, objectIdStr, null, null);
PropertyIntegerImpl pd = (PropertyIntegerImpl)properties.getProperties().get(propertyStr);
pd.setValue(bigIntValue);
Collection<PropertyData<?>> propsList = new ArrayList<PropertyData<?>>();
propsList.add(pd);
Properties newProps = new PropertiesImpl(propsList);
cmisService.updateProperties(repositoryId, new Holder<String>(objectIdStr), null, newProps, null);
}
示例14: assertVersions
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的package包/类
private void assertVersions(final NodeRef nodeRef, final String expectedVersionLabel, final VersionType expectedVersionType)
{
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<List<Void>>()
{
@Override
public List<Void> execute() throws Throwable
{
assertTrue("Node should be versionable", nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE));
Version version = versionService.getCurrentVersion(nodeRef);
assertNotNull(version);
assertEquals(expectedVersionLabel, version.getVersionLabel());
assertEquals(expectedVersionType, version.getVersionType());
return null;
}
});
withCmisService(new CmisServiceCallback<Void>()
{
@Override
public Void execute(CmisService cmisService)
{
String repositoryId = cmisService.getRepositoryInfos(null).get(0).getId();
ObjectData data =
cmisService.getObjectOfLatestVersion(repositoryId, nodeRef.toString(), null, Boolean.FALSE, null, null, null, null, null, null, null);
assertNotNull(data);
PropertyData<?> prop = data.getProperties().getProperties().get(PropertyIds.VERSION_LABEL);
Object versionLabelCmisValue = prop.getValues().get(0);
assertEquals(expectedVersionLabel, versionLabelCmisValue);
return null;
}
}, CmisVersion.CMIS_1_1);
}
示例15: getProperties
import org.apache.chemistry.opencmis.commons.data.PropertyData; //导入依赖的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;
}