private void sendCollectionsImpl(XMLStreamWriter serializer) throws XMLStreamException { if ( getCollections() == null || getCollections().size() == 0 ) return; serializer.writeStartElement("rapi", "collections", REST_API_NS); for (String collection: getCollections()) { serializer.writeStartElement("rapi", "collection", REST_API_NS); serializer.writeCharacters(collection); serializer.writeEndElement(); } serializer.writeEndElement(); } private void sendPermissionsImpl(XMLStreamWriter serializer) throws XMLStreamException {
private void sendCollectionsImpl(XMLStreamWriter serializer) throws XMLStreamException { serializer.writeStartElement("rapi", "collections", REST_API_NS); for (String collection: getCollections()) { serializer.writeStartElement("rapi", "collection", REST_API_NS); serializer.writeCharacters(collection); serializer.writeEndElement(); } serializer.writeEndElement(); } private void sendPermissionsImpl(XMLStreamWriter serializer) throws XMLStreamException {
/** * Locally adds the collections to the current collections * for the document. * @param collections the document collections * @return the document metadata handle */ public DocumentMetadataHandle withCollections(String... collections) { getCollections().addAll(collections); return this; }
/** * Locally adds the collections to the current collections * for the document. * @param collections the document collections * @return the document metadata handle */ public DocumentMetadataHandle withCollections(String... collections) { getCollections().addAll(collections); return this; }
private void receiveCollectionsImpl(Document document) { DocumentCollections collections = getCollections(); collections.clear(); if (document == null) return; NodeList collectionsIn = document.getElementsByTagNameNS(REST_API_NS, "collection"); int collectionsInLength = collectionsIn.getLength(); for (int i=0; i < collectionsInLength; i++) { collections.add(collectionsIn.item(i).getTextContent()); } } private void receivePermissionsImpl(Document document) {
private void receiveCollectionsImpl(Document document) { DocumentCollections collections = getCollections(); collections.clear(); if (document == null) return; NodeList collectionsIn = document.getElementsByTagNameNS(REST_API_NS, "collection"); for (int i=0; i < collectionsIn.getLength(); i++) { collections.add(collectionsIn.item(i).getTextContent()); } } private void receivePermissionsImpl(Document document) {
public List<String> getCollections(String uri) { DocumentCollections colls = getMetadata(uri).getCollections(); return Arrays.asList(colls.toArray(new String[] {})); }
/** * @param moduleName appended to the baseUri to determine the model definition URI * @param modelDefinition JSON or XML * @return */ public String loadModel(String moduleName, String modelDefinition) { GenericDocumentManager mgr = client.newDocumentManager(); DocumentMetadataHandle dmh = new DocumentMetadataHandle(); dmh.getCollections().add(modelCollection); String modelUri = baseUri + moduleName; mgr.write(modelUri, dmh, new BytesHandle(modelDefinition.getBytes())); return modelUri; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the metadata DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the meta-data DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the meta-data DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the metadata DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the metadata DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the metadata DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the metadata DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
private void addFinalDocs() { clearDatabases(HubConfig.DEFAULT_STAGING_NAME, HubConfig.DEFAULT_FINAL_NAME); DocumentMetadataHandle meta = new DocumentMetadataHandle(); meta.getCollections().add("tester"); meta.getPermissions().add(getHubAdminConfig().getHubRoleName(), READ, UPDATE, EXECUTE); installFinalDoc("/employee1.xml", meta, "flow-manager-test/input/employee1.xml"); installFinalDoc("/employee2.xml", meta, "flow-manager-test/input/employee2.xml"); }
private void addStagingDocs() { clearDatabases(HubConfig.DEFAULT_STAGING_NAME, HubConfig.DEFAULT_FINAL_NAME); DocumentMetadataHandle meta = new DocumentMetadataHandle(); meta.getCollections().add("tester"); meta.getPermissions().add(getHubAdminConfig().getHubRoleName(), READ, UPDATE, EXECUTE); installStagingDoc("/employee1.xml", meta, "flow-manager-test/input/employee1.xml"); installStagingDoc("/employee2.xml", meta, "flow-manager-test/input/employee2.xml"); }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the meta-data DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the meta-data DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }
public DocumentMetadataHandle setMetadata() { // create and initialize a handle on the meta-data DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getCollections().addAll("my-collection1", "my-collection2"); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getProperties().put("myString", "foo"); metadataHandle.getProperties().put("myInteger", 10); metadataHandle.getProperties().put("myDecimal", 34.56678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(23); return metadataHandle; }