mpoeschl    01/07/13 13:57:39

  Added:       src/share/sample30/templates/app/layouts Default.vm Login.vm
               src/share/sample30/templates/app/navigations
                        DefaultBottom.vm Menu.vm DefaultTop.vm
               src/share/sample30/templates/app/screens BSF.vm
                        VelocityError.vm InvalidState.vm Error.vm Insert.vm
                        Index.vm UploadComplete.vm Upload.vm Login.vm
                        ServletInfo.vm Form.vm
               src/share/sample30/templates/jsp/screens Index.jsp Login.jsp
               src/share/sample30/templates/jsp/tld Test.tld
  Log:
  add updated sample-app for turbine-3.0
  
  Revision  Changes    Path
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/layouts/Default.vm
  
  Index: Default.vm
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
      "http://www.w3.org/TR/html4/loose.dtd";>
  
  <html>
  <head>
    <title>$page.Title</title>
  </head>
  <body bgcolor="$ui.bgcolor">
  
  <table width="100%">
    <tr>
      <td colspan="2">
        $renderer.render("navigations", $data, "/DefaultTop.vm")
      </td>
    </tr>
    <tr>
      <td width="20" align="left" valign="top">
        $renderer.render("navigations", $data, "/Menu.vm")
      </td>
      <td align="left" valign="top">
        $renderer.render("screens", $data, $template)
      </td>
    </tr>
    <tr>
      <td colspan="2">
        $renderer.render("navigations", $data, "/DefaultBottom.vm")
      </td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/layouts/Login.vm
  
  Index: Login.vm
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
      "http://www.w3.org/TR/html4/loose.dtd";>
  
  <html>
  <head>
    <title>$page.Title</title>
  </head>
  <body bgcolor="$ui.bgcolor">
  
  <table width="100%">
    <tr>
      <td colspan="2">
        $renderer.render("navigations", $data, "/DefaultTop.vm")
      </td>
    </tr>
    <tr>
      <td align="left">
        $renderer.render("screens", $data, $template)
      </td>
    </tr>
    <tr>
      <td colspan="2">
        $renderer.render("navigations", $data, "/DefaultBottom.vm")
      </td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/navigations/DefaultBottom.vm
  
  Index: DefaultBottom.vm
  ===================================================================
  <font face="verdana,geneva,helvetica">
  
  <hr>
  
  </font>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/navigations/Menu.vm
  
  Index: Menu.vm
  ===================================================================
  <font face="$ui.sansSerifFonts">
  <a href="$link.setPage("Insert.vm")">Insert Entry</a>
  <p>
  <b>Flux</b>
  <br>
  <a href="$link.setPage("user,FluxUserList.vm")">Users</a>
  <br>
  <a href="$link.setPage("group,FluxGroupList.vm")">Groups</a>
  <br>
  <a href="$link.setPage("role,FluxRoleList.vm")">Roles</a>
  <br>
  <a href="$link.setPage("permission,FluxPermissionList.vm")">Permissions</a>
  <p>
  <b>Services</b>
  ##<br>
  ##<a href="">Intake Service</a>
  ##<br>
  ##<a href="">Localization Service</a>
  ##<br>
  ##<a href="">Pull Service</a>
  ##<br>
  ##<a href="">Scheduler Service</a>
  <br>
  <a href="$link.setPage("Upload.vm")">Upload Service</a>
  <br>
  <a href="$link.setPage("ServletInfo.vm")">Servlet Service</a>
  <br>
  ##<a href="">Unique Id Service</a>
  ##<br>
  ##<a href="">XML-RPC Service</a>
  ##<br>
  ##<a href="">XSLT Service</a>
  <p>
  <b>Common Tasks</b>
  <br>
  <a href="">User Downloads</a>
  <p>
  <a href="$link.setPage("Index.vm")">Home</a>
  <p>
  <a href="$link.setAction("LogoutUser")">Logout</a>
  </font>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/navigations/DefaultTop.vm
  
  Index: DefaultTop.vm
  ===================================================================
  <img src="$content.getURI("images/tdm.jpg")">
  
  <hr>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/BSF.vm
  
  Index: BSF.vm
  ===================================================================
  A python script was executed!
  
  <p>
  
  'Hello World!' should have appeared on your console!
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/VelocityError.vm
  
  Index: VelocityError.vm
  ===================================================================
  $page.setTitle("Error")
  
  $page.setBgColor("#ffffff")
  
  <font face="verdana,geneva,helvetica">
  
  <h2>Error</h2>
  
  $processingException
  
  <hr>
  
  $stackTrace
  
  </font>
  
  <br>
  
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/InvalidState.vm
  
  Index: InvalidState.vm
  ===================================================================
  package org.apache.turbine.modules.screens.error;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  // ECS
  import org.apache.ecs.ConcreteElement;
  import org.apache.ecs.ElementContainer;
  import org.apache.ecs.html.A;
  
  // Turbine
  import org.apache.turbine.modules.Screen;
  import org.apache.turbine.util.DynamicURI;
  import org.apache.turbine.util.ParameterParser;
  import org.apache.turbine.util.RunData;
  
  
  /**
   * Users will get this screen if the screen on their browser is in an
   * invalid state.  For example, if they hit "Back" or "Reload" and
   * then try to submit old form data.
   *
   * If you want one of your screens to check for invalid state
   * then add a hidden form field called "_session_access_counter"
   * with the value currently stored in the session.  The
   * SessionValidator action will check to see if it is an old
   * value and redirect you to this screen.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Dave Bryson</a>
   * @version $Id: InvalidState.vm,v 1.1 2001/07/13 20:57:37 mpoeschl Exp $
   */
  public class InvalidState extends Screen
  {
      /**
       * Build the Screen.
       *
       * @param data Turbine information.
       * @exception Exception, a generic exception.
       */
      public ConcreteElement doBuild( RunData data )
          throws Exception
      {
          ElementContainer body = new ElementContainer();
          ElementContainer message = new ElementContainer();
  
          StringBuffer sb = new StringBuffer();
          sb.append( "<b>There has been an error.</b>" )
              .append( "<p>" )
              .append( "- If you used the browser \"Back\" or \"Reload\"" )
              .append( " buttons please use the navigation buttons we provide" )
              .append( " within the screen." )
              .append( "<p>" )
              .append( "Please click " );
  
          message.addElement( sb.toString() );
          ParameterParser pp; 
          pp = (ParameterParser)data.getUser().getTemp("prev_parameters");
          pp.remove("_session_access_counter");
          message.addElement( new A().setHref(
              new DynamicURI(data,(String)data.getUser().getTemp("prev_screen"))
                  .addPathInfo( pp ).toString()).addElement("here") );
          message.addElement( " to return the the screen you were working on." );
  
          body.addElement( message );
          return body;
      }
  }
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/Error.vm
  
  Index: Error.vm
  ===================================================================
  $page.setTitle("Error")
  
  $page.setBgColor("#ffffff")
  
  <font face="verdana,geneva,helvetica">
  
  <h2>Error</h2>
  
  $processingException
  
  <hr>
  
  $stackTrace
  
  </font>
  
  <br>
  
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/Insert.vm
  
  Index: Insert.vm
  ===================================================================
  $page.setTitle("Insert")
  
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  </head>
  
  <body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" 
