@Override public Blob getBlob() { return (Blob) doc.getPropertyValue(xPath); }
/** * Obtains a property value given its path. * * @param doc the document * @param propertyPath the property path * @return the property value or <code>null</code> if an error occured. */ public static Object getComplexPropertyValue(DocumentModel doc, String propertyPath) { try { return doc.getPropertyValue(propertyPath); } catch (PropertyException e) { return null; } }
@Override public boolean validate(Object context) { return resolver.validate(doc.getPropertyValue(xpath), context); }
@Override public <T> T fetch(Class<T> type) { return resolver.fetch(type, doc.getPropertyValue(xpath)); }
@Override public Object fetch(Object context) { return resolver.fetch(doc.getPropertyValue(xpath), context); }
v1 = doc1.getPropertyValue(sortPropertyPath); } catch (PropertyException e) { v1 = null; v2 = doc2.getPropertyValue(sortPropertyPath); } catch (PropertyException e) { v2 = null;
@Override public boolean validate() { return resolver.validate(doc.getPropertyValue(xpath), doc.getCoreSession()); }
@Override public Object fetch() { return resolver.fetch(doc.getPropertyValue(xpath), doc.getCoreSession()); }
Object v1 = null; try { v1 = doc1.getPropertyValue(propertyName); } catch (PropertyException pe) { v1 = null; v2 = doc2.getPropertyValue(propertyName); } catch (PropertyException pe) { v2 = null;
String mt = null; try { mt = (String) doc.getPropertyValue("note:mime_type"); if (mt == null) { String note = (String) doc.getPropertyValue("note:note"); if (note != null && !"".equals(note)) { mt = "text/plain"; // BBB
/** * @since 5.7.3 Alias for #getProperty. */ public Serializable getPropertyValue(String key) { return doc.getPropertyValue(key); }
protected boolean getDenyAllTypesProperty(DocumentModel doc) { try { Boolean value = (Boolean) doc.getPropertyValue(UI_TYPES_CONFIGURATION_DENY_ALL_TYPES_PROPERTY); return Boolean.TRUE.equals(value); } catch (PropertyException e) { return false; } }
protected boolean getDenyAllWebConfsProperty(DocumentModel doc) { try { Boolean value = (Boolean) doc.getPropertyValue(WebConfsConfigurationConstants.WEB_CONFS_CONFIGURATION_DENIED_ALL_PROPERTY); return Boolean.TRUE.equals(value); } catch (NuxeoException e) { return false; } }
@SuppressWarnings("unchecked") protected List<Map<String, Serializable>> getTags(DocumentModel docModel) { try { return (List<Map<String, Serializable>>) docModel.getPropertyValue(TAG_LIST); } catch (PropertyNotFoundException e) { log.warn( "Getting tags on {} failed since {} is missing on {} document type. This operation will be ignored.", docModel::getPathAsString, () -> TAG_FACET, docModel::getType); return new ArrayList<>(); } }
protected List<String> getWebConfsList(DocumentModel doc, String property) { String[] webConfs; try { webConfs = (String[]) doc.getPropertyValue(property); } catch (NuxeoException e) { return Collections.emptyList(); } if (webConfs == null) { return Collections.emptyList(); } return Collections.unmodifiableList(Arrays.asList(webConfs)); }
protected static DocumentView getDownloadFileProperties(DocumentLocation docLoc, DocumentModel doc) throws PropertyException, NuxeoException { Map<String, String> parameters = new HashMap<String, String>(); parameters.put(DocumentFileCodec.FILE_PROPERTY_PATH_KEY, "file:content"); String fileName = (String) doc.getPropertyValue("file:filename"); parameters.put(DocumentFileCodec.FILENAME_KEY, fileName); return new DocumentViewImpl(docLoc, null, parameters); }
public static void documentModelToExternalEntity(DocumentModel documentModel, ExternalEntity entity) { if (documentModel.hasFacet(EXTERNAL_ENTITY_FACET)) { entity.setEntityId((String) documentModel.getPropertyValue(EXTERNAL_ENTITY_ID_PROPERTY)); entity.setOrigin((String) documentModel.getPropertyValue(EXTERNAL_ENTITY_ORIGIN_PROPERTY)); entity.setEntity((String) documentModel.getPropertyValue(EXTERNAL_ENTITY_PROPERTY)); } }
@Override public void run() throws NuxeoException { DocumentModel domain = ToutaticeDocumentHelper.getDomain(this.session, this.document, false); Serializable property = domain.getPropertyValue(TTCD_DEFAULT_PORTAL_SITE_ID); this.defaultPortal = property != null && property.toString().equals(this.document.getId()); }
@SuppressWarnings("unchecked") public MultiviewPictureAdapter(DocumentModel docModel) { this.docModel = docModel; List<Map<String, Object>> list = (List<Map<String, Object>>) docModel.getPropertyValue(PICTURE_VIEWS_PROPERTY); if (list != null) { for (Map<String, Object> map : list) { PictureView view = mapToView(map); views.put(view.getTitle(), view); } } }
@Override public void setModificationDate(DocumentModel doc, Calendar modificationDate) { doc.setPropertyValue(DUBLINCORE_MODIFIED_DATE_PROPERTY, modificationDate); if (doc.getPropertyValue(DUBLINCORE_CREATED_DATE_PROPERTY) == null) { setCreationDate(doc, modificationDate); } }