/** * 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 String} of the field <code>fieldName</code> of the managed object's class. * @see com.xpn.xwiki.doc.XWikiDocument#getStringValue(java.lang.String) * @deprecated Use {@link #getStringValue(String)} which support LargeStringProperty and StringProperty. */ @Deprecated public String getLargeStringValue(String fieldName) { BaseObject obj = getBaseObject(false); if (obj == null) { return null; } return obj.getLargeStringValue(fieldName); }
@Override public PatientData<Attachment> load(Patient patient) { try { XWikiDocument doc = patient.getXDocument(); List<BaseObject> data = doc.getXObjects(CLASS_REFERENCE); if (CollectionUtils.isEmpty(data)) { return null; } List<Attachment> result = new ArrayList<>(data.size()); for (BaseObject xobject : data) { if (xobject == null) { continue; } String filename = xobject.getStringValue(FILE_FIELD_NAME); XWikiAttachment xattachment = doc.getAttachment(filename); if (xattachment != null) { Attachment attachment = this.adapter.fromXWikiAttachment(xattachment); attachment.addAttribute(COMMENTS_FIELD_NAME, xobject.getLargeStringValue(COMMENTS_FIELD_NAME)); result.add(attachment); } } return new IndexedPatientData<>(getName(), result); } catch (Exception e) { this.logger.error(ERROR_MESSAGE_LOAD_FAILED, e.getMessage()); } return null; }
metadataNotes = metadataObject.getLargeStringValue("comments");
@Override public PatientData<Attachment> load(Patient patient) { try { XWikiDocument doc = patient.getXDocument(); List<BaseObject> data = doc.getXObjects(CLASS_REFERENCE); if (CollectionUtils.isEmpty(data)) { return null; } List<Attachment> result = new ArrayList<>(data.size()); for (BaseObject xobject : data) { if (xobject == null) { continue; } String filename = xobject.getStringValue(FILE_FIELD_NAME); XWikiAttachment xattachment = doc.getAttachment(filename); if (xattachment != null) { Attachment attachment = this.adapter.fromXWikiAttachment(xattachment); attachment.addAttribute(COMMENTS_FIELD_NAME, xobject.getLargeStringValue(COMMENTS_FIELD_NAME)); attachment.addAttribute(PRINT_FIELD_NAME, xobject.getIntValue(PRINT_FIELD_NAME) == 1); result.add(attachment); } } return new IndexedPatientData<>(getName(), result); } catch (Exception e) { this.logger.error(ERROR_MESSAGE_LOAD_FAILED, e.getMessage()); } return null; }
metadataNotes = metadataObject.getLargeStringValue("comments");
@Override public String getDescription() { String result; BaseObject obj = this.document.getXObject(getType()); BaseClass cls = obj.getXClass(getXContext()); if (cls.getField(JSON_KEY_DESCRIPTION) != null) { result = obj.getLargeStringValue(JSON_KEY_DESCRIPTION); } else { result = this.document.getContent(); } return result; }
shell.evaluate(object.getLargeStringValue("script")); } else { throw new JobExecutionException("The user [" + context.getUser() + "] didn't have "
@Override public String getDescription() { String result; BaseObject obj = this.document.getXObject(getType()); BaseClass cls = obj.getXClass(getXContext()); if (cls.getField(JSON_KEY_DESCRIPTION) != null) { result = obj.getLargeStringValue(JSON_KEY_DESCRIPTION); } else { result = this.document.getContent(); } return result; }
p.toPeriod(), medication.getStringValue(Medication.EFFECT), medication.getLargeStringValue(Medication.NOTES)));
p.toPeriod(), medication.getStringValue(Medication.EFFECT), medication.getLargeStringValue(Medication.NOTES)));
private MemberCandidacy readCandidacyFromObject(BaseObject object, String wikiId) { MemberCandidacy candidacy = new MemberCandidacy(); candidacy.setId(object.getNumber()); candidacy.setWikiId(wikiId); candidacy.setUserId(object.getStringValue(WikiCandidateMemberClassInitializer.FIELD_USER)); candidacy.setUserComment(object.getLargeStringValue(WikiCandidateMemberClassInitializer.FIELD_USER_COMMENT)); candidacy.setAdminId(object.getStringValue(WikiCandidateMemberClassInitializer.FIELD_ADMIN)); candidacy.setAdminComment(object.getLargeStringValue(WikiCandidateMemberClassInitializer.FIELD_ADMIN_COMMENT)); candidacy.setAdminPrivateComment(object.getLargeStringValue( WikiCandidateMemberClassInitializer.FIELD_ADMIN_PRIVATE_COMMENT)); candidacy.setStatus( MemberCandidacy.Status.valueOf( object.getStringValue(WikiCandidateMemberClassInitializer.FIELD_STATUS).toUpperCase())); candidacy.setType( MemberCandidacy.CandidateType.valueOf( object.getStringValue(WikiCandidateMemberClassInitializer.FIELD_TYPE).toUpperCase()) ); candidacy.setDateOfCreation(object.getDateValue(WikiCandidateMemberClassInitializer.FIELD_DATE_OF_CREATION)); candidacy.setDateOfCreation(object.getDateValue(WikiCandidateMemberClassInitializer.FIELD_DATE_OF_CLOSURE)); return candidacy; }
continue; String sxContent = sxObj.getLargeStringValue(CONTENT_PROPERTY_NAME); int parse = sxObj.getIntValue(PARSE_CONTENT_PROPERTY_NAME); if ("LESS".equals(sxObj.getStringValue(CONTENT_TYPE_PROPERTY_NAME))) {
shell.evaluate(object.getLargeStringValue("script")); } else { throw new JobExecutionException("The user [" + getXWikiContext().getUser() + "] didn't have "
String content = xObject.getLargeStringValue("content"); String position = xObject.getStringValue("position"); String id = xObject.getNumber() + "";
@Override public byte[] retrieve(EntityReference entity) throws SignatureStoreException { checkArguments(entity); DocumentReference docRef = this.resolver.resolve(entity); XWikiContext context = this.contextProvider.get(); try { XWikiDocument document = context.getWiki().getDocument(docRef, context); DocumentReference signatureClass = new DocumentReference(SIGNATURECLASS, docRef.getWikiReference()); // TODO: Support any kind of entity by serializing the reference and its type properly String entityReference = entity.getName(); BaseObject object = document.getXObject(signatureClass, SIGNATURECLASS_PROP_REFERENCE, entityReference); if (object == null) { return null; } String signature = object.getLargeStringValue(SIGNATURECLASS_PROP_SIGNATURE); if (signature == null) { return null; } return this.base64.decode(signature); } catch (XWikiException e) { throw new SignatureStoreException("Error while retrieving signature for entity [" + entity + "]", e); } catch (IOException e) { throw new SignatureStoreException("Error while decoding signature for entity [" + entity + "]", e); } }
/** * {@inheritDoc} * * @param store an {@link org.xwiki.crypto.store.WikiStoreReference} to a document reference. */ @Override public CertifiedKeyPair retrieve(StoreReference store, byte[] password) throws KeyStoreException { XWikiContext context = getXWikiContext(); try { XWikiDocument document = context.getWiki().getDocument(getDocumentReference(store), context); BaseObject certObj = document.getXObject(X509CertificateWikiStore.CERTIFICATECLASS); BaseObject pkObj = document.getXObject(PRIVATEKEYCLASS); if (pkObj == null || certObj == null) { return null; } byte[] cert = getEncoder().decode( certObj.getLargeStringValue(X509CertificateWikiStore.CERTIFICATECLASS_PROP_CERTIFICATE)); byte[] key = getEncoder().decode(pkObj.getLargeStringValue(PRIVATEKEYCLASS_PROP_KEY)); if (password != null) { return new CertifiedKeyPair( this.encryptor.decrypt(password, key), getCertificateFactory().decode(cert)); } else { return new CertifiedKeyPair(this.keyFactory.fromPKCS8(key), getCertificateFactory().decode(cert)); } } catch (Exception e) { throw new KeyStoreException("Failed to retrieved private key from [" + store + "]"); } }
oldObject.getStringValue("userName")); newObject.setLargeStringValue(WikiCandidateMemberClassInitializer.FIELD_USER_COMMENT, oldObject.getLargeStringValue("userComment")); newObject.setStringValue(WikiCandidateMemberClassInitializer.FIELD_ADMIN, oldObject.getStringValue("reviewer")); newObject.setLargeStringValue(WikiCandidateMemberClassInitializer.FIELD_ADMIN_COMMENT, oldObject.getLargeStringValue("reviewerComment")); newObject.setLargeStringValue(WikiCandidateMemberClassInitializer.FIELD_ADMIN_PRIVATE_COMMENT, oldObject.getLargeStringValue("reviewerPrivateComment")); newObject.setDateValue(WikiCandidateMemberClassInitializer.FIELD_DATE_OF_CREATION, oldObject.getDateValue("date"));
byte[] key = getEncoder().decode(pkObj.getLargeStringValue(PRIVATEKEYCLASS_PROP_KEY));