You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/09/29 16:25:43 UTC

[isis] branch master updated: ISIS-2439: adds adoc on how to override SecMan default schema

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new d11d21a  ISIS-2439: adds adoc on how to override SecMan default schema
d11d21a is described below

commit d11d21a693bab989487735cd9dcd942e4aea85c8
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Sep 29 18:25:29 2020 +0200

    ISIS-2439: adds adoc on how to override SecMan default schema
---
 .../adoc/modules/secman/pages/jdo-persistence.adoc | 60 +++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

diff --git a/extensions/security/secman/adoc/modules/secman/pages/jdo-persistence.adoc b/extensions/security/secman/adoc/modules/secman/pages/jdo-persistence.adoc
index 0b8e054..c3ac4a8 100644
--- a/extensions/security/secman/adoc/modules/secman/pages/jdo-persistence.adoc
+++ b/extensions/security/secman/adoc/modules/secman/pages/jdo-persistence.adoc
@@ -4,4 +4,62 @@
 :page-partial:
 
 
-TODO: to document
+TODO: (more) to document
+
+== Overriding JDO Annotations (Schema and Table)
+
+JDO entity classes for _SecMan_ come preconfigured with *schema* and *table* names.
+
+For example:
+
+[source,java]
+----
+@javax.jdo.annotations.PersistenceCapable( ...
+        schema = "isisExtensionsSecman",
+        table = "ApplicationUser")
+public class ApplicationUser ... { /* ... */ }
+----
+
+We can override these with custom values by specifying a *.orm* file.
+
+For example, overriding the destination database name to be *'secman'*:
+
+[source,xml]
+.META-INF/package-secman.orm
+----
+<?xml version="1.0" encoding="UTF-8" ?>
+<orm xmlns="http://xmlns.jcp.org/xml/ns/jdo/orm"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/orm http://xmlns.jcp.org/xml/ns/jdo/orm_3_0.xsd">
+
+	<package name="org.apache.isis.extensions.secman.jdo.dom.permission">
+		<class name="ApplicationPermission" schema="secman"/>
+	</package>
+	
+	<package name="org.apache.isis.extensions.secman.jdo.dom.role">
+		<class name="ApplicationRole" schema="secman"/>
+	</package>
+	
+	<package name="org.apache.isis.extensions.secman.jdo.dom.tenancy">
+		<class name="ApplicationTenancy" schema="secman"/>
+	</package>
+	
+	<package name="org.apache.isis.extensions.secman.jdo.dom.user">
+		<class name="ApplicationUser" schema="secman"/>
+	</package>
+    
+</orm>
+----  
+
+This *.orm* file can then be activated with a DataNucleus configuration entry:
+
+[source,yml]
+.application.yml
+----
+isis:
+  persistence:
+    jdo-datanucleus:
+      impl:
+        datanucleus:
+          mapping: secman
+----
\ No newline at end of file