Skip to content

Commit

Permalink
ROO-2740: Issue warnings for deprecated MVC commands. Adjusted Docume…
Browse files Browse the repository at this point in the history
…ntation to reflect changes.
  • Loading branch information
Stefan Schmidt committed Sep 21, 2011
1 parent 6f2e76c commit 7c2207f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,13 @@ public class Choice {
with scaffolded controllers, it is recommended to observe the default
identifier and version conventions provided by <code>@RooEntity</code>
implementations. If you write a web controller by hand (perhaps with the
assistance of the <link
linkend="command-index-controller-class">controller class</link> command),
it is recommended you also use the methods directly exposed on entities.
Most Roo applications will place their business logic between the entities
and web controllers, with only occasional use of services layers. Please
refer to the <link linkend="architecture-services">services layer</link>
section for a more complete treatment of when you'd use a services
layer.</para>
assistance of the <link linkend="command-index-web-mvc-controller">web mvc
controller</link> command), it is recommended you also use the methods
directly exposed on entities. Most Roo applications will place their
business logic between the entities and web controllers, with only
occasional use of services layers. Please refer to the <link
linkend="architecture-services">services layer</link> section for a more
complete treatment of when you'd use a services layer.</para>
</section>

<section xml:id="architecture-services">
Expand Down
79 changes: 39 additions & 40 deletions deployment-support/src/site/docbook/reference/welcome-beginning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ com.springsource.roo.pizzashop roo&gt;
persistent domain objects (entities) and their underlying database tables.
To install or change the persistence configuration in your project you can
use the <emphasis role="bold"><link
linkend="command-index-jpa-setup">persistence
setup</link></emphasis> command (note: try using the <emphasis
role="bold">&lt;TAB&gt;</emphasis> as often as you can to auto-complete
your commands, options and even obtain contextual help):</para>
linkend="command-index-jpa-setup">persistence setup</link></emphasis>
command (note: try using the <emphasis role="bold">&lt;TAB&gt;</emphasis>
as often as you can to auto-complete your commands, options and even
obtain contextual help):</para>

<para><programlisting>com.springsource.roo.pizzashop roo&gt; <emphasis
role="bold">hint</emphasis>
Expand Down Expand Up @@ -278,15 +278,15 @@ com.springsource.roo.pizzashop roo&gt;

<para>When you are ready to test or install your application in a
production setting, the <emphasis role="bold"><link
linkend="command-index-jpa-setup">persistence
setup</link></emphasis> command can be repeated. This allows you to
nominate a different database, or even ORM. Roo offers TAB completion for
production databases including Postgres, MySQL, Microsoft SQL Server,
Oracle, DB2, Sybase, H2, Hypersonic and more. Another important step is to
edit the <code>SRC_MAIN_RESOURCES/META-INF/persistence.xml</code> file and
modify your JPA provider's DDL (schema management) configuration setting
so it preserves the database between restarts of your application. To help
you with this, Roo automatically lists the valid settings for your JPA
linkend="command-index-jpa-setup">persistence setup</link></emphasis>
command can be repeated. This allows you to nominate a different database,
or even ORM. Roo offers TAB completion for production databases including
Postgres, MySQL, Microsoft SQL Server, Oracle, DB2, Sybase, H2, Hypersonic
and more. Another important step is to edit the
<code>SRC_MAIN_RESOURCES/META-INF/persistence.xml</code> file and modify
your JPA provider's DDL (schema management) configuration setting so it
preserves the database between restarts of your application. To help you
with this, Roo automatically lists the valid settings for your JPA
provider as a comment in that file. Note that by default your JPA provider
will drop all database tables each time it reloads. As such you'll
certainly want to change this setting.</para>
Expand Down Expand Up @@ -591,33 +591,32 @@ Tests run: 36, Failures: 0, Errors: 0, Skipped: 0
<title>Step 5: Creating A Web Tier</title>

<para>As a next step we want to scaffold a Web tier for the Pizza Shop
application. This is accomplished via the <emphasis role="bold"><link
linkend="command-index-controller-commands">controller</link></emphasis>
command. The most convenient way to generate controllers and all relevant
Web artifacts is to use the <emphasis role="bold"><link
linkend="command-index-controller-all">controller all</link></emphasis>
command:</para>

<para><programlisting>~.domain.PizzaOrder roo&gt; <emphasis role="bold">controller all --package ~.web
</emphasis></programlisting>This command will scan the Pizza Shop project for
any domain entities and scaffold a Spring MVC controller for each entity
detected. The <code>--package</code> attribute is needed to specify in
which package the controllers should be installed. This command can be
issued from your normal Roo shell or from the Roo shell, which ships with
STS. In order to use the integrated Roo shell within STS you need to right
click on the pizzashop application and select 'Spring Tools &gt; Open Roo
Shell'.</para>

