private void generateDocs(DOMFace rootEle) throws Exception { DOMFace allDocs = rootEle.createChild("documents", DOMFace.class); for (AttachmentRecord att : ngp.getAllAttachments()) { // first check if this license has access if (att.getVisibility() == 1) { // public document, so everyone can get it } else if (isMember) { // members can access everything } else if (att.roleCanAccess(license.getRole())) { // license role has access } else { // no access, so skip to next attachment continue; } DOMFace oneDoc = allDocs.createChild("doc", DOMFace.class); oneDoc.setAttribute("id", att.getId()); oneDoc.setScalar("universalid", att.getUniversalId()); oneDoc.setScalar("name", att.getNiceName()); oneDoc.setScalar("size", Long.toString(att.getFileSize(ngp))); setScalarTime(oneDoc, "modifiedtime", att.getModifiedDate()); oneDoc.setScalar("modifieduser", att.getModifiedBy()); } }
private void generateNotes(DOMFace rootEle) throws Exception { DOMFace allNotes = rootEle.createChild("notes", DOMFace.class); for (NoteRecord lr : ngp.getAllNotes()) { if (lr.getVisibility() == 1) { // public note, so everyone can get it } else if (isMember) { // members can access everything } else { // no access, so skip to next attachment continue; } DOMFace oneNote = allNotes.createChild("note", DOMFace.class); oneNote.setAttribute("id", lr.getId()); oneNote.setScalar("universalid", lr.getUniversalId()); oneNote.setScalar("subject", lr.getSubject()); setScalarTime(oneNote, "modifiedtime", lr.getLastEdited()); oneNote.setScalar("modifieduser", lr.getLastEditedBy()); } }
private void generateGoals(DOMFace rootEle) throws Exception { @SuppressWarnings("unused") DOMFace allGoals = rootEle.createChild("goals", DOMFace.class); }