marginheight="0">
  <form method="post" action="$link.setPage("Index.vm").setAction("SQL")">
    <div align="left">
      <table bgcolor="#ffffff" cellpadding="5">
        <tr>
          #formCell ("Title" "title" "")
        </tr>
        <tr>
          #formCell ("Author" "author" "")
        </tr>
        <tr>
          #formCell ("Department" "dept" "")
        </tr>
        <tr>
          #formCell ("Url" "url" "")
        </tr>
        <tr>
          #formCell ("Body" "body" "")
        </tr>
      </table>
      <input type="submit" name="eventSubmit_doInsert" value="Insert"/>
    </div>
  </form>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/Index.vm
  
  Index: Index.vm
  ===================================================================
  $page.setTitle("Index")
  $page.setBgColor("#ffffff")
  
  #set ( $headings = ["Title", "Dept", "Author", "Url","Body"," "] )
  
  #if ($entries)
  <table>
    <tr>
      <td>
        <table cellspacing="1" cellpadding="1">
          <tr>
            #foreach ($heading in $headings)
            #headerCell ($heading)
            #end    
          </tr>
    
          #foreach ($entry in $entries)
          <tr>
            #entryCell ($entry.Title)
            #entryCell ($entry.Dept)
            #entryCell ($entry.Author)
            #entryCell ($entry.Url)
            #entryCell ($entry.Body)
            <td><a href="$link.setPage("Form.vm").addPathInfo("rdfid", 
$entry.RdfId)">Edit</a></td>
          </tr>        
          #end
        </table>
      </td>
    </tr>
  </table>
  #end
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/UploadComplete.vm
  
  Index: UploadComplete.vm
  ===================================================================
  $page.setBgColor($ui.bgcolor)
  $page.setTitle("File Upload")
  
  Your file has been successfully uploaded!
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/Upload.vm
  
  Index: Upload.vm
  ===================================================================
  $page.setBgColor($ui.bgcolor)
  $page.setTitle("File Upload")
  
  <form method="post" enctype="multipart/form-data" 
