@SuppressWarnings("unchecked") public List<String> getConsents() throws XWikiException { return this.consentHolder.getListValue(GRANTED); }
@SuppressWarnings("unchecked") public List<String> getConsents() throws XWikiException { return this.consentHolder.getListValue(GRANTED); }
@SuppressWarnings("unchecked") public List<String> getConsents() throws XWikiException { return this.consentHolder.getListValue(GRANTED); }
/** * Custom sections configuration is represented as a list of section identifiers. If a section is present in this * list, then it is enabled, otherwise it's disabled. The custom order of the sections is the same order as this * list. If the list is empty, then the global configuration is used instead. * * @return a list of enabled section identifiers, empty if the sections aren't configured, {@code null} if the * configuration object doesn't define this override at all */ @SuppressWarnings("unchecked") public List<String> getSectionsOverride() { return this.configuration.getListValue("sections"); }
/** * Custom sections configuration is represented as a list of section identifiers. If a section is present in this * list, then it is enabled, otherwise it's disabled. The custom order of the sections is the same order as this * list. If the list is empty, then the global configuration is used instead. * * @return a list of enabled section identifiers, empty if the sections aren't configured, {@code null} if the * configuration object doesn't define this override at all */ @SuppressWarnings("unchecked") public List<String> getSectionsOverride() { return this.configuration.getListValue("sections"); }
/** * Custom fields configuration is represented as a list of field identifiers. If a field is present in this list, * then it is enabled, otherwise it's disabled. The custom order of the fields is the same order as this list. * Fields can't be moved to a different section using the custom configuration, so only the relative order of the * enabled fields belonging to the same section determines their order in that section. If the list is empty, then * the global configuration is used instead. * * @return a list of enabled field identifiers, empty if the fields aren't configured, {@code null} if the * configuration object doesn't define this override at all */ @SuppressWarnings("unchecked") public List<String> getFieldsOverride() { return this.configuration.getListValue("fields"); }
/** * Custom fields configuration is represented as a list of field identifiers. If a field is present in this list, * then it is enabled, otherwise it's disabled. The custom order of the fields is the same order as this list. * Fields can't be moved to a different section using the custom configuration, so only the relative order of the * enabled fields belonging to the same section determines their order in that section. If the list is empty, then * the global configuration is used instead. * * @return a list of enabled field identifiers, empty if the fields aren't configured, {@code null} if the * configuration object doesn't define this override at all */ @SuppressWarnings("unchecked") public List<String> getFieldsOverride() { return this.configuration.getListValue("fields"); }
private Map<NotificationFilterProperty, List<String>> createNotificationFilterPropertiesMap(BaseObject obj) { Map<NotificationFilterProperty, List<String>> filterPreferenceProperties = new HashMap<>(); filterPreferenceProperties.put(NotificationFilterProperty.APPLICATION, obj.getListValue(FIELD_APPLICATIONS)); filterPreferenceProperties.put(NotificationFilterProperty.EVENT_TYPE, obj.getListValue(FIELD_EVENT_TYPES)); filterPreferenceProperties.put(NotificationFilterProperty.PAGE, obj.getListValue(FIELD_PAGES)); filterPreferenceProperties.put(NotificationFilterProperty.SPACE, obj.getListValue(FIELD_SPACES)); filterPreferenceProperties.put(NotificationFilterProperty.WIKI, obj.getListValue(FIELD_WIKIS)); filterPreferenceProperties.put(NotificationFilterProperty.USER, obj.getListValue(FIELD_USERS)); return filterPreferenceProperties; }
/** * @since 2.2M2 */ public List getListValue(DocumentReference classReference, String fieldName) { BaseObject obj = getXObject(classReference); if (obj == null) { return new ArrayList(); } return obj.getListValue(fieldName); }
public List getListValue(String fieldName) { BaseObject object = getFirstObject(fieldName, null); if (object == null) { return new ArrayList(); } return object.getListValue(fieldName); }
/** * Get the value of the field <code>fieldName</code> of the managed object's class. * * @param fieldName the name of the field from the managed object's class where to find the value. * @return the value in {@link List} of the field <code>fieldName</code> of the managed object's class. * @see com.xpn.xwiki.doc.XWikiDocument#getListValue(java.lang.String) * @since 1.4 */ public List<String> getStringListValue(String fieldName) { BaseObject obj = getBaseObject(false); if (obj == null) { return null; } return obj.getListValue(fieldName); }
/** * Get the value of the field <code>fieldName</code> of the managed object's class. * * @param fieldName the name of the field from the managed object's class where to find the value. * @return the value in {@link List} of the field <code>fieldName</code> of the managed object's class. * @see com.xpn.xwiki.doc.XWikiDocument#getListValue(java.lang.String) * @deprecated Use {@link #getStringListValue(String)} instead. Since 1.4. */ @Deprecated public List getListValue(String fieldName) { BaseObject obj = getBaseObject(false); if (obj == null) { return null; } return obj.getListValue(fieldName); }
/** * Fills in an extended phenotype field using the base phenotype field. * * @param baseFieldName the name of the field holding the basic list of phenotypes * @param extendedFieldName the name of the target field that will hold the extended list of phenotypes * @param patientRecordObj the object to update */ private void updateField(String baseFieldName, String extendedFieldName, BaseObject patientRecordObj) { List<String> phenotypes = patientRecordObj.getListValue(baseFieldName); Set<String> extendedPhenotypes = new HashSet<String>(); for (String phenotype : phenotypes) { extendedPhenotypes.addAll(this.solr.getAllAncestorsAndSelfIDs(phenotype)); } patientRecordObj.setDBStringListValue(extendedFieldName, new ArrayList<String>(extendedPhenotypes)); } }
/** * @param baseObject the object containing the component definition * @param roleType the role Type implemented * @param roleHint the role hint for this role implementation */ public AbstractAsyncBaseObjectWikiComponent(BaseObject baseObject, Type roleType, String roleHint) { super(baseObject, roleType, roleHint); this.async = baseObject.getIntValue(XPROPERTY_ASYNC_ENABLED, 0) == 1; this.cached = baseObject.getIntValue(XPROPERTY_ASYNC_CACHED, 0) == 1; List<String> contextEntriesList = baseObject.getListValue(XPROPERTY_ASYNC_CONTEXT); this.contextEntries = contextEntriesList != null ? new HashSet<>(contextEntriesList) : null; } }
@Override public Collection<String> getWatchedElements(String user, WatchedElementType type) throws XWikiException { BaseObject watchListObject = getWatchListObject(user); List<String> watchedItems = watchListObject.getListValue(getWatchListClassPropertyForType(type)); return watchedItems; }
@SuppressWarnings("unchecked") private Set<String> readConsentIdsFromPatientDoc(Patient patient) { Set<String> ids = new LinkedHashSet<>(); try { XWikiDocument patientDoc = patient.getXDocument(); BaseObject idsHolder = patientDoc.getXObject(this.consentIdsHolderReference); if (idsHolder != null) { List<String> patientConsentIds = idsHolder.getListValue(GRANTED); if (patientConsentIds != null) { ids.addAll(patientConsentIds); } } } catch (Exception ex) { this.logger.error("Could not read consents for patient {}: {}", patient.getId(), ex.getMessage()); } return ids; }
@SuppressWarnings("unchecked") private Set<String> readConsentIdsFromPatientDoc(Patient patient) { Set<String> ids = new LinkedHashSet<>(); try { XWikiDocument patientDoc = patient.getXDocument(); BaseObject idsHolder = patientDoc.getXObject(this.consentIdsHolderReference); if (idsHolder != null) { List<String> patientConsentIds = idsHolder.getListValue(GRANTED); if (patientConsentIds != null) { ids.addAll(patientConsentIds); } } } catch (Exception ex) { this.logger.error("Could not read consents for patient {}: {}", patient.getId(), ex.getMessage()); } return ids; }
@SuppressWarnings("unchecked") private Set<String> readConsentIdsFromPatientDoc(Patient patient) { Set<String> ids = new LinkedHashSet<>(); try { XWikiDocument patientDoc = (XWikiDocument) this.bridge.getDocument(patient.getDocument()); BaseObject idsHolder = patientDoc.getXObject(this.consentIdsHolderReference); if (idsHolder != null) { List<String> patientConsentIds = idsHolder.getListValue(GRANTED); if (patientConsentIds != null) { ids.addAll(patientConsentIds); } } } catch (Exception ex) { this.logger.error("Could not read consents for patient {}: {}", patient.getId(), ex.getMessage()); } return ids; }
/** * Retrieves the value of a list property. */ protected List<Object> getListValue(String mapping, Document doc, XWikiContext context) throws XWikiException { XWikiDocument xdoc = context.getWiki().getDocument(doc.getFullName(), context); PropertySelector ps = new PropertySelector(mapping); if (ps.getClassName() == null) { return xdoc.getFirstObject(ps.getPropertyName(), context).getListValue(ps.getPropertyName()); } else { return xdoc.getObject(ps.getClassName(), ps.getObjectIndex()).getListValue(ps.getPropertyName()); } }
private void handleObject(List<NotificationFilterPreference> preferencesToConvert, BaseObject obj) { DefaultNotificationFilterPreference preference = new DefaultNotificationFilterPreference(); NotificationFilterType filterType = NotificationFilterType.valueOf( obj.getStringValue(FIELD_FILTER_TYPE).toUpperCase()); Set<NotificationFormat> filterFormats = new HashSet<>(); for (String format : (List<String>) obj.getListValue(FIELD_FILTER_FORMATS)) { filterFormats.add(NotificationFormat.valueOf(format.toUpperCase())); } preference.setProviderHint("userProfile"); preference.setFilterName(obj.getStringValue(FIELD_FILTER_NAME)); preference.setEnabled(obj.getIntValue(FIELD_IS_ENABLED, 1) == 1); preference.setActive(obj.getIntValue(FIELD_IS_ACTIVE, 1) == 1); preference.setFilterType(filterType); preference.setNotificationFormats(filterFormats); preference.setStartingDate(obj.getDateValue(FIELD_STARTING_DATE)); handleProperties(preferencesToConvert, obj, preference); }