/** * The custom configuration can specify a different phenotype mapping to use, as a serialized reference to the * mapping document. * * @return a serialized document reference, possibly empty or {@code null} */ public String getPhenotypeMapping() { return this.configuration.getStringValue("mapping"); } }
/** * The custom configuration can specify a different phenotype mapping to use, as a serialized reference to the * mapping document. * * @return a serialized document reference, possibly empty or {@code null} */ public String getPhenotypeMapping() { return this.configuration.getStringValue("mapping"); } }
/** * @param ldapObject the ldap profile object. * @return the dn store in the user profile. Null if it can't find any or if it's empty. */ public String getDn(BaseObject ldapObject) { String dn = ldapObject.getStringValue(LDAP_XFIELD_DN); return dn.length() == 0 ? null : dn; }
/** * @param ldapObject the ldap profile object. * @return the uid store in the user profile. Null if it can't find any or if it's empty. */ public String getUid(BaseObject ldapObject) { String uid = ldapObject.getStringValue(LDAP_XFIELD_UID); return uid.length() == 0 ? null : uid; }
/** * @param ldapObject the ldap profile object. * @return the uid store in the user profile. Null if it can't find any or if it's empty. */ public String getUid(BaseObject ldapObject) { String uid = ldapObject.getStringValue(LDAP_XFIELD_UID); return uid.length() == 0 ? null : uid; }
/** * @param ldapObject the ldap profile object. * @return the dn store in the user profile. Null if it can't find any or if it's empty. */ public String getDn(BaseObject ldapObject) { String dn = ldapObject.getStringValue(LDAP_XFIELD_DN); return dn.length() == 0 ? null : dn; }
private void setRights(BaseObject rightsObject, String field, String value) { String currentValue = rightsObject.getStringValue(field); if (!StringUtils.isEmpty(currentValue)) { currentValue += ","; } rightsObject.setLargeStringValue(field, currentValue + value); } }
private String getPropertyValue(XWikiDocument doc, EntityReference classReference, String propertyName, String defaultValue) { String value = ""; BaseObject obj = doc.getXObject(classReference); if (obj != null) { value = obj.getStringValue(propertyName); } return StringUtils.defaultString(value, defaultValue); }
private void register(BaseObject jobObj, XWikiContext context) throws SchedulerPluginException { String status = jobObj.getStringValue("status"); if (status.equals(JobState.STATE_NORMAL) || status.equals(JobState.STATE_PAUSED)) { scheduleJob(jobObj, context); } if (status.equals(JobState.STATE_PAUSED)) { pauseJob(jobObj, context); } }
private void unregister(BaseObject jobObj, XWikiContext context) throws SchedulerPluginException { String status = jobObj.getStringValue("status"); if (status.equals(JobState.STATE_NORMAL) || status.equals(JobState.STATE_PAUSED)) { scheduleJob(jobObj, context); } if (status.equals(JobState.STATE_PAUSED)) { pauseJob(jobObj, context); } }
private String getMacroId(BaseObject macroDefinition) throws WikiMacroException { String macroId = macroDefinition.getStringValue(MACRO_ID_PROPERTY); // Verify macro id. if (StringUtils.isEmpty(macroId)) { throw new WikiMacroException(String.format("Incomplete macro definition in [%s], macro id is empty", macroDefinition.getReference())); } return macroId; }
@Override public String getDateOfBirthFormat() { String result = getISODateFormat(); try { BaseObject settings = getGlobalConfigurationObject(); result = StringUtils.defaultIfBlank(settings.getStringValue("dateOfBirthFormat"), result); } catch (NullPointerException ex) { // No value set, return the default } return result; }
private DocumentReference getOwner(XWikiDocument doc) { String owner = null; BaseObject ownerObj = doc.getXObject(Owner.CLASS_REFERENCE); if (ownerObj != null) { owner = ownerObj.getStringValue("owner"); } if (StringUtils.isNotBlank(owner)) { return this.stringEntityResolver.resolve(owner); } return null; }
private Visibility getVisibility(XWikiDocument doc) { String visibility = null; BaseObject visibilityObj = doc.getXObject(Visibility.CLASS_REFERENCE); if (visibilityObj != null) { visibility = visibilityObj.getStringValue("visibility"); } return this.manager.resolveVisibility(StringUtils.defaultIfBlank(visibility, "private")); }
@Override public WikiComponentScope getScope(DocumentReference reference) throws WikiComponentException { BaseObject componentObject = getComponentObject(reference); return WikiComponentScope.fromString(componentObject.getStringValue(COMPONENT_SCOPE_FIELD)); }
@Override public String getRoleHint(DocumentReference reference) throws WikiComponentException { BaseObject componentObject = getComponentObject(reference); return StringUtils.defaultIfEmpty(componentObject.getStringValue(COMPONENT_ROLE_HINT_FIELD), "default"); }
private Pair<String, String> fetchFromGroup(XWikiDocument document) { BaseObject groupObject = document.getXObject(GROUP_OBJECT_REFERENCE); String email = groupObject.getStringValue("contact"); String name = document.getDocumentReference().getName(); return Pair.of(name, email); } }
public boolean pauseJob(BaseObject object) { try { getProtectedPlugin().pauseJob(object, this.context); LOG.debug("Pause Job : " + object.getStringValue("jobName")); return true; } catch (XWikiException e) { this.context.put("error", e.getMessage()); return false; } }
public boolean pauseJob(BaseObject object) { try { getProtectedPlugin().pauseJob(object, this.context); LOGGER.debug("Pause Job: [{}]", object.getStringValue("jobName")); return true; } catch (XWikiException e) { this.context.put("error", e.getMessage()); return false; } }
public String getChronoPreference(String optname, XWikiContext context) throws XWikiException { return context.getWiki().getDocument(CLASS_CHRONOPREFS, context) .getObject(CLASS_CHRONOPREFS).getStringValue(optname); } }