incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1050012 - in /incubator/isis/trunk: applib/src/docbkx/guide/ core/src/docbkx/guide/ src/site/apt/TOREVIEW/
Date Thu, 16 Dec 2010 15:44:25 GMT
Author: danhaywood
Date: Thu Dec 16 15:44:24 2010
New Revision: 1050012

URL: http://svn.apache.org/viewvc?rev=1050012&view=rev
Log:
moving some notes into isis-applib.xml (ISIS-21)

Added:
    incubator/isis/trunk/src/site/apt/TOREVIEW/TODO_online-demo.apt
      - copied unchanged from r1049824, incubator/isis/trunk/src/site/apt/TOREVIEW/online-demo.apt
Removed:
    incubator/isis/trunk/src/site/apt/TOREVIEW/gotchas.apt
    incubator/isis/trunk/src/site/apt/TOREVIEW/notes-on-profiles-via-commandline.apt
    incubator/isis/trunk/src/site/apt/TOREVIEW/online-demo.apt
Modified:
    incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml
    incubator/isis/trunk/core/src/docbkx/guide/isis-core.xml

Modified: incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml?rev=1050012&r1=1050011&r2=1050012&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml (original)
+++ incubator/isis/trunk/applib/src/docbkx/guide/isis-applib.xml Thu Dec 16 15:44:24 2010
@@ -70,7 +70,7 @@
     <emphasis>Apache Isis</emphasis> application library (or
     <emphasis>applib</emphasis>), in order that the framework can correctly
     pick up and render the business rules and logic encoded within their
-    domain objects. </para>
+    domain objects.</para>
   </preface>
 
   <!-- main content -->
@@ -4034,9 +4034,9 @@ isis.fixtures= ClaimsFixture,LogOnAsCliv
         <sect2>
           <title><methodname>SwitchUserFixture</methodname></title>
 
-          <para>The SwitchUserFixture provides an alternative to
-          <classname>AbstractFixture</classname>, just allowing the current
-          user to be switched.</para>
+          <para>The <classname>SwitchUserFixture</classname> provides an
+          alternative to <classname>AbstractFixture</classname>, just allowing
+          the current user to be switched.</para>
 
           <para>The main difference is one of style;
           <classname>SwitchUserFixture</classname> can be used in a
@@ -4051,6 +4051,74 @@ isis.fixtures= ClaimsFixture,LogOnAsCliv
 
           <para>A fixture in this style could then be used within a composite
           fixture hierarchy.</para>