action="$link.setPage("UploadComplete.vm").setAction("Upload")">
    <div align="left">
      <table bgcolor="#ffffff" cellpadding="5">
          
        #if ($errorTemplate)
        <tr>
          <td colspan="4">
            <table bgcolor="#ffffff">
              <tr>
                <td>
                  <img src="$ui.image($ui.alertImage,$data)">
                </td>
                <td>
                  #parse ($errorTemplate)
                </td>
              </tr>
            </table>
          </td>
        </tr>
        #end
  
        <tr>
          #fileUpload ("File" "file")
        </tr>
  
        <tr>
          <td align="$ui.buttonAlignment" bgcolor="$ui.buttonColor">
            #*
              Check for a mode, the update and delete buttons
              shouldn't appear when inserting a new user.
            *#
  
            <font face="$ui.sansSerifFonts">
  
            <input type="submit" name="eventSubmit_doUpload" value="Upload"/>
      
            </font>
          </td>
        </tr>
        
      </table>
    </div>
  </form>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/Login.vm
  
  Index: Login.vm
  ===================================================================
  #**
  
  @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
  @version $Id: Login.vm,v 1.1 2001/07/13 20:57:37 mpoeschl Exp $
  
  *#
  
  $page.setTitle("Please Login")
  $page.setBgColor($ui.bgcolor)
  
  <form method="post" action="$link.setAction("LoginUser")">
    <table>
      <tr>
        #formCell ("User" "username" "")
      </tr>
      <tr>
         #formPasswordCell ("Password" "password" "")
      </tr>
      <tr>
        <td>
          <font face="$ui.sansSerifFonts">
            <input type="submit" value="Login">
          </font>
        </td>
      </tr>
    </table>
  </form>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/ServletInfo.vm
  
  Index: ServletInfo.vm
  ===================================================================
  Servlet Info:
  
  $serverName
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/app/screens/Form.vm
  
  Index: Form.vm
  ===================================================================
  $page.setTitle("Insert")
  
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  </head>
  
  <body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" 
marginheight="0">
  <form method="post" action="$link.setPage("Index.vm").setAction("SQL")">
    <div align="left">
      <table bgcolor="#ffffff" cellpadding="5">
        <tr>  
          #formCell ("Title" "title" $entry.Title)
        </tr>
        <tr>
          #formCell ("Author" "author" $entry.Author)
        </tr>
        <tr>
          #formCell ("Department" "dept" $entry.Dept)
        </tr>
        <tr>
          #formCell ("Url" "url" $entry.Url)
        </tr>
        <tr>
          #formCell ("Body" "body" $entry.Body)
        </tr>
      </table>
    
      <input type="hidden" name="rdfid" value="$entry.RdfId"/>
      <input type="submit" name="eventSubmit_doInsert" value="Insert"/>
      <input type="submit" name="eventSubmit_doUpdate" value="Update"/>
      <input type="submit" name="eventSubmit_doDelete" value="Delete"/>
    </div>
  </form>
  </body>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/jsp/screens/Index.jsp
  
  Index: Index.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/tlds/Test.tld" prefix="tags" %>
  
  <html>
  <head>
  <title>Index.jsp</title>
  </head>
  
  <body>
  Hello <tags:UserInfo/>.
  </body>
  
  </html>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/jsp/screens/Login.jsp
  
  Index: Login.jsp
  ===================================================================
  <html>
  <head>
  <title>Login</title>
  </head>
  
  <body>
  
  <blockquote>
  
  <form method="post">
    <input type="hidden" name="Action" value="LoginUser">
  
    <table>
    <tr>
    <td>Username</td>
    <td><input type="text" name="username"></td>
    </tr>
  
    <tr>
    <td>Password</td>
    <td><input type="password" name="password"></td>
    </tr>
  
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="Login"></td>
    </table>
  
  </form>
  </blockquote>
  
  </body>
  </html>
  
  
  
  1.1                  
jakarta-turbine-tdk/src/share/sample30/templates/jsp/tld/Test.tld
  
  Index: Test.tld
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?>
  <!DOCTYPE taglib PUBLIC 
    "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" 
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd";> 
  <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>Tags</shortname>
  
    <tag>   
      <name>UserInfo</name>
      <tagclass>com.planetcad.suitex.UserInfoTag</tagclass>
      <bodycontent>empty</bodycontent>
    </tag>
  </taglib>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to