<para>Note, that with the first use of the <emphasis role="bold"><link
linkend="command-index-controller-commands">controller</link></emphasis>
command the nature of the project changes from a normal Java project
nature to a Web project nature in STS. The first use of the <emphasis
role="bold"><link
linkend="command-index-controller-commands">controller</link></emphasis>
command will also add additional dependencies such as Spring MVC, Tiles,
etc to your project. In order to update the project classpath within STS
with these new dependencies you can issue 'perform eclipse' again,
followed by a project refresh in STS.</para>
application. This is accomplished via the <emphasis>web mvc</emphasis>
commands. The most convenient way to generate controllers and all relevant
Web artifacts is to use the <link
linkend="command-index-web-mvc-setup">web mvc setup</link> command
followed by the <link linkend="command-index-web-mvc-all">web mvc
all</link> command:</para>

<para><programlisting>~.domain.PizzaOrder roo&gt; <emphasis role="bold">web mvc setup

~.domain.PizzaOrder roo&gt; <emphasis role="bold">web mvc all --package ~.web
</emphasis></emphasis></programlisting>This command will scan the Pizza Shop
project for any domain entities and scaffold a Spring MVC controller for
each entity detected. The <code>--package</code> attribute is needed to
specify in which package the controllers should be installed. This command
can be issued from your normal Roo shell or from the Roo shell, which
ships with STS. In order to use the integrated Roo shell within STS you
need to right click on the pizzashop application and select 'Spring Tools
&gt; Open Roo Shell'.</para>

<para>Note, that with the <link linkend="command-index-web-mvc-setup">web
mvc setup</link> command the nature of the project changes from a normal
Java project nature to a Web project nature in STS. This command will also
add additional dependencies such as Spring MVC, Tiles, etc to your
project. In order to update the project classpath within STS with these
new dependencies you can issue 'perform eclipse' again, followed by a
project refresh in STS.</para>

<para>All newly added Web artifacts which are needed for the view
scaffolding can be found under the <code>src/main/webapp</code> folder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,9 @@ roo&gt; <emphasis role="bold">hint</emphasis>
roo&gt; <emphasis role="bold">entity --class ~.Timer --testAutomatically</emphasis>
roo&gt; <emphasis role="bold">hint</emphasis>
roo&gt; <emphasis role="bold">field string --fieldName message --notNull</emphasis>
roo&gt; <emphasis role="bold">hint controllers</emphasis>
roo&gt; <emphasis role="bold">controller all --package ~.web</emphasis>
roo&gt; <emphasis role="bold"><emphasis role="bold">hint </emphasis>web mvc</emphasis>
roo&gt; <emphasis role="bold">web mvc setup</emphasis>
roo&gt; <emphasis role="bold">web mvc all --package ~.web</emphasis>
roo&gt; <emphasis role="bold">selenium test --controller ~.web.TimerController</emphasis>
roo&gt; <emphasis role="bold">perform tests</emphasis>
roo&gt; <emphasis role="bold">perform package</emphasis>
Expand Down
26 changes: 14 additions & 12 deletions deployment-support/src/site/docbook/reference/welcome-usage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
as you made a mistake when entering a command or an add-on has a problem
for whatever reason) the file system will automatically rollback to the
state it was before the change was attempted. The cascading nature of many
changes (i.e. you add a field to a <code>.java</code> file and that changes
an AspectJ ITD and that in turn changes a web <code>.jspx</code> etc) is
handled in the same unit of work and therefore rolled back as an atomic
group when required.</para>
changes (i.e. you add a field to a <code>.java</code> file and that
changes an AspectJ ITD and that in turn changes a web <code>.jspx</code>
etc) is handled in the same unit of work and therefore rolled back as an
atomic group when required.</para>

<para>Before leaving this discussion on usability, it's probably worth
pointing out that although the Roo shell contains <link
Expand Down Expand Up @@ -199,9 +199,9 @@
some options which have a default value of '<code>*</code>'. This is
the marker which indicates "the current context will be used for
this command option unless you explicitly specify otherwise". You
change the context by simply working with a different Java type (i.e.
specify an operation that involves a different Java type and the
context will change to that Java type).</para>
change the context by simply working with a different Java type
(i.e. specify an operation that involves a different Java type and
the context will change to that Java type).</para>
</listitem>

<listitem>
Expand Down Expand Up @@ -346,13 +346,15 @@ quit
File &gt; Import &gt; General &gt; Maven Projects menu option is
sufficient.</para>

<para>Irrespective of how you import your project into Eclipse (i.e. via the
<link linkend="command-index-perform-eclipse">perform eclipse</link>
<para>Irrespective of how you import your project into Eclipse (i.e. via
the <link linkend="command-index-perform-eclipse">perform eclipse</link>
command or via m2eclipse) you should be aware that the project will not be
a Web Tools Project (WTP) until such time as you install your first web
controller. This is usually undertaken via the controller all or
controller scaffold command. If you have already imported your project
into Eclipse, simply complete the relevant controller command and then
controller. This is usually undertaken via the <link
linkend="command-index-web-mvc-all">web mvc all</link> or <link
linkend="command-index-web-mvc-controller">web mvc controller</link>
command. If you have already imported your project into Eclipse, simply
complete the relevant <emphasis>web mvc</emphasis> command and then
re-import. The project will then be a WTP and offer the ability to deploy
to an IDE-embedded web container. If you attempt to start a WTP server and
receive an error message, try right-clicking the project and selecting
Expand Down

0 comments on commit 7c2207f

Please sign in to comment.