+
+          <warning>
+            <para>Do be aware of when you call switchUser() in a
+            <classname>Fixture</classname> as it causes the current
+            transaction to be ended and a new one started (for the new user).
+            If you share a reference between the two you will get an
+            exception.</para>
+
+            <para>For example:</para>
+
+            <programlisting>Account account = accounts.createAccount(
+    "ACME", "Peter Planner", "pplanner@acme.com");
+Participant peterPlanner = account.getAdmin();
+        
+switchUser("pplanner@acme.com", new String[0]);
+
+Work work = plan1.createWork();
+BcpPlan plan = (BcpPlan) work.getTarget();
+plan.getOwner().modifyLeader(peterPlanner);</programlisting>
+
+            <para>This will fail because <varname>peterPlanner</varname>
+            reference is no longer valid after the switch user.</para>
+
+            <para>The solution is to retrieve the object again so it is part
+            of the second transaction. In this example we can change to code
+            to this:</para>
+
+            <programlisting>accounts.createAccount("ACME", "Peter Planner", "pplanner@acme.com");
+        
+switchUser("pplanner@acme.com", new String[0]);
+
+Account account = uniqueMatch(Account.class, "0 ACME");
+Participant peterPlanner = account.getAdmin();
+
+Work work = plan1.createWork();
+BcpPlan plan = (BcpPlan) work.getTarget();
+plan.getOwner().modifyLeader(peterPlanner);
+</programlisting>
+          </warning>
+
+          <sect3>
+            <title>Gotchas</title>
+
+            <para> like this. The fixture code shared the
+            &lt;&lt;&lt;Participant&gt;&gt;&gt; object between the
two
+            transactions when coded like this: +---------- Account account =
+            accounts.createAccount("ACME", "Peter Planner",
+            "pplanner@acme.com"); Participant peterPlanner =
+            account.getAdmin(); switchUser("pplanner@acme.com", new
+            String[0]); Work work = plan1.createWork(); BcpPlan plan =
+            (BcpPlan) work.getTarget();
+            plan.getOwner().modifyLeader(peterPlanner); +---------- To resolve
+            the problem you will need to retrieve the object again so it is
+            part of the second transaction. In this example we can change to
+            code to this: +---------- accounts.createAccount("ACME", "Peter
+            Planner", "pplanner@acme.com"); switchUser("pplanner@acme.com",
+            new String[0]); Account account = uniqueMatch(Account.class, "0
+            ACME"); Participant peterPlanner = account.getAdmin(); Work work =
+            plan1.createWork(); BcpPlan plan = (BcpPlan) work.getTarget();
+            plan.getOwner().modifyLeader(peterPlanner); +---------- An
+            alternative is to force this separation by putting the switch call
+            into a separate fixture, as you now have no choice but to look it
+            up. * Deployment limitations of using switch user Switch user will
+            only work in exploration and prototype mode. To make it run on the
+            server (ie using Tomcat) I changed the deployment type by adding
+            the following to the isis.properties file: --------
+            isis.deploymentType=prototype --------- </para>
+          </sect3>
         </sect2>
 
         <sect2>
@@ -4764,7 +4832,7 @@ Element customerXsd = snapshot.getXsdEle
 
       <para>In order to be recognized, all methods must be
       <code>public</code>. Any methods that do not match are deemed to be
-      action methods that the user can invoke from the user interface. </para>
+      action methods that the user can invoke from the user interface.</para>
     </appendix>
 
     <appendix>

Modified: incubator/isis/trunk/core/src/docbkx/guide/isis-core.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/src/docbkx/guide/isis-core.xml?rev=1050012&r1=1050011&r2=1050012&view=diff
==============================================================================
--- incubator/isis/trunk/core/src/docbkx/guide/isis-core.xml (original)
+++ incubator/isis/trunk/core/src/docbkx/guide/isis-core.xml Thu Dec 16 15:44:24 2010
@@ -4192,76 +4192,83 @@ Persistable: User Persistable</screen>
         behaviour it can offer, and to find other information such as the
         object's title, a suggested order of it fields, when the actions can
         or can't be used. The details about this interface are recorded in an
-        instance of <classname>ObjectSpecification</classname>. As each class
of
-        domain object is loaded into the system introspection is performed and
-        an instance of <classname>ObjectSpecification</classname> is generated.
That
-        specification object is subsequently available from any object adapter
-        (using the <methodname>ObjectAdapter.getSpecification</methodname> method)
for
+        instance of <classname>ObjectSpecification</classname>. As each class
+        of domain object is loaded into the system introspection is performed
+        and an instance of <classname>ObjectSpecification</classname> is
+        generated. That specification object is subsequently available from
+        any object adapter (using the
+        <methodname>ObjectAdapter.getSpecification</methodname> method) for
         that type of domain object; or it can be retrieved directly, by name
-        or class, from the <classname>ObjectSpecificationLoader</classname> instance
-        (obtained from the <classname>Isis</classname> repository).</para>
-
-        <para>Through an object's <classname>ObjectSpecification</classname>
instance
-        the rest of the NOF can find out the fields that an object has, the
-        methods it offers, the title to use to identify the object, and other
-        details about the object. These are used normally used by the
-        implementations of ObjectAdapter etc when another component ask the
-        adapter for details about another object. For example For example the
-        statement <code>adapter.getField(no.getFields()[0])</code> would
+        or class, from the <classname>ObjectSpecificationLoader</classname>
+        instance (obtained from the <classname>Isis</classname>
+        repository).</para>
+
+        <para>Through an object's <classname>ObjectSpecification</classname>
+        instance the rest of the NOF can find out the fields that an object
+        has, the methods it offers, the title to use to identify the object,
+        and other details about the object. These are used normally used by
+        the implementations of ObjectAdapter etc when another component ask
+        the adapter for details about another object. For example For example
+        the statement <code>adapter.getField(no.getFields()[0])</code> would
         retrieve the first field in the domain object held by the [[NAME]]
         referenced by <code>adapter</code>.</para>
 
-	<sect2><title>How it Works</title>
+        <sect2>
+          <title>How it Works</title>
 
-        <para>When a domain object is used within the NOF the
-        <classname>ObjectSpecificationLoader</classname> instance is asked for
the
-        <classname>ObjectSpecification</classname> for the domain object's class
(by
-        name or <classname>java.lang.Class</classname> object). For performance
-        reasons these objects are normally cached and if the class has
-        previously been introspected then the cached version would be
-        returned. The first time that class is requested however the loader is
-        responsible for performing the introspection and creating a complete
-        <classname>ObjectSpecification</classname>.</para>
-
-        <para>For each field that the reflector recognises the loader creates
-        either a <classname>OneToOneAssociation</classname> object for a value
field
-        or a reference field, or a <classname>OneToManyAssociation</classname>
object
-        for a collection or array. Using the field objects the NOF can access
-        or change the values and references in the domain object. The fields
-        can also be used by the NOF to find out the field name, if the fields
-        are visible and whether it can be modified.</para>
-
-        <para>For each action method that the reflector recognises the loader
-        must create an <classname>Action</classname> object. Using the action
object
-        the NOF can invoke the method on the domain object. The action object
-        also can be used by the NOF to find out the action's name, whether it
-        is visible and whether it can be executed.</para>
-
-        <para>In addition to the fields and actions the specification must can
-        also: return the various forms of class name (singular; plural; short;
-        and full); retrieve a title from, or generate a title for, the domain
-        object; flag the type of object (abstract, lookup, object, value, and
-        whether persistable); refer to its superclass, any inteferfaces it
-        implements and any subclasses; and allow objects to marked/cleared as
-        being dirty.</para>
-	</sect2>
-
-	<sect2>
-        <title>Installation</title>
-
-        <para>To set up the NOF to use a reflection mechanism the
-        <classname>Isis</classname> repository must be given a
-        <classname>ObjectSpecificationLoader</classname> instance before the
-        repository is initialised. This can be done using the repository's
-        static <methodname>setSpecificationLoader</methodname> method. For example,
-        the following sets the NOF up to use the basic reflector.</para>
+          <para>When a domain object is used within the NOF the
+          <classname>ObjectSpecificationLoader</classname> instance is asked
+          for the <classname>ObjectSpecification</classname> for the domain
+          object's class (by name or <classname>java.lang.Class</classname>
+          object). For performance reasons these objects are normally cached
+          and if the class has previously been introspected then the cached
+          version would be returned. The first time that class is requested
+          however the loader is responsible for performing the introspection
+          and creating a complete
+          <classname>ObjectSpecification</classname>.</para>
+
+          <para>For each field that the reflector recognises the loader
+          creates either a <classname>OneToOneAssociation</classname> object
+          for a value field or a reference field, or a
+          <classname>OneToManyAssociation</classname> object for a collection
+          or array. Using the field objects the NOF can access or change the
+          values and references in the domain object. The fields can also be
+          used by the NOF to find out the field name, if the fields are
+          visible and whether it can be modified.</para>
+
+          <para>For each action method that the reflector recognises the
+          loader must create an <classname>Action</classname> object. Using
+          the action object the NOF can invoke the method on the domain
+          object. The action object also can be used by the NOF to find out
+          the action's name, whether it is visible and whether it can be
+          executed.</para>
+
+          <para>In addition to the fields and actions the specification must
+          can also: return the various forms of class name (singular; plural;
+          short; and full); retrieve a title from, or generate a title for,
+          the domain object; flag the type of object (abstract, lookup,
+          object, value, and whether persistable); refer to its superclass,
+          any inteferfaces it implements and any subclasses; and allow objects
+          to marked/cleared as being dirty.</para>
+        </sect2>
+
+        <sect2>
+          <title>Installation</title>
+
+          <para>To set up the NOF to use a reflection mechanism the
+          <classname>Isis</classname> repository must be given a
+          <classname>ObjectSpecificationLoader</classname> instance before the
+          repository is initialised. This can be done using the repository's
+          static <methodname>setSpecificationLoader</methodname> method. For
+          example, the following sets the NOF up to use the basic
+          reflector.</para>
 
-        <programlisting>ObjectSpecificationLoader loader = new
+          <programlisting>ObjectSpecificationLoader loader = new
         JavaSpecificationLoader();
         Isis.setSpecificationLoader(loader);</programlisting>
 
-        <para />
-	</sect2>
+          <para></para>
+        </sect2>
       </sect1>
 
       <sect1>
@@ -5930,6 +5937,22 @@ isis.fixtures = BookingsFixture, Perspec
 
         <para></para>
       </sect1>
+
+      <sect1>
+        <title></title>
+
+        <para></para>
+
+        <para>To store profiles (during exploration) for users the a profile
+        store must be specified. </para>
+
+        <para>On the command line use -e xml to store them in an XML. </para>
+
+        <para>Without this the profile will simply be kept in memory, and lost
+        on exit. </para>
+
+        <para></para>
+      </sect1>
     </chapter>
 
     <chapter id="chp.SecurityApi">



Mime
View raw message