Update of /cvsroot/cayenne/cayenne/src/tutorials/cayenne-web-app/WEB-INF In directory usw-pr-cvs1:/tmp/cvs-serv26389/src/tutorials/cayenne-web-app/WEB-INF Added Files: cayenne.xml datamap.xml driverinfo.xml struts-config.xml web.xml Log Message: relocated tutorials to a subproject (old tutorials are still around but will be deleted soon) --- NEW FILE: cayenne.xml --- <?xml version="1.0" encoding="utf-8"?> <domains> <domain name="DefaultDomain"> <map name="datamap" location="datamap.xml"/> <node name="datanode" datasource="driverinfo.xml" adapter="org.objectstyle.cayenne.dba.mysql.MySQLAdapter" factory="org.objectstyle.cayenne.conf.DriverDataSourceFactory"> <map-ref name="datamap"/> </node> </domain> </domains> --- NEW FILE: datamap.xml --- <?xml version="1.0" encoding="UTF-8"?> <data-map> <db-entity name="ARTIST"> <db-attribute name="ARTIST_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="11"/> <db-attribute name="ARTIST_NAME" type="CHAR" isMandatory="true" length="255"/> <db-attribute name="DATE_OF_BIRTH" type="DATE" length="8"/> </db-entity> <db-entity name="GALLERY"> <db-attribute name="GALLERY_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="11"/> <db-attribute name="GALLERY_NAME" type="VARCHAR" isMandatory="true" length="100"/> </db-entity> <db-entity name="PAINTING"> <db-attribute name="ARTIST_ID" type="INTEGER" length="11"/> <db-attribute name="ESTIMATED_PRICE" type="DECIMAL" length="10"/> <db-attribute name="GALLERY_ID" type="INTEGER" length="11"/> <db-attribute name="PAINTING_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="11"/> <db-attribute name="PAINTING_TITLE" type="VARCHAR" isMandatory="true" length="255"/> </db-entity> <obj-entity name="Artist" className="webtest.Artist" dbEntityName="ARTIST"> <obj-attribute name="artistName" type="java.lang.String" db-attribute-name="ARTIST_NAME"/> <obj-attribute name="dateOfBirth" type="java.sql.Date" db-attribute-name="DATE_OF_BIRTH"/> </obj-entity> <obj-entity name="Gallery" className="webtest.Gallery" dbEntityName="GALLERY"> <obj-attribute name="galleryName" type="java.lang.String" db-attribute-name="GALLERY_NAME"/> </obj-entity> <obj-entity name="Painting" className="webtest.Painting" dbEntityName="PAINTING"> <obj-attribute name="estimatedPrice" type="java.math.BigDecimal" db-attribute-name="ESTIMATED_PRICE"/> <obj-attribute name="paintingTitle" type="java.lang.String" db-attribute-name="PAINTING_TITLE"/> </obj-entity> <db-relationship name="paintingArray" source="ARTIST" target="PAINTING" toDependentPK="false" toMany="true"> <db-attribute-pair source="ARTIST_ID" target="ARTIST_ID"/> </db-relationship> <db-relationship name="paintingArray" source="GALLERY" target="PAINTING" toDependentPK="false" toMany="true"> <db-attribute-pair source="GALLERY_ID" target="GALLERY_ID"/> </db-relationship> <db-relationship name="toArtist" source="PAINTING" target="ARTIST" toDependentPK="false" toMany="false"> <db-attribute-pair source="ARTIST_ID" target="ARTIST_ID"/> </db-relationship> <db-relationship name="toGallery" source="PAINTING" target="GALLERY" toDependentPK="false" toMany="false"> <db-attribute-pair source="GALLERY_ID" target="GALLERY_ID"/> </db-relationship> <obj-relationship name="paintingArray" source="Artist" target="Painting" toMany="true"> <db-relationship-ref source="ARTIST" target="PAINTING" name="paintingArray"/> </obj-relationship> <obj-relationship name="paintingArray" source="Gallery" target="Painting" toMany="true"> <db-relationship-ref source="GALLERY" target="PAINTING" name="paintingArray"/> </obj-relationship> <obj-relationship name="toArtist" source="Painting" target="Artist" toMany="false"> <db-relationship-ref source="PAINTING" target="ARTIST" name="toArtist"/> </obj-relationship> <obj-relationship name="toGallery" source="Painting" target="Gallery" toMany="false"> <db-relationship-ref source="PAINTING" target="GALLERY" name="toGallery"/> </obj-relationship> </data-map> --- NEW FILE: driverinfo.xml --- <driver class="org.gjt.mm.mysql.Driver"> <url value="jdbc:mysql://localhost/cayenne"/> <connectionPool min="1" max="1" /> <login userName="dummy" password="dummy"/> </driver> --- NEW FILE: struts-config.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> <!-- This is a blank Struts configuration file based on the example application, with commented examples of some items. NOTE: If you have a generator tool to create the corresponding Java classes for you, you could include the details in the "form-bean" declarations. Otherwise, you would only define the "form-bean" element itself, with the corresponding "name" and "type" attributes, as shown here. --><struts-config> <!-- ========== Data Source Configuration =============================== --> <!-- <data-sources> <data-source autoCommit="false" description="Example Data Source Configuration" driverClass="org.postgresql.Driver" maxCount="4" minCount="2" password="mypassword" url="jdbc:postgresql://localhost/mydatabase" user="myusername" /> </data-sources> --> <!-- ========== Form Bean Definitions =================================== --> <form-beans> <form-bean name="artistForm" type="formbean.ArtistForm" /> <form-bean name="paintingForm" type="formbean.PaintingForm" /> <form-bean name="galleryForm" type="formbean.GalleryForm" /> </form-beans> <!-- ========== Global Forward Definitions ============================== --> <global-forwards> </global-forwards> <!-- ========== Action Mapping Definitions ============================== --> <action-mappings> <action path="/browseArtists" type="action.ArtistPageAction"> <forward name="success" path="/artistBrowsePage.jsp" /> </action> <action path="/browseGalleries" type="action.GalleryPageAction"> <forward name="success" path="/galleryBrowsePage.jsp" /> </action> <action path="/addArtist" type="action.AddArtistAction" name="artistForm" scope="request" validate="false"> <forward name="success" path="/addArtistPage.jsp" redirect="false" /> </action> <action path="/addGallery" type="action.AddGalleryAction" scope="request" validate="false" name="galleryForm"> <forward name="success" path="/addGalleryPage.jsp" redirect="false" /> </action> <action path="/addPainting" type="action.AddPaintingAction" name="paintingForm" scope="request" validate="false"> <forward name="success" path="/addPaintingPage.jsp" redirect="false" /> </action> <action path="/saveArtist" type="action.SaveArtistAction" name="artistForm" scope="request" input="/addArtistPage.jsp"> <forward name="success" path="/browseArtists.do" /> </action> <action path="/saveGallery" type="action.SaveGalleryAction" name="galleryForm" scope="request" input="/galleryBrowsePage.jsp"> <forward name="success" path="/browseGalleries.do" /> </action> <action path="/savePainting" type="action.SavePaintingAction" name="paintingForm" scope="request" input="/artistDetailPage.jsp"> <forward name="success" path="/browseArtists.do" /> </action> <action path="/addPaintingToGallery" type="action.AddPaintingToGalleryAction"> <forward name="success" path="/chooseGalleryPage.jsp" /> </action> <action path="/choosePaintingForGallery" type="action.SubmitPaintingToGalleryAction"> <forward name="success" path="/browseArtists.do" /> </action> <action path="/removePaintingFromGallery" type="action.RemovePaintingFromGalleryAction"> <forward name="success" path="/browseGalleries.do" /> </action> <!-- Example logon action <action path="/logon" type="org.apache.struts.example.LogonAction" name="logonForm" scope="request" input="/logon.jsp"> </action> --> <!-- Example logoff action <action path="/logoff" type="org.apache.struts.example.LogoffAction"> <forward name="success" path="/index.jsp"/> </action> --> <!-- The standard administrative actions available with Struts --> <!-- These would be either omitted or protected by security --> <!-- in a real application deployment --> <!-- <action path="/admin/addFormBean" type="org.apache.struts.actions.AddFormBeanAction" /> <action path="/admin/addForward" type="org.apache.struts.actions.AddForwardAction" /> <action path="/admin/addMapping" type="org.apache.struts.actions.AddMappingAction" /> <action path="/admin/reload" type="org.apache.struts.actions.ReloadAction" /> <action path="/admin/removeFormBean" type="org.apache.struts.actions.RemoveFormBeanAction" /> <action path="/admin/removeForward" type="org.apache.struts.actions.RemoveForwardAction" /> <action path="/admin/removeMapping" type="org.apache.struts.actions.RemoveMappingAction" /> --> </action-mappings> <!-- ========== Message Resources Definitions =========================== --> <message-resources parameter="ApplicationResources" key="org.apache.struts.action.MESSAGE" /> <!-- ========== Plug Ins Configuration ================================== --> <!-- Add multiple validator resource files by setting the pathname property. Default pluggable validator definitions are contained in validator-rules.xml. Add any validation rules for forms in validator.xml. --> <!-- <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathname" value="/WEB-INF/validator-rules.xml"/> <set-property property="pathname" value="/WEB-INF/validator.xml"/> </plug-in> --> </struts-config> --- NEW FILE: web.xml --- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"> <web-app> <!-- Configure ServletConfiguration to listen for container events. --> <listener> <listener-class>test.CustomConfiguration</listener-class> </listener> <!-- Standard Action Servlet Configuration (with debugging) --> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>3</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> <!-- Standard Action Servlet Mapping --> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <!-- The Usual Welcome File List --> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- Example Application Tag Library Descriptor <taglib> <taglib-uri>/WEB-INF/app.tld</taglib-uri> <taglib-location>/WEB-INF/app.tld</taglib-location> </taglib> --> <!-- Struts Tag Library Descriptors --> <taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri> <taglib-location>/WEB-INF/struts-nested.tld</taglib-location> </taglib> </web-app> |