/** * Locally adds the property name and value to the current * properties for the document. * @param name the namespaced QName identifying the property * @param value the value of the property * @return the document metadata handle */ public DocumentMetadataHandle withProperty(QName name, Object value) { getProperties().put(name, value); return this; } /**
/** * Locally adds the property name and value to the current * properties for the document. * @param name the simple string name identifying the property * @param value the value of the property * @return the document metadata handle */ public DocumentMetadataHandle withProperty(String name, Object value) { getProperties().put(name, value); return this; }
/** * Locally adds the property name and value to the current * properties for the document. * @param name the simple string name identifying the property * @param value the value of the property * @return the document metadata handle */ public DocumentMetadataHandle withProperty(String name, Object value) { getProperties().put(name, value); return this; }
/** * Locally adds the property name and value to the current * properties for the document. * @param name the namespaced QName identifying the property * @param value the value of the property * @return the document metadata handle */ public DocumentMetadataHandle withProperty(QName name, Object value) { getProperties().put(name, value); return this; } /**
public DocumentMetadataHandle setUpdatedMetadataProperties() { // create and initialize a handle on the metadata DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); metadataHandle.getProperties().put("reviewed", false); metadataHandle.getProperties().put("myString", "bar"); metadataHandle.getProperties().put("myInteger", 20); metadataHandle.getProperties().put("myDecimal", 3459.012678); metadataHandle.getProperties().put("myCalendar", Calendar.getInstance().get(Calendar.YEAR)); metadataHandle.setQuality(12); return metadataHandle; }
public DocumentMetadataHandle setUpdatedMetadataCollections() { // create and initialize a handle on the metadata DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle().withCollections("my-collection3", "my-collection4"); // 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; }
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 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; }
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(boolean update) { // create and initialize a handle on the meta-data DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); if (update) { metadataHandle.getCollections().addAll("updateCollection"); metadataHandle.getProperties().put("published", true); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.setQuality(99); } else { metadataHandle.getCollections().addAll("insertCollection"); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ, Capability.EXECUTE); metadataHandle.setQuality(11); } 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)); return metadataHandle; }
public DocumentMetadataHandle setMetadata(boolean update) { // create and initialize a handle on the meta-data DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); if (update) { metadataHandle.getCollections().addAll("updateCollection"); metadataHandle.getProperties().put("published", true); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ); metadataHandle.setQuality(99); } else { metadataHandle.getCollections().addAll("insertCollection"); metadataHandle.getProperties().put("reviewed", true); metadataHandle.getPermissions().add("app-user", Capability.UPDATE, Capability.READ, Capability.EXECUTE); metadataHandle.setQuality(11); } 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)); return metadataHandle; }
public void validateDefaultMetadata(DocumentMetadataHandle mh) { // get metadata values DocumentProperties properties = mh.getProperties(); DocumentPermissions permissions = mh.getPermissions(); DocumentCollections collections = mh.getCollections(); // Properties String actualProperties = getDocumentPropertiesString(properties); boolean result = actualProperties.contains("size:1|"); System.out.println(actualProperties + result); assertTrue("Document default last modified properties count1?", result); // Permissions String actualPermissions = getDocumentPermissionsString(permissions); assertTrue("Document permissions difference in size value", actualPermissions.contains("size:5")); assertTrue("Document permissions difference in flexrep-eval permission", actualPermissions.contains("flexrep-eval:[READ]")); assertTrue("Document permissions difference in rest-reader permission", actualPermissions.contains("rest-reader:[READ]")); assertTrue("Document permissions difference in rest-writer permission", actualPermissions.contains("rest-writer:[UPDATE]")); assertTrue("Document permissions difference in harmonized-updater permission", actualPermissions.contains("harmonized-updater:[UPDATE]")); assertTrue("Document permissions difference in harmonized-reader permission", actualPermissions.contains("harmonized-reader:[READ]")); // Collections String expectedCollections = "size:1|http://permission-collections/|"; String actualCollections = getDocumentCollectionsString(collections); assertEquals("Document collections difference", expectedCollections, actualCollections); }