From: Richard Millet Date: Wed, 18 May 2011 05:01:58 +0000 (+0000) Subject: CSPACE-3451: Added a "delta" binding to the Hearst museum binding for a "natural_hist... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=f920b2ebd6da6e6e7a467d053c8f804dc053990e;p=tmp%2Fjakarta-migration.git CSPACE-3451: Added a "delta" binding to the Hearst museum binding for a "natural_history" part on the CollectionSpace record. This *was* part of the prototype binding, but I removed it from there and put it into the Hearst delta bindings as an example of how to customize a tenancy. --- diff --git a/services/authorization-mgt/import/pom.xml b/services/authorization-mgt/import/pom.xml index 4c63ff957..ccbc9679c 100644 --- a/services/authorization-mgt/import/pom.xml +++ b/services/authorization-mgt/import/pom.xml @@ -13,6 +13,7 @@ org.collectionspace.services.authorization-mgt.import services.authorization-mgt.import + false 3.0.0.RELEASE 3.0.2.RELEASE @@ -146,6 +147,8 @@ org.collectionspace.ImportAuthz + -g + ${generate_only} -u SPRING_ADMIN -p diff --git a/services/authorization-mgt/import/src/main/java/org/collectionspace/ImportAuthz.java b/services/authorization-mgt/import/src/main/java/org/collectionspace/ImportAuthz.java index 3d53943ca..72bf14356 100644 --- a/services/authorization-mgt/import/src/main/java/org/collectionspace/ImportAuthz.java +++ b/services/authorization-mgt/import/src/main/java/org/collectionspace/ImportAuthz.java @@ -41,6 +41,7 @@ import org.collectionspace.services.authorization.driver.AuthorizationSeedDriver */ public class ImportAuthz { + final private static String OPTIONS_GENERATE_ONLY = "generate only"; final private static String OPTIONS_USERNAME = "username"; final private static String OPTIONS_PASSWORD = "password"; final private static String OPTIONS_TENANT_BINDING = "tenant binding file"; @@ -50,6 +51,13 @@ public class ImportAuthz { final private static String MSG_SEPARATOR = "--"; + final private static boolean generateOnly(String param) { + boolean result = false; + if (param != null) { + result = Boolean.parseBoolean(param); + } + return result; + } public static void main(String[] args) { Options options = createOptions(); @@ -62,6 +70,7 @@ public class ImportAuthz { printUsage(); System.exit(1); } + String generate_only = line.getOptionValue("g"); String user = line.getOptionValue("u"); String password = line.getOptionValue("p"); String tenantBinding = line.getOptionValue("b"); @@ -73,7 +82,15 @@ public class ImportAuthz { AuthorizationSeedDriver driver = new AuthorizationSeedDriver( user, password, tenantBinding, exportDir); driver.generate(); - driver.seed(); + // + // If the "-g" option was set, then we will NOT seed the AuthZ tables. Instead, we'll + // just merge the prototypical tenant bindings and generate the permissions XML output + // + if (generateOnly(generate_only) == false) { + driver.seed(); + } { + System.out.println("WARNING: '-g' was set to 'true' so AuthZ tables were not seeded."); + } } catch (ParseException exp) { // oops, something went wrong System.err.println("Parsing failed. Reason: " + exp.getMessage()); @@ -101,6 +118,7 @@ public class ImportAuthz { private static Options createOptions() { Options options = new Options(); + options.addOption("g", true, OPTIONS_GENERATE_ONLY); options.addOption("u", true, OPTIONS_USERNAME); options.addOption("p", true, OPTIONS_PASSWORD); options.addOption("b", true, OPTIONS_TENANT_BINDING); @@ -113,6 +131,7 @@ public class ImportAuthz { StringBuilder sb = new StringBuilder(); sb.append("\nUsage : java -cp " + ImportAuthz.class.getName() + " "); sb.append("\nOptions :"); + sb.append("\n -g <" + OPTIONS_GENERATE_ONLY + "> generate only, do not seed AuthZ values in the security tables"); sb.append("\n -u <" + OPTIONS_USERNAME + "> cspace username"); sb.append("\n -p <" + OPTIONS_PASSWORD + "> password"); sb.append("\n -b <" + OPTIONS_TENANT_BINDING + "> tenant binding file (fully qualified path)"); diff --git a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java index 037820678..3d1ddc0f4 100644 --- a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java +++ b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java @@ -633,6 +633,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { Assert.assertNotNull(dimensionsGroups.get(0)); Assert.assertNotNull(dimensionsGroups.get(0).getMeasuredPart()); + /* No longer part of the "default" domain service tests for the CollectionObject record. if (logger.isDebugEnabled()) { logger.debug(testName + ": Reading Natural History part ..."); } @@ -641,6 +642,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { // can add specific field-level checks as warranted. Object conh = extractPartValue(testName, res, getNHPartName()); Assert.assertNotNull(conh); + */ } // Failure outcomes diff --git a/services/common/src/main/cspace/config/services/tenants/XMLMerge-ReferenceDoc.pdf b/services/common/src/main/cspace/config/services/tenants/XMLMerge-ReferenceDoc.pdf new file mode 100644 index 000000000..f587b5960 Binary files /dev/null and b/services/common/src/main/cspace/config/services/tenants/XMLMerge-ReferenceDoc.pdf differ diff --git a/services/common/src/main/cspace/config/services/tenants/hearstmuseum/tenant-bindings.delta.xml b/services/common/src/main/cspace/config/services/tenants/hearstmuseum/tenant-bindings.delta.xml index 6e49aff2c..0bb7dd538 100644 --- a/services/common/src/main/cspace/config/services/tenants/hearstmuseum/tenant-bindings.delta.xml +++ b/services/common/src/main/cspace/config/services/tenants/hearstmuseum/tenant-bindings.delta.xml @@ -4,7 +4,19 @@ xmlns:tenant='http://collectionspace.org/services/common/tenant'> + + + + + + + + + + + + diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml index 60f83a20a..37597ff15 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml @@ -28,7 +28,7 @@ en - + @@ -40,10 +40,10 @@ - + - + /collectionobjects/*/workflow/