cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1177230 - in /cayenne/main/trunk/docs/docbook: getting-started-rop/src/docbkx/authentification.xml getting-started-rop/src/docbkx/web-service.xml getting-started/src/docbkx/object-relational-mapping.xml getting-started/src/docbkx/webapp.xml
Date Thu, 29 Sep 2011 09:07:24 GMT
Author: dkazimirchyk
Date: Thu Sep 29 09:07:24 2011
New Revision: 1177230

URL: http://svn.apache.org/viewvc?rev=1177230&view=rev
Log:
Docbook: updating code samples

Modified:
    cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/authentification.xml
    cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/web-service.xml
    cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/object-relational-mapping.xml
    cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/webapp.xml

Modified: cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/authentification.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/authentification.xml?rev=1177230&r1=1177229&r2=1177230&view=diff
==============================================================================
--- cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/authentification.xml (original)
+++ cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/authentification.xml Thu
Sep 29 09:07:24 2011
@@ -83,42 +83,36 @@
     <section xml:id="running-client">
         <title>Running Client with Basic Authentication</title>
         <para>If you run the client without any changes, you'll get the following error:</para>
-        <programlisting>Jan 16, 2010 6:09:03 PM org.apache.cayenne.remote.hessian.HessianConnection
connect
+        <programlisting>Sep 29, 2011 11:58:09 AM org.apache.cayenne.remote.hessian.HessianConnection
connect
 INFO: Connecting to [http://localhost:8080/tutorial/cayenne-service] - dedicated session.
-Jan 16, 2010 6:09:03 PM org.apache.cayenne.remote.hessian.HessianConnection connect
+Sep 29, 2011 11:58:09 AM org.apache.cayenne.remote.hessian.HessianConnection connect
 INFO: Error establishing remote session. URL - http://localhost:8080/tutorial/cayenne-service;

-CAUSE - cannot retry due to server authentication, in streaming mode
+      CAUSE - cannot retry due to server authentication, in streaming mode
 java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode
-	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1034)
-	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
+	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1257)
+	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
 	at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:168)
 	at $Proxy0.establishSession(Unknown Source)
 	at org.apache.cayenne.remote.hessian.HessianConnection.connect(HessianConnection.java:210)
 	at org.apache.cayenne.remote.hessian.HessianConnection.getServerEventBridge(HessianConnection.java:114)
-	at org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:256)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:94)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:76)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:71)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:67)
-	at org.example.cayenne.persistent.client.Main.main(Main.java:25)
-Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.3.0RC1 Jan 05 2010
14:44:59] Error 
-establishing remote session. URL - http://localhost:8080/tutorial/cayenne-service; 
+	at org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:337)
+	at org.apache.cayenne.remote.ClientChannel.&lt;init>(ClientChannel.java:108)
+	at org.example.cayenne.Main.main(Main.java:25)
+Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.3.1M3 Sep 19 2011
07:12:41] 
+Error establishing remote session. URL - http://localhost:8080/tutorial/cayenne-service;

 CAUSE - cannot retry due to server authentication, in streaming mode
 	at org.apache.cayenne.remote.hessian.HessianConnection.connect(HessianConnection.java:229)
 	at org.apache.cayenne.remote.hessian.HessianConnection.getServerEventBridge(HessianConnection.java:114)
-	at org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:256)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:94)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:76)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:71)
-	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:67)
-	at org.example.cayenne.persistent.client.Main.main(Main.java:25)
+	at org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:337)
+	at org.apache.cayenne.remote.ClientChannel.&lt;init>(ClientChannel.java:108)
+	at org.example.cayenne.Main.main(Main.java:25)
 Caused by: java.net.HttpRetryException: cannot retry due to server authentication, in streaming
mode
-	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1034)
-	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
+	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1257)
+	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
 	at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:168)
 	at $Proxy0.establishSession(Unknown Source)
 	at org.apache.cayenne.remote.hessian.HessianConnection.connect(HessianConnection.java:210)
-	... 7 more</programlisting>
+	... 4 more</programlisting>
         <para>Which is exactly what you'd expect, as the client is not authenticating
itself. So
             change the line in Main.java where we obtained an ROP connection to this:</para>
         <programlisting>ClientConnection connection = new HessianConnection(

Modified: cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/web-service.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/web-service.xml?rev=1177230&r1=1177229&r2=1177230&view=diff
==============================================================================
--- cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/web-service.xml (original)
+++ cayenne/main/trunk/docs/docbook/getting-started-rop/src/docbkx/web-service.xml Thu Sep
29 09:07:24 2011
@@ -72,21 +72,22 @@
         <para>Cayenne web service is declared in the web.xml. It is implemented as
a servlet
             "org.apache.cayenne.configuration.rop.server.ROPHessianServlet". Open
             tutorial/src/main/webapp/WEB-INF/web.xml in Eclipse and add a service declaration:
</para>
-        <programlisting>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+        <programlisting>&lt;?xml version="1.0" encoding="utf-8"?>
  &lt;!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-   "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;
-&lt;web-app&gt;
-	&lt;display-name&gt;Cayenne Tutorial&lt;/display-name&gt;
-	&lt;servlet&gt;
-		&lt;servlet-name&gt;cayenne-project&lt;/servlet-name&gt;
-		&lt;servlet-class&gt;org.apache.cayenne.configuration.rop.server.ROPHessianServlet&lt;/servlet-class&gt;
-	&lt;/servlet&gt;
-	&lt;servlet-mapping&gt;
-		&lt;servlet-name&gt;cayenne-project&lt;/servlet-name&gt;
-		&lt;url-pattern&gt;/cayenne-service&lt;/url-pattern&gt;
-	&lt;/servlet-mapping&gt;
-&lt;/web-app&gt;</programlisting>
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+&lt;web-app>
+	&lt;display-name>Cayenne Tutorial&lt;/display-name>
+	&lt;servlet>
+		&lt;servlet-name>cayenne-project&lt;/servlet-name>
+		&lt;servlet-class>org.apache.cayenne.configuration.rop.server.ROPHessianServlet&lt;/servlet-class>
+        &lt;load-on-startup>0&lt;/load-on-startup>
+	&lt;/servlet>
+	&lt;servlet-mapping>
+		&lt;servlet-name>cayenne-project&lt;/servlet-name>
+		&lt;url-pattern>/cayenne-service&lt;/url-pattern>
+	&lt;/servlet-mapping>
+&lt;/web-app></programlisting>
         <informaltable class="noteMacro" border="1">
             <col width="4%"/>
             <col width="96%"/>
@@ -131,8 +132,7 @@ INFO: loading user name and password.
 INFO: Created connection pool: jdbc:derby:memory:testdb;create=true
 	Driver class: org.apache.derby.jdbc.EmbeddedDriver
 	Min. connections in the pool: 1
-	Max. connections in the pool: 1
-</programlisting>
+	Max. connections in the pool: 1</programlisting>
         <para>Cayenne ROP service URL is <emphasis role="italic"
                 >http://localhost:8080/tutorial/cayenne-service</emphasis>. If you
click on it, you
             will see "Hessian Requires POST" message, that means that the service is alive,
but you

Modified: cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/object-relational-mapping.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/object-relational-mapping.xml?rev=1177230&r1=1177229&r2=1177230&view=diff
==============================================================================
--- cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/object-relational-mapping.xml
(original)
+++ cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/object-relational-mapping.xml
Thu Sep 29 09:07:24 2011
@@ -38,13 +38,12 @@
             by adding the ARTIST table. Database tables are called <emphasis role="bold"
                 >"DbEntities"</emphasis> in Cayenne mapping (those can be actual
tables or database
             views). </para>
-        <para>Select "UntitledDomainMap" on the left-hand side project tree and click
"Create
-            DbEntity" button (or use "Project &gt; Create DbEntity" menu). A new DbEntity
is
-            created. In "DbEntity Name" field enter "ARTIST". Then click on "Create Attribute"
-            button on the entity toolbar (third button from the left). This action changes
the view
-            to the "Attribute" tab and adds a new attribute (attribute means a "table column"
in
-            this case) called "untitledAttr". Let's rename it to ID, make it an INTEGER and
make it
-            a PK:</para>
+        <para>Select "datamap" on the left-hand side project tree and click "Create
DbEntity" button
+            (or use "Project &gt; Create DbEntity" menu). A new DbEntity is created.
In "DbEntity
+            Name" field enter "ARTIST". Then click on "Create Attribute" button on the entity
+            toolbar (third button from the left). This action changes the view to the "Attribute"
+            tab and adds a new attribute (attribute means a "table column" in this case)
called
+            "untitledAttr". Let's rename it to ID, make it an INTEGER and make it a PK:</para>
         <para><inlinemediaobject>
                 <imageobject>
                     <imagedata fileref="images/modeler-artistid.png" scalefit="1" width="100%"/>

Modified: cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/webapp.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/webapp.xml?rev=1177230&r1=1177229&r2=1177230&view=diff
==============================================================================
--- cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/webapp.xml (original)
+++ cayenne/main/trunk/docs/docbook/getting-started/src/docbkx/webapp.xml Thu Sep 29 09:07:24
2011
@@ -210,74 +210,63 @@
                     Jetty plugin to download all dependencies, but eventually you'll see
the logs
                     like this:</para>
         <programlisting>[INFO] Scanning for projects...
+[INFO]                                                                         
 [INFO] ------------------------------------------------------------------------
-[INFO] Building Unnamed - org.example.cayenne:tutorial:jar:0.0.1-SNAPSHOT
-[INFO] 
-[INFO] Id: org.example.cayenne:tutorial:jar:0.0.1-SNAPSHOT
-[INFO] task-segment: [jetty:run]
+[INFO] Building tutorial 0.0.1-SNAPSHOT
 [INFO] ------------------------------------------------------------------------
 ...
-[INFO] [jetty:run]
-[INFO] Configuring Jetty for project: Unnamed - org.example.cayenne:tutorial:jar:0.0.1-SNAPSHOT
-[INFO] Webapp source directory = /.../tutorial/Desktop/work/tutorial/src/main/webapp
-...
+[INFO] Configuring Jetty for project: tutorial
+[INFO] Webapp source directory = /.../tutorial/src/main/webapp
+[INFO] Reload Mechanic: automatic
+[INFO] Classes = /.../tutorial/target/classes
+[INFO] Context path = /tutorial
+[INFO] Tmp directory =  determined at runtime
+[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
+[INFO] Web overrides =  none
+[INFO] web.xml file = /.../tutorial/src/main/webapp/WEB-INF/web.xml
+[INFO] Webapp directory = /.../tutorial/src/main/webapp
 [INFO] Starting jetty 6.1.22 ...
-2009-12-22 14:08:06.301::INFO:  jetty-6.1.22
-2009-12-22 14:08:06.474::INFO:  No Transaction manager found - if your webapp requires one,
please configure one.
-INFO: started configuration loading.
-INFO: loaded domain: UntitledDomain
-INFO: loaded &lt;map name='UntitledDomainMap' location='UntitledDomainMap.map.xml'&gt;.
-INFO: loading &lt;node name='UntitledDomainNode' datasource='UntitledDomainNode.driver.xml'

-factory='org.apache.cayenne.conf.DriverDataSourceFactory' schema-update-
-strategy='org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy'&gt;.
-INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
-INFO: loading driver information from 'UntitledDomainNode.driver.xml'.
-INFO: loading driver org.apache.derby.jdbc.EmbeddedDriver
-INFO: loading user name and password.
-INFO: Created connection pool: jdbc:derby:memory:testdb;create=true 
-    Driver class: org.apache.derby.jdbc.EmbeddedDriver
-    Min. connections in the pool: 1
-    Max. connections in the pool: 1
-INFO: loaded datasource.
-INFO: no adapter set, using automatic adapter.
-INFO: loaded map-ref: UntitledDomainMap.
-INFO: finished configuration loading in 355 ms.
-2009-12-22 14:08:07.081::INFO:  Started SelectChannelConnector@0.0.0.0:8080
+2011-09-29 11:34:59.253:INFO::jetty-6.1.22
+2011-09-29 11:34:59.406:INFO::No Transaction manager found - if your webapp requires one,
please configure one.
+2011-09-29 11:34:59.669:INFO::Started SelectChannelConnector@0.0.0.0:8080
 [INFO] Started Jetty Server</programlisting>
                 </listitem>
         </itemizedlist>
         <itemizedlist>
         <listitem>
-                <para>So the Jetty container just started and loaded Cayenne.</para>
+                <para>So the Jetty container just started.</para>
             </listitem>
             <listitem>
                 <para>Now go to <emphasis role="italic">http://localhost:8080/tutorial/</emphasis>
                             URL. You should see "No artists found message" in the web browser
and
                             the following output in the Eclipse console:</para>
-        <programlisting>INFO: --- will run 1 query.
-INFO: Opening connection: jdbc:derby:memory:testdb;create=true 
-    Login: null
-    Password: *******
+        <programlisting>INFO: Loading XML configuration resource from file:/.../tutorial/target/classes/cayenne-project.xml
+INFO: loading user name and password.
+INFO: Created connection pool: jdbc:derby:memory:testdb;create=true
+	Driver class: org.apache.derby.jdbc.EmbeddedDriver
+	Min. connections in the pool: 1
+	Max. connections in the pool: 1
+INFO: Opening connection: jdbc:derby:memory:testdb;create=true
+	Login: null
+	Password: *******
 INFO: +++ Connecting: SUCCESS.
-INFO: --- transaction started.
 INFO: Detected and installed adapter: org.apache.cayenne.dba.derby.DerbyAdapter
+INFO: --- transaction started.
 INFO: No schema detected, will create mapped tables
-INFO: CREATE TABLE GALLERY (ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY, 
-NAME VARCHAR (200), PRIMARY KEY (ID))
-INFO: CREATE TABLE ARTIST (DATE_OF_BIRTH DATE, ID INTEGER NOT NULL GENERATED 
-BY DEFAULT AS IDENTITY, NAME VARCHAR (200), PRIMARY KEY (ID))
-INFO: CREATE TABLE PAINTING (ARTIST_ID INTEGER, GALLERY_ID INTEGER, 
-ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY, NAME VARCHAR (200), PRIMARY KEY (ID))
+INFO: CREATE TABLE GALLERY (ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID))
+INFO: CREATE TABLE ARTIST (DATE_OF_BIRTH DATE, ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY
KEY (ID))
+INFO: CREATE TABLE PAINTING (ARTIST_ID INTEGER, GALLERY_ID INTEGER, ID INTEGER NOT NULL,

+      NAME VARCHAR (200), PRIMARY KEY (ID))
 INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST (ID)
 INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID)
-INFO: CREATE TABLE AUTO_PK_SUPPORT (
-  TABLE_NAME CHAR(100) NOT NULL,  NEXT_ID BIGINT NOT NULL,  PRIMARY KEY(TABLE_NAME))
+INFO: CREATE TABLE AUTO_PK_SUPPORT (  
+      TABLE_NAME CHAR(100) NOT NULL,  NEXT_ID BIGINT NOT NULL,  PRIMARY KEY(TABLE_NAME))
 INFO: DELETE FROM AUTO_PK_SUPPORT WHERE TABLE_NAME IN ('ARTIST', 'GALLERY', 'PAINTING')
 INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('ARTIST', 200)
 INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('GALLERY', 200)
 INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('PAINTING', 200)
-INFO: SELECT t0.DATE_OF_BIRTH, t0.ID, t0.NAME FROM ARTIST t0 ORDER BY t0.NAME - prepared
in 35 ms.
-INFO: === returned 0 rows. - took 53 ms.
+INFO: SELECT t0.DATE_OF_BIRTH, t0.NAME, t0.ID FROM ARTIST t0 ORDER BY t0.NAME - prepared
in 43 ms.
+INFO: === returned 0 rows. - took 56 ms.
 INFO: +++ transaction committed.</programlisting>
             </listitem>
         </itemizedlist>



Mime
View raw message