diff --git a/.classpath b/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..245ce4bd4d6e13ced7787cd175e2e3ebf04699d4 --- /dev/null +++ b/.classpath @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/.gitignore b/.gitignore index 22f68d33f6e2b71d706d1518ef9733e5979d6f27..9fd17aecb1cdd655a85b2f39dfac930e84d9d2c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target/ /src/main/resources/META-INF/spring/database.properties +/log.roo diff --git a/.project b/.project new file mode 100644 index 0000000000000000000000000000000000000000..c6c7127e0f3c198259d35169daed84ef476c55a3 --- /dev/null +++ b/.project @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>participatorio</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.ajdt.core.ajbuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.springframework.ide.eclipse.core.springbuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.ajdt.ui.ajnature</nature> + <nature>com.springsource.sts.roo.core.nature</nature> + <nature>org.springframework.ide.eclipse.core.springnature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.wst.jsdt.core.jsNature</nature> + </natures> +</projectDescription> diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..fec0c0b650d5f4d017f9b7d58eeb94269a26f716 --- /dev/null +++ b/pom.xml @@ -0,0 +1,472 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>br.ufpr.c3sl.participatorio</groupId> + <artifactId>participatorio</artifactId> + <packaging>war</packaging> + <version>0.1.0.BUILD-SNAPSHOT</version> + <name>participatorio</name> + <properties> + <aspectj.version>1.7.0</aspectj.version> + <java.version>6</java.version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <roo.version>1.2.3.RELEASE</roo.version> + <slf4j.version>1.7.2</slf4j.version> + <spring.version>3.2.0.RELEASE</spring.version> + <spring-security.version>3.1.0.RELEASE</spring-security.version> + </properties> + <repositories> + <repository> + <id>spring-maven-release</id> + <name>Spring Maven Release Repository</name> + <url>http://maven.springframework.org/release</url> + </repository> + <repository> + <id>spring-maven-milestone</id> + <name>Spring Maven Milestone Repository</name> + <url>http://maven.springframework.org/milestone</url> + </repository> + <repository> + <id>spring-roo-repository</id> + <name>Spring Roo Repository</name> + <url>http://spring-roo-repository.springsource.org/release</url> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>spring-maven-release</id> + <name>Spring Maven Release Repository</name> + <url>http://maven.springframework.org/release</url> + </pluginRepository> + <pluginRepository> + <id>spring-maven-milestone</id> + <name>Spring Maven Milestone Repository</name> + <url>http://maven.springframework.org/milestone</url> + </pluginRepository> + <pluginRepository> + <id>spring-roo-repository</id> + <name>Spring Roo Repository</name> + <url>http://spring-roo-repository.springsource.org/release</url> + </pluginRepository> + </pluginRepositories> + <dependencies> + <!-- General dependencies for standard applications --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.10</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.16</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.5</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>net.sf.flexjson</groupId> + <artifactId>flexjson</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.1</version> + </dependency> + <!-- ROO dependencies --> + <dependency> + <groupId>org.springframework.roo</groupId> + <artifactId>org.springframework.roo.annotations</artifactId> + <version>${roo.version}</version> + <scope>provided</scope> + </dependency> + <!-- Spring dependencies --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aspects</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <version>2.2.9</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-core</artifactId> + <version>4.1.8.Final</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-entitymanager</artifactId> + <version>4.1.8.Final</version> + <exclusions> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + <exclusion> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.hibernate.javax.persistence</groupId> + <artifactId>hibernate-jpa-2.0-api</artifactId> + <version>1.0.1.Final</version> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.2.1</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-validator</artifactId> + <version>4.3.1.Final</version> + </dependency> + <dependency> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + <version>1.0.0.GA</version> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.2.2</version> + </dependency> + <dependency> + <groupId>javax.transaction</groupId> + <artifactId>jta</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-orm</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>commons-pool</groupId> + <artifactId>commons-pool</artifactId> + <version>1.5.6</version> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.3</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework.webflow</groupId> + <artifactId>spring-js-resources</artifactId> + <version>2.2.1.RELEASE</version> + </dependency> + <dependency> + <groupId>commons-digester</groupId> + <artifactId>commons-digester</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2.2</version> + </dependency> + <dependency> + <groupId>javax.servlet.jsp.jstl</groupId> + <artifactId>jstl-api</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>org.glassfish.web</groupId> + <artifactId>jstl-impl</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>javax.el</groupId> + <artifactId>el-api</artifactId> + <version>2.2</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>joda-time</groupId> + <artifactId>joda-time</artifactId> + <version>1.6</version> + </dependency> + <dependency> + <groupId>javax.servlet.jsp</groupId> + <artifactId>jsp-api</artifactId> + <version>2.1</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>1.5</version> + </dependency> + <dependency> + <groupId>org.apache.tiles</groupId> + <artifactId>tiles-jsp</artifactId> + <version>2.2.2</version> + </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-core</artifactId> + <version>${spring-security.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-config</artifactId> + <version>${spring-security.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-web</artifactId> + <version>${spring-security.version}</version> + </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-taglibs</artifactId> + <version>${spring-security.version}</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.2</version> + <!-- <configuration> <webXml>target/web.xml</webXml> </configuration> --> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.5.1</version> + <configuration> + <source>${java.version}</source> + <target>${java.version}</target> + <encoding>${project.build.sourceEncoding}</encoding> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>aspectj-maven-plugin</artifactId> + <version>1.2</version> + <!-- NB: do not use 1.3 or 1.3.x due to MASPECTJ-90 and do not use 1.4 due to declare parents issue --> + <dependencies> + <!-- NB: You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) --> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjtools</artifactId> + <version>${aspectj.version}</version> + </dependency> + </dependencies> + <executions> + <execution> + <goals> + <goal>compile</goal> + <goal>test-compile</goal> + </goals> + </execution> + </executions> + <configuration> + <outxml>true</outxml> + <aspectLibraries> + <aspectLibrary> + <groupId>org.springframework</groupId> + <artifactId>spring-aspects</artifactId> + </aspectLibrary> + </aspectLibraries> + <source>${java.version}</source> + <target>${java.version}</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.6</version> + <configuration> + <encoding>${project.build.sourceEncoding}</encoding> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.12</version> + <configuration> + <printSummary>false</printSummary> + <redirectTestOutputToFile>true</redirectTestOutputToFile> + <excludes> + <exclude>**/*_Roo_*</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.3</version> + <configuration> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.7</version> + </plugin> + <!-- IDE --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-eclipse-plugin</artifactId> + <version>2.7</version> + <!-- Note 2.8 does not work with AspectJ aspect path --> + <configuration> + <downloadSources>true</downloadSources> + <downloadJavadocs>false</downloadJavadocs> + <wtpversion>2.0</wtpversion> + <additionalBuildcommands> + <buildCommand> + <name>org.eclipse.ajdt.core.ajbuilder</name> + <arguments> + <aspectPath>org.springframework.aspects</aspectPath> + </arguments> + </buildCommand> + <buildCommand> + <name>org.springframework.ide.eclipse.core.springbuilder</name> + </buildCommand> + </additionalBuildcommands> + <additionalProjectnatures> + <projectnature>org.eclipse.ajdt.ui.ajnature</projectnature> + <projectnature>com.springsource.sts.roo.core.nature</projectnature> + <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> + </additionalProjectnatures> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-idea-plugin</artifactId> + <version>2.2</version> + <configuration> + <downloadSources>true</downloadSources> + <dependenciesAsLibraries>true</dependenciesAsLibraries> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>tomcat-maven-plugin</artifactId> + <version>1.1</version> + </plugin> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>8.1.4.v20120524</version> + <configuration> + <webAppConfig> + <contextPath>/${project.name}</contextPath> + </webAppConfig> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Ministerio.java b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio.java new file mode 100644 index 0000000000000000000000000000000000000000..13b67b239cd21b1f20b0e10e2ff143419ed8800f --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio.java @@ -0,0 +1,12 @@ +package br.ufpr.c3sl.participatorio; + +import org.springframework.roo.addon.javabean.RooJavaBean; +import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord; +import org.springframework.roo.addon.tostring.RooToString; + +@RooJavaBean +@RooToString +@RooJpaActiveRecord +public class Ministerio { + private String nome; +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Configurable.aj b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Configurable.aj new file mode 100644 index 0000000000000000000000000000000000000000..5f22e84beeeeb5bd7f6c9b3968c7e12dc9fda448 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Configurable.aj @@ -0,0 +1,13 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Ministerio; +import org.springframework.beans.factory.annotation.Configurable; + +privileged aspect Ministerio_Roo_Configurable { + + declare @type: Ministerio: @Configurable; + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_JavaBean.aj b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_JavaBean.aj new file mode 100644 index 0000000000000000000000000000000000000000..34958093df11f664e75336abfd8a4269e606b2ff --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_JavaBean.aj @@ -0,0 +1,18 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Ministerio; + +privileged aspect Ministerio_Roo_JavaBean { + + public String Ministerio.getNome() { + return this.nome; + } + + public void Ministerio.setNome(String nome) { + this.nome = nome; + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Jpa_ActiveRecord.aj b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Jpa_ActiveRecord.aj new file mode 100644 index 0000000000000000000000000000000000000000..4bb2068fc731c50fcf5d9255c1f3f386a6e8dbe4 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Jpa_ActiveRecord.aj @@ -0,0 +1,77 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Ministerio; +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import org.springframework.transaction.annotation.Transactional; + +privileged aspect Ministerio_Roo_Jpa_ActiveRecord { + + @PersistenceContext + transient EntityManager Ministerio.entityManager; + + public static final EntityManager Ministerio.entityManager() { + EntityManager em = new Ministerio().entityManager; + if (em == null) throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)"); + return em; + } + + public static long Ministerio.countMinisterios() { + return entityManager().createQuery("SELECT COUNT(o) FROM Ministerio o", Long.class).getSingleResult(); + } + + public static List<Ministerio> Ministerio.findAllMinisterios() { + return entityManager().createQuery("SELECT o FROM Ministerio o", Ministerio.class).getResultList(); + } + + public static Ministerio Ministerio.findMinisterio(Long id) { + if (id == null) return null; + return entityManager().find(Ministerio.class, id); + } + + public static List<Ministerio> Ministerio.findMinisterioEntries(int firstResult, int maxResults) { + return entityManager().createQuery("SELECT o FROM Ministerio o", Ministerio.class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); + } + + @Transactional + public void Ministerio.persist() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.persist(this); + } + + @Transactional + public void Ministerio.remove() { + if (this.entityManager == null) this.entityManager = entityManager(); + if (this.entityManager.contains(this)) { + this.entityManager.remove(this); + } else { + Ministerio attached = Ministerio.findMinisterio(this.id); + this.entityManager.remove(attached); + } + } + + @Transactional + public void Ministerio.flush() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.flush(); + } + + @Transactional + public void Ministerio.clear() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.clear(); + } + + @Transactional + public Ministerio Ministerio.merge() { + if (this.entityManager == null) this.entityManager = entityManager(); + Ministerio merged = this.entityManager.merge(this); + this.entityManager.flush(); + return merged; + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Jpa_Entity.aj b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Jpa_Entity.aj new file mode 100644 index 0000000000000000000000000000000000000000..35a82f495898edc6a5dff688a3f99d9f750b7b49 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_Jpa_Entity.aj @@ -0,0 +1,43 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Ministerio; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Version; + +privileged aspect Ministerio_Roo_Jpa_Entity { + + declare @type: Ministerio: @Entity; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long Ministerio.id; + + @Version + @Column(name = "version") + private Integer Ministerio.version; + + public Long Ministerio.getId() { + return this.id; + } + + public void Ministerio.setId(Long id) { + this.id = id; + } + + public Integer Ministerio.getVersion() { + return this.version; + } + + public void Ministerio.setVersion(Integer version) { + this.version = version; + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_ToString.aj b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_ToString.aj new file mode 100644 index 0000000000000000000000000000000000000000..4b447084f31ff029731d2bcb51073ba722d1f09a --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Ministerio_Roo_ToString.aj @@ -0,0 +1,16 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Ministerio; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +privileged aspect Ministerio_Roo_ToString { + + public String Ministerio.toString() { + return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Projeto.java b/src/main/java/br/ufpr/c3sl/participatorio/Projeto.java new file mode 100644 index 0000000000000000000000000000000000000000..22a488fcad21ace1c4162d32d2bbfbda70dcaf0a --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Projeto.java @@ -0,0 +1,121 @@ +package br.ufpr.c3sl.participatorio; + +import java.util.Date; + +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.OneToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.roo.addon.javabean.RooJavaBean; +import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord; +import org.springframework.roo.addon.tostring.RooToString; + +import br.ufpr.c3sl.participatorio.Ministerio; +import br.ufpr.c3sl.participatorio.enums.TipoAcao; +import br.ufpr.c3sl.participatorio.enums.TipoDemanda; +import br.ufpr.c3sl.participatorio.enums.TipoDiasSemana; +import br.ufpr.c3sl.participatorio.enums.TipoStatus; +import br.ufpr.c3sl.participatorio.enums.TipoTemporalidade; + +@RooJavaBean +@RooToString +@RooJpaActiveRecord +public class Projeto { + + @OneToOne + private Projeto pai; + + private String nome; + + @Enumerated(EnumType.STRING) + private TipoDemanda demanda; + + @Enumerated(EnumType.STRING) + private TipoAcao acao; + private String outroAcao; + + @OneToOne + private Ministerio ministerio; + + private String objetivo; + + // Endereço + private String rua; + private String numero; + private String complemento; + private String bairro; + private String municipio; + private String cep; + + private String responsavel; + private String telefones; + private String email; + + // + private String publicoAlvo; + private String formaAcesso; + + private String site; + +/* itens 12 e 13 + private String horarioFuncionamento; + private String duracao; +*/ + + private String comoFunciona; + private String noticias; + +/* horario + dias de funcionamento ?? + private String metodoFuncionamento; +*/ + private String horarioFuncionamento; + @Enumerated(EnumType.STRING) + private TipoDiasSemana diasFuncionamento; + + + // campos internos + private String estrutura; + + private String responsaveis; + + private String telefoneMinisterio; + + private String orcamento; + + private String justificativa; + + private String meta; + + @Enumerated(EnumType.STRING) + private TipoTemporalidade temporalidade; + + private boolean possuiMonitoramento; + + // + private String estadosMunicipioComPrograma; + + // + private String publicPrioritario; + + @Temporal(TemporalType.DATE) + @DateTimeFormat(style="S-") + private Date dataInicio; + + // + private String mecanismos; + + // + private String parcerias; + + private boolean legislacaoPropria; + private String descLegislacao; + + private String obs; + + @Enumerated(EnumType.STRING) + private TipoStatus estado; + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Configurable.aj b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Configurable.aj new file mode 100644 index 0000000000000000000000000000000000000000..e6f38be415baf8043746afaaadb88b316509d15c --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Configurable.aj @@ -0,0 +1,13 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Projeto; +import org.springframework.beans.factory.annotation.Configurable; + +privileged aspect Projeto_Roo_Configurable { + + declare @type: Projeto: @Configurable; + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_JavaBean.aj b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_JavaBean.aj new file mode 100644 index 0000000000000000000000000000000000000000..a1472a0fae03b769733587f4824503d063bc2c70 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_JavaBean.aj @@ -0,0 +1,337 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Ministerio; +import br.ufpr.c3sl.participatorio.Projeto; +import br.ufpr.c3sl.participatorio.enums.TipoAcao; +import br.ufpr.c3sl.participatorio.enums.TipoDemanda; +import br.ufpr.c3sl.participatorio.enums.TipoDiasSemana; +import br.ufpr.c3sl.participatorio.enums.TipoStatus; +import br.ufpr.c3sl.participatorio.enums.TipoTemporalidade; +import java.util.Date; + +privileged aspect Projeto_Roo_JavaBean { + + public Projeto Projeto.getPai() { + return this.pai; + } + + public void Projeto.setPai(Projeto pai) { + this.pai = pai; + } + + public String Projeto.getNome() { + return this.nome; + } + + public void Projeto.setNome(String nome) { + this.nome = nome; + } + + public TipoDemanda Projeto.getDemanda() { + return this.demanda; + } + + public void Projeto.setDemanda(TipoDemanda demanda) { + this.demanda = demanda; + } + + public TipoAcao Projeto.getAcao() { + return this.acao; + } + + public void Projeto.setAcao(TipoAcao acao) { + this.acao = acao; + } + + public String Projeto.getOutroAcao() { + return this.outroAcao; + } + + public void Projeto.setOutroAcao(String outroAcao) { + this.outroAcao = outroAcao; + } + + public Ministerio Projeto.getMinisterio() { + return this.ministerio; + } + + public void Projeto.setMinisterio(Ministerio ministerio) { + this.ministerio = ministerio; + } + + public String Projeto.getObjetivo() { + return this.objetivo; + } + + public void Projeto.setObjetivo(String objetivo) { + this.objetivo = objetivo; + } + + public String Projeto.getRua() { + return this.rua; + } + + public void Projeto.setRua(String rua) { + this.rua = rua; + } + + public String Projeto.getNumero() { + return this.numero; + } + + public void Projeto.setNumero(String numero) { + this.numero = numero; + } + + public String Projeto.getComplemento() { + return this.complemento; + } + + public void Projeto.setComplemento(String complemento) { + this.complemento = complemento; + } + + public String Projeto.getBairro() { + return this.bairro; + } + + public void Projeto.setBairro(String bairro) { + this.bairro = bairro; + } + + public String Projeto.getMunicipio() { + return this.municipio; + } + + public void Projeto.setMunicipio(String municipio) { + this.municipio = municipio; + } + + public String Projeto.getCep() { + return this.cep; + } + + public void Projeto.setCep(String cep) { + this.cep = cep; + } + + public String Projeto.getResponsavel() { + return this.responsavel; + } + + public void Projeto.setResponsavel(String responsavel) { + this.responsavel = responsavel; + } + + public String Projeto.getTelefones() { + return this.telefones; + } + + public void Projeto.setTelefones(String telefones) { + this.telefones = telefones; + } + + public String Projeto.getEmail() { + return this.email; + } + + public void Projeto.setEmail(String email) { + this.email = email; + } + + public String Projeto.getPublicoAlvo() { + return this.publicoAlvo; + } + + public void Projeto.setPublicoAlvo(String publicoAlvo) { + this.publicoAlvo = publicoAlvo; + } + + public String Projeto.getFormaAcesso() { + return this.formaAcesso; + } + + public void Projeto.setFormaAcesso(String formaAcesso) { + this.formaAcesso = formaAcesso; + } + + public String Projeto.getSite() { + return this.site; + } + + public void Projeto.setSite(String site) { + this.site = site; + } + + public String Projeto.getComoFunciona() { + return this.comoFunciona; + } + + public void Projeto.setComoFunciona(String comoFunciona) { + this.comoFunciona = comoFunciona; + } + + public String Projeto.getNoticias() { + return this.noticias; + } + + public void Projeto.setNoticias(String noticias) { + this.noticias = noticias; + } + + public String Projeto.getHorarioFuncionamento() { + return this.horarioFuncionamento; + } + + public void Projeto.setHorarioFuncionamento(String horarioFuncionamento) { + this.horarioFuncionamento = horarioFuncionamento; + } + + public TipoDiasSemana Projeto.getDiasFuncionamento() { + return this.diasFuncionamento; + } + + public void Projeto.setDiasFuncionamento(TipoDiasSemana diasFuncionamento) { + this.diasFuncionamento = diasFuncionamento; + } + + public String Projeto.getEstrutura() { + return this.estrutura; + } + + public void Projeto.setEstrutura(String estrutura) { + this.estrutura = estrutura; + } + + public String Projeto.getResponsaveis() { + return this.responsaveis; + } + + public void Projeto.setResponsaveis(String responsaveis) { + this.responsaveis = responsaveis; + } + + public String Projeto.getTelefoneMinisterio() { + return this.telefoneMinisterio; + } + + public void Projeto.setTelefoneMinisterio(String telefoneMinisterio) { + this.telefoneMinisterio = telefoneMinisterio; + } + + public String Projeto.getOrcamento() { + return this.orcamento; + } + + public void Projeto.setOrcamento(String orcamento) { + this.orcamento = orcamento; + } + + public String Projeto.getJustificativa() { + return this.justificativa; + } + + public void Projeto.setJustificativa(String justificativa) { + this.justificativa = justificativa; + } + + public String Projeto.getMeta() { + return this.meta; + } + + public void Projeto.setMeta(String meta) { + this.meta = meta; + } + + public TipoTemporalidade Projeto.getTemporalidade() { + return this.temporalidade; + } + + public void Projeto.setTemporalidade(TipoTemporalidade temporalidade) { + this.temporalidade = temporalidade; + } + + public boolean Projeto.isPossuiMonitoramento() { + return this.possuiMonitoramento; + } + + public void Projeto.setPossuiMonitoramento(boolean possuiMonitoramento) { + this.possuiMonitoramento = possuiMonitoramento; + } + + public String Projeto.getEstadosMunicipioComPrograma() { + return this.estadosMunicipioComPrograma; + } + + public void Projeto.setEstadosMunicipioComPrograma(String estadosMunicipioComPrograma) { + this.estadosMunicipioComPrograma = estadosMunicipioComPrograma; + } + + public String Projeto.getPublicPrioritario() { + return this.publicPrioritario; + } + + public void Projeto.setPublicPrioritario(String publicPrioritario) { + this.publicPrioritario = publicPrioritario; + } + + public Date Projeto.getDataInicio() { + return this.dataInicio; + } + + public void Projeto.setDataInicio(Date dataInicio) { + this.dataInicio = dataInicio; + } + + public String Projeto.getMecanismos() { + return this.mecanismos; + } + + public void Projeto.setMecanismos(String mecanismos) { + this.mecanismos = mecanismos; + } + + public String Projeto.getParcerias() { + return this.parcerias; + } + + public void Projeto.setParcerias(String parcerias) { + this.parcerias = parcerias; + } + + public boolean Projeto.isLegislacaoPropria() { + return this.legislacaoPropria; + } + + public void Projeto.setLegislacaoPropria(boolean legislacaoPropria) { + this.legislacaoPropria = legislacaoPropria; + } + + public String Projeto.getDescLegislacao() { + return this.descLegislacao; + } + + public void Projeto.setDescLegislacao(String descLegislacao) { + this.descLegislacao = descLegislacao; + } + + public String Projeto.getObs() { + return this.obs; + } + + public void Projeto.setObs(String obs) { + this.obs = obs; + } + + public TipoStatus Projeto.getEstado() { + return this.estado; + } + + public void Projeto.setEstado(TipoStatus estado) { + this.estado = estado; + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Jpa_ActiveRecord.aj b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Jpa_ActiveRecord.aj new file mode 100644 index 0000000000000000000000000000000000000000..237c4bb676cad546f91ede964414a508130526e9 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Jpa_ActiveRecord.aj @@ -0,0 +1,77 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Projeto; +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import org.springframework.transaction.annotation.Transactional; + +privileged aspect Projeto_Roo_Jpa_ActiveRecord { + + @PersistenceContext + transient EntityManager Projeto.entityManager; + + public static final EntityManager Projeto.entityManager() { + EntityManager em = new Projeto().entityManager; + if (em == null) throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)"); + return em; + } + + public static long Projeto.countProjetoes() { + return entityManager().createQuery("SELECT COUNT(o) FROM Projeto o", Long.class).getSingleResult(); + } + + public static List<Projeto> Projeto.findAllProjetoes() { + return entityManager().createQuery("SELECT o FROM Projeto o", Projeto.class).getResultList(); + } + + public static Projeto Projeto.findProjeto(Long id) { + if (id == null) return null; + return entityManager().find(Projeto.class, id); + } + + public static List<Projeto> Projeto.findProjetoEntries(int firstResult, int maxResults) { + return entityManager().createQuery("SELECT o FROM Projeto o", Projeto.class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); + } + + @Transactional + public void Projeto.persist() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.persist(this); + } + + @Transactional + public void Projeto.remove() { + if (this.entityManager == null) this.entityManager = entityManager(); + if (this.entityManager.contains(this)) { + this.entityManager.remove(this); + } else { + Projeto attached = Projeto.findProjeto(this.id); + this.entityManager.remove(attached); + } + } + + @Transactional + public void Projeto.flush() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.flush(); + } + + @Transactional + public void Projeto.clear() { + if (this.entityManager == null) this.entityManager = entityManager(); + this.entityManager.clear(); + } + + @Transactional + public Projeto Projeto.merge() { + if (this.entityManager == null) this.entityManager = entityManager(); + Projeto merged = this.entityManager.merge(this); + this.entityManager.flush(); + return merged; + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Jpa_Entity.aj b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Jpa_Entity.aj new file mode 100644 index 0000000000000000000000000000000000000000..c7168730deee5971ab26b13fbd70bd28a7017507 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_Jpa_Entity.aj @@ -0,0 +1,43 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Projeto; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Version; + +privileged aspect Projeto_Roo_Jpa_Entity { + + declare @type: Projeto: @Entity; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long Projeto.id; + + @Version + @Column(name = "version") + private Integer Projeto.version; + + public Long Projeto.getId() { + return this.id; + } + + public void Projeto.setId(Long id) { + this.id = id; + } + + public Integer Projeto.getVersion() { + return this.version; + } + + public void Projeto.setVersion(Integer version) { + this.version = version; + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_ToString.aj b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_ToString.aj new file mode 100644 index 0000000000000000000000000000000000000000..e287b0d5beea99519e60da33bbeb6b71d6885712 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/Projeto_Roo_ToString.aj @@ -0,0 +1,16 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio; + +import br.ufpr.c3sl.participatorio.Projeto; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +privileged aspect Projeto_Roo_ToString { + + public String Projeto.toString() { + return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoAcao.java b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoAcao.java new file mode 100644 index 0000000000000000000000000000000000000000..fb747ccef5f95c0a2a90a080c60ea0afc4262cd4 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoAcao.java @@ -0,0 +1,6 @@ +package br.ufpr.c3sl.participatorio.enums; + + +public enum TipoAcao { + Serviço,Programa,Projeto,Ação,Agenda,Plano,Outro; +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoDemanda.java b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoDemanda.java new file mode 100644 index 0000000000000000000000000000000000000000..a2e820c6ab2c4c39b00e2c355ff6a2cff1207d76 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoDemanda.java @@ -0,0 +1,7 @@ +package br.ufpr.c3sl.participatorio.enums; + + +public enum TipoDemanda { + Educação,Trabalho,Lazer,Esporte,Turismo,Ecologia_e_Meio_Ambiente, + Cultura,Saúde,Participação_e_Voluntariado,Justiça,Onde_Ir,Seus_Direitos; +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoDiasSemana.java b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoDiasSemana.java new file mode 100644 index 0000000000000000000000000000000000000000..5d93449fe82a8ddfd4094f26a341fe1e0fc229b8 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoDiasSemana.java @@ -0,0 +1,6 @@ +package br.ufpr.c3sl.participatorio.enums; + + +public enum TipoDiasSemana { + Domingo,Segunda,Terça,Quarta,Quinta,Sexta,Sábado; +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoProjeto.java b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoProjeto.java new file mode 100644 index 0000000000000000000000000000000000000000..be5ec7a253b1e9afe49b6ab59834edd0056ed8e0 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoProjeto.java @@ -0,0 +1,6 @@ +package br.ufpr.c3sl.participatorio.enums; + + +public enum TipoProjeto { + Nacional,Estadual,Municipal,Outro; +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoStatus.java b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..f671788d1c325f97ff1f280a813a338d2d304a23 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoStatus.java @@ -0,0 +1,6 @@ +package br.ufpr.c3sl.participatorio.enums; + + +public enum TipoStatus { + Efetivo,Candidato,Rejeitado; +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoTemporalidade.java b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoTemporalidade.java new file mode 100644 index 0000000000000000000000000000000000000000..b596df97c456b4b251773665e3e3e8af14639522 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/enums/TipoTemporalidade.java @@ -0,0 +1,6 @@ +package br.ufpr.c3sl.participatorio.enums; + + +public enum TipoTemporalidade { + Temporario,Permanente; +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/web/ApplicationConversionServiceFactoryBean.java b/src/main/java/br/ufpr/c3sl/participatorio/web/ApplicationConversionServiceFactoryBean.java new file mode 100644 index 0000000000000000000000000000000000000000..1c72fc5b871ecb60893a61ad457101f8843f168d --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/web/ApplicationConversionServiceFactoryBean.java @@ -0,0 +1,18 @@ +package br.ufpr.c3sl.participatorio.web; + +import org.springframework.format.FormatterRegistry; +import org.springframework.format.support.FormattingConversionServiceFactoryBean; +import org.springframework.roo.addon.web.mvc.controller.converter.RooConversionService; + +/** + * A central place to register application converters and formatters. + */ +@RooConversionService +public class ApplicationConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean { + + @Override + protected void installFormatters(FormatterRegistry registry) { + super.installFormatters(registry); + // Register application converters and formatters + } +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/web/ApplicationConversionServiceFactoryBean_Roo_ConversionService.aj b/src/main/java/br/ufpr/c3sl/participatorio/web/ApplicationConversionServiceFactoryBean_Roo_ConversionService.aj new file mode 100644 index 0000000000000000000000000000000000000000..dc540a934fffb32f396bf57452bac8a7f1c73fb4 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/web/ApplicationConversionServiceFactoryBean_Roo_ConversionService.aj @@ -0,0 +1,79 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio.web; + +import br.ufpr.c3sl.participatorio.Ministerio; +import br.ufpr.c3sl.participatorio.Projeto; +import br.ufpr.c3sl.participatorio.web.ApplicationConversionServiceFactoryBean; +import org.springframework.beans.factory.annotation.Configurable; +import org.springframework.core.convert.converter.Converter; +import org.springframework.format.FormatterRegistry; + +privileged aspect ApplicationConversionServiceFactoryBean_Roo_ConversionService { + + declare @type: ApplicationConversionServiceFactoryBean: @Configurable; + + public Converter<Ministerio, String> ApplicationConversionServiceFactoryBean.getMinisterioToStringConverter() { + return new org.springframework.core.convert.converter.Converter<br.ufpr.c3sl.participatorio.Ministerio, java.lang.String>() { + public String convert(Ministerio ministerio) { + return new StringBuilder().append(ministerio.getNome()).toString(); + } + }; + } + + public Converter<Long, Ministerio> ApplicationConversionServiceFactoryBean.getIdToMinisterioConverter() { + return new org.springframework.core.convert.converter.Converter<java.lang.Long, br.ufpr.c3sl.participatorio.Ministerio>() { + public br.ufpr.c3sl.participatorio.Ministerio convert(java.lang.Long id) { + return Ministerio.findMinisterio(id); + } + }; + } + + public Converter<String, Ministerio> ApplicationConversionServiceFactoryBean.getStringToMinisterioConverter() { + return new org.springframework.core.convert.converter.Converter<java.lang.String, br.ufpr.c3sl.participatorio.Ministerio>() { + public br.ufpr.c3sl.participatorio.Ministerio convert(String id) { + return getObject().convert(getObject().convert(id, Long.class), Ministerio.class); + } + }; + } + + public Converter<Projeto, String> ApplicationConversionServiceFactoryBean.getProjetoToStringConverter() { + return new org.springframework.core.convert.converter.Converter<br.ufpr.c3sl.participatorio.Projeto, java.lang.String>() { + public String convert(Projeto projeto) { + return new StringBuilder().append(projeto.getNome()).append(' ').append(projeto.getOutroAcao()).append(' ').append(projeto.getObjetivo()).append(' ').append(projeto.getRua()).toString(); + } + }; + } + + public Converter<Long, Projeto> ApplicationConversionServiceFactoryBean.getIdToProjetoConverter() { + return new org.springframework.core.convert.converter.Converter<java.lang.Long, br.ufpr.c3sl.participatorio.Projeto>() { + public br.ufpr.c3sl.participatorio.Projeto convert(java.lang.Long id) { + return Projeto.findProjeto(id); + } + }; + } + + public Converter<String, Projeto> ApplicationConversionServiceFactoryBean.getStringToProjetoConverter() { + return new org.springframework.core.convert.converter.Converter<java.lang.String, br.ufpr.c3sl.participatorio.Projeto>() { + public br.ufpr.c3sl.participatorio.Projeto convert(String id) { + return getObject().convert(getObject().convert(id, Long.class), Projeto.class); + } + }; + } + + public void ApplicationConversionServiceFactoryBean.installLabelConverters(FormatterRegistry registry) { + registry.addConverter(getMinisterioToStringConverter()); + registry.addConverter(getIdToMinisterioConverter()); + registry.addConverter(getStringToMinisterioConverter()); + registry.addConverter(getProjetoToStringConverter()); + registry.addConverter(getIdToProjetoConverter()); + registry.addConverter(getStringToProjetoConverter()); + } + + public void ApplicationConversionServiceFactoryBean.afterPropertiesSet() { + super.afterPropertiesSet(); + installLabelConverters(getObject()); + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/web/MinisterioController.java b/src/main/java/br/ufpr/c3sl/participatorio/web/MinisterioController.java new file mode 100644 index 0000000000000000000000000000000000000000..180795456ecf07d3d118a7614612b7450e16f9f6 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/web/MinisterioController.java @@ -0,0 +1,12 @@ +package br.ufpr.c3sl.participatorio.web; + +import br.ufpr.c3sl.participatorio.Ministerio; +import org.springframework.roo.addon.web.mvc.controller.scaffold.RooWebScaffold; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@RequestMapping("/ministerios") +@Controller +@RooWebScaffold(path = "ministerios", formBackingObject = Ministerio.class) +public class MinisterioController { +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/web/MinisterioController_Roo_Controller.aj b/src/main/java/br/ufpr/c3sl/participatorio/web/MinisterioController_Roo_Controller.aj new file mode 100644 index 0000000000000000000000000000000000000000..f191088de411c458581a084de0042beb75116e74 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/web/MinisterioController_Roo_Controller.aj @@ -0,0 +1,102 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio.web; + +import br.ufpr.c3sl.participatorio.Ministerio; +import br.ufpr.c3sl.participatorio.web.MinisterioController; +import java.io.UnsupportedEncodingException; +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.util.UriUtils; +import org.springframework.web.util.WebUtils; + +privileged aspect MinisterioController_Roo_Controller { + + @RequestMapping(method = RequestMethod.POST, produces = "text/html") + public String MinisterioController.create(@Valid Ministerio ministerio, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { + if (bindingResult.hasErrors()) { + populateEditForm(uiModel, ministerio); + return "ministerios/create"; + } + uiModel.asMap().clear(); + ministerio.persist(); + return "redirect:/ministerios/" + encodeUrlPathSegment(ministerio.getId().toString(), httpServletRequest); + } + + @RequestMapping(params = "form", produces = "text/html") + public String MinisterioController.createForm(Model uiModel) { + populateEditForm(uiModel, new Ministerio()); + return "ministerios/create"; + } + + @RequestMapping(value = "/{id}", produces = "text/html") + public String MinisterioController.show(@PathVariable("id") Long id, Model uiModel) { + uiModel.addAttribute("ministerio", Ministerio.findMinisterio(id)); + uiModel.addAttribute("itemId", id); + return "ministerios/show"; + } + + @RequestMapping(produces = "text/html") + public String MinisterioController.list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) { + if (page != null || size != null) { + int sizeNo = size == null ? 10 : size.intValue(); + final int firstResult = page == null ? 0 : (page.intValue() - 1) * sizeNo; + uiModel.addAttribute("ministerios", Ministerio.findMinisterioEntries(firstResult, sizeNo)); + float nrOfPages = (float) Ministerio.countMinisterios() / sizeNo; + uiModel.addAttribute("maxPages", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages)); + } else { + uiModel.addAttribute("ministerios", Ministerio.findAllMinisterios()); + } + return "ministerios/list"; + } + + @RequestMapping(method = RequestMethod.PUT, produces = "text/html") + public String MinisterioController.update(@Valid Ministerio ministerio, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { + if (bindingResult.hasErrors()) { + populateEditForm(uiModel, ministerio); + return "ministerios/update"; + } + uiModel.asMap().clear(); + ministerio.merge(); + return "redirect:/ministerios/" + encodeUrlPathSegment(ministerio.getId().toString(), httpServletRequest); + } + + @RequestMapping(value = "/{id}", params = "form", produces = "text/html") + public String MinisterioController.updateForm(@PathVariable("id") Long id, Model uiModel) { + populateEditForm(uiModel, Ministerio.findMinisterio(id)); + return "ministerios/update"; + } + + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html") + public String MinisterioController.delete(@PathVariable("id") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) { + Ministerio ministerio = Ministerio.findMinisterio(id); + ministerio.remove(); + uiModel.asMap().clear(); + uiModel.addAttribute("page", (page == null) ? "1" : page.toString()); + uiModel.addAttribute("size", (size == null) ? "10" : size.toString()); + return "redirect:/ministerios"; + } + + void MinisterioController.populateEditForm(Model uiModel, Ministerio ministerio) { + uiModel.addAttribute("ministerio", ministerio); + } + + String MinisterioController.encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) { + String enc = httpServletRequest.getCharacterEncoding(); + if (enc == null) { + enc = WebUtils.DEFAULT_CHARACTER_ENCODING; + } + try { + pathSegment = UriUtils.encodePathSegment(pathSegment, enc); + } catch (UnsupportedEncodingException uee) {} + return pathSegment; + } + +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/web/ProjetoController.java b/src/main/java/br/ufpr/c3sl/participatorio/web/ProjetoController.java new file mode 100644 index 0000000000000000000000000000000000000000..507ec061e69c5948670b75e66229097cf40d82cd --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/web/ProjetoController.java @@ -0,0 +1,12 @@ +package br.ufpr.c3sl.participatorio.web; + +import br.ufpr.c3sl.participatorio.Projeto; +import org.springframework.roo.addon.web.mvc.controller.scaffold.RooWebScaffold; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@RequestMapping("/projetoes") +@Controller +@RooWebScaffold(path = "projetoes", formBackingObject = Projeto.class) +public class ProjetoController { +} diff --git a/src/main/java/br/ufpr/c3sl/participatorio/web/ProjetoController_Roo_Controller.aj b/src/main/java/br/ufpr/c3sl/participatorio/web/ProjetoController_Roo_Controller.aj new file mode 100644 index 0000000000000000000000000000000000000000..65e9a60743cfa55b6bdace7108f14d9a1c7a21e9 --- /dev/null +++ b/src/main/java/br/ufpr/c3sl/participatorio/web/ProjetoController_Roo_Controller.aj @@ -0,0 +1,125 @@ +// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. +// You may push code into the target .java compilation unit if you wish to edit any member(s). + +package br.ufpr.c3sl.participatorio.web; + +import br.ufpr.c3sl.participatorio.Ministerio; +import br.ufpr.c3sl.participatorio.Projeto; +import br.ufpr.c3sl.participatorio.enums.TipoAcao; +import br.ufpr.c3sl.participatorio.enums.TipoDemanda; +import br.ufpr.c3sl.participatorio.enums.TipoDiasSemana; +import br.ufpr.c3sl.participatorio.enums.TipoStatus; +import br.ufpr.c3sl.participatorio.enums.TipoTemporalidade; +import br.ufpr.c3sl.participatorio.web.ProjetoController; +import java.io.UnsupportedEncodingException; +import java.util.Arrays; +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import org.joda.time.format.DateTimeFormat; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.util.UriUtils; +import org.springframework.web.util.WebUtils; + +privileged aspect ProjetoController_Roo_Controller { + + @RequestMapping(method = RequestMethod.POST, produces = "text/html") + public String ProjetoController.create(@Valid Projeto projeto, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { + if (bindingResult.hasErrors()) { + populateEditForm(uiModel, projeto); + return "projetoes/create"; + } + uiModel.asMap().clear(); + projeto.persist(); + return "redirect:/projetoes/" + encodeUrlPathSegment(projeto.getId().toString(), httpServletRequest); + } + + @RequestMapping(params = "form", produces = "text/html") + public String ProjetoController.createForm(Model uiModel) { + populateEditForm(uiModel, new Projeto()); + return "projetoes/create"; + } + + @RequestMapping(value = "/{id}", produces = "text/html") + public String ProjetoController.show(@PathVariable("id") Long id, Model uiModel) { + addDateTimeFormatPatterns(uiModel); + uiModel.addAttribute("projeto", Projeto.findProjeto(id)); + uiModel.addAttribute("itemId", id); + return "projetoes/show"; + } + + @RequestMapping(produces = "text/html") + public String ProjetoController.list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) { + if (page != null || size != null) { + int sizeNo = size == null ? 10 : size.intValue(); + final int firstResult = page == null ? 0 : (page.intValue() - 1) * sizeNo; + uiModel.addAttribute("projetoes", Projeto.findProjetoEntries(firstResult, sizeNo)); + float nrOfPages = (float) Projeto.countProjetoes() / sizeNo; + uiModel.addAttribute("maxPages", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages)); + } else { + uiModel.addAttribute("projetoes", Projeto.findAllProjetoes()); + } + addDateTimeFormatPatterns(uiModel); + return "projetoes/list"; + } + + @RequestMapping(method = RequestMethod.PUT, produces = "text/html") + public String ProjetoController.update(@Valid Projeto projeto, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { + if (bindingResult.hasErrors()) { + populateEditForm(uiModel, projeto); + return "projetoes/update"; + } + uiModel.asMap().clear(); + projeto.merge(); + return "redirect:/projetoes/" + encodeUrlPathSegment(projeto.getId().toString(), httpServletRequest); + } + + @RequestMapping(value = "/{id}", params = "form", produces = "text/html") + public String ProjetoController.updateForm(@PathVariable("id") Long id, Model uiModel) { + populateEditForm(uiModel, Projeto.findProjeto(id)); + return "projetoes/update"; + } + + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html") + public String ProjetoController.delete(@PathVariable("id") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) { + Projeto projeto = Projeto.findProjeto(id); + projeto.remove(); + uiModel.asMap().clear(); + uiModel.addAttribute("page", (page == null) ? "1" : page.toString()); + uiModel.addAttribute("size", (size == null) ? "10" : size.toString()); + return "redirect:/projetoes"; + } + + void ProjetoController.addDateTimeFormatPatterns(Model uiModel) { + uiModel.addAttribute("projeto_datainicio_date_format", DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale())); + } + + void ProjetoController.populateEditForm(Model uiModel, Projeto projeto) { + uiModel.addAttribute("projeto", projeto); + addDateTimeFormatPatterns(uiModel); + uiModel.addAttribute("ministerios", Ministerio.findAllMinisterios()); + uiModel.addAttribute("projetoes", Projeto.findAllProjetoes()); + uiModel.addAttribute("tipoacaos", Arrays.asList(TipoAcao.values())); + uiModel.addAttribute("tipodemandas", Arrays.asList(TipoDemanda.values())); + uiModel.addAttribute("tipodiassemanas", Arrays.asList(TipoDiasSemana.values())); + uiModel.addAttribute("tipostatuses", Arrays.asList(TipoStatus.values())); + uiModel.addAttribute("tipotemporalidades", Arrays.asList(TipoTemporalidade.values())); + } + + String ProjetoController.encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) { + String enc = httpServletRequest.getCharacterEncoding(); + if (enc == null) { + enc = WebUtils.DEFAULT_CHARACTER_ENCODING; + } + try { + pathSegment = UriUtils.encodePathSegment(pathSegment, enc); + } catch (UnsupportedEncodingException uee) {} + return pathSegment; + } + +} diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000000000000000000000000000000000000..60313cd694a79ec723559bcf7f8c9a4e14234784 --- /dev/null +++ b/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> +<persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"> + <provider>org.hibernate.ejb.HibernatePersistence</provider> + <properties> + <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/> + <!-- value="create" to build a new database on each run; value="update" to modify an existing database; value="create-drop" means the same as "create" but also drops tables when Hibernate closes; value="validate" makes no changes to the database --> + <property name="hibernate.hbm2ddl.auto" value="create"/> + <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/> + <property name="hibernate.connection.charSet" value="UTF-8"/> + <!-- Uncomment the following two properties for JBoss only --> + <!-- property name="hibernate.validator.apply_to_ddl" value="false" /--> + <!-- property name="hibernate.validator.autoregister_listeners" value="false" /--> + </properties> + </persistence-unit> +</persistence> diff --git a/src/main/resources/META-INF/spring/applicationContext-security.xml b/src/main/resources/META-INF/spring/applicationContext-security.xml new file mode 100644 index 0000000000000000000000000000000000000000..b16657c39bfb72911a94015514b749605b345eb1 --- /dev/null +++ b/src/main/resources/META-INF/spring/applicationContext-security.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans:beans xmlns="http://www.springframework.org/schema/security" + xmlns:beans="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> + <!-- HTTP security configurations --> + <http auto-config="true" use-expressions="true"> + <form-login login-processing-url="/resources/j_spring_security_check" login-page="/login" authentication-failure-url="/login?login_error=t" /> + <logout logout-url="/resources/j_spring_security_logout" /> + <!-- Configure these elements to secure URIs in your application --> + <intercept-url pattern="/choices/**" access="hasRole('ROLE_ADMIN')" /> + <intercept-url pattern="/member/**" access="isAuthenticated()" /> + <intercept-url pattern="/resources/**" access="permitAll" /> + <intercept-url pattern="/**" access="permitAll" /> + </http> + <!-- Configure Authentication mechanism --> + <authentication-manager alias="authenticationManager"> + <!-- SHA-256 values can be produced using 'echo -n your_desired_password | sha256sum' (using normal *nix environments) --> + <authentication-provider> + <password-encoder hash="sha-256" /> + <user-service> + <user name="admin" password="8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918" authorities="ROLE_ADMIN" /> + <user name="user" password="04f8996da763b7a969b1028ee3007569eaf3a635486ddab211d512c85b9df8fb" authorities="ROLE_USER" /> + </user-service> + </authentication-provider> + </authentication-manager> +</beans:beans> \ No newline at end of file diff --git a/src/main/resources/META-INF/spring/applicationContext.xml b/src/main/resources/META-INF/spring/applicationContext.xml new file mode 100644 index 0000000000000000000000000000000000000000..30098a85a0ff078acf8deab51b366281b5c1eb30 --- /dev/null +++ b/src/main/resources/META-INF/spring/applicationContext.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"> + <!-- + This will automatically locate any and all property files you have + within your classpath, provided they fall under the META-INF/spring + directory. The located property files are parsed and their values can + then be used within application context files in the form of + ${propertyKey}. + --> + <context:property-placeholder location="classpath*:META-INF/spring/*.properties"/> + <!-- + Turn on AspectJ @Configurable support. As a result, any time you + instantiate an object, Spring will attempt to perform dependency + injection on that object. This occurs for instantiation via the "new" + keyword, as well as via reflection. This is possible because AspectJ + is used to "weave" Roo-based applications at compile time. In effect + this feature allows dependency injection of any object at all in your + system, which is a very useful feature (without @Configurable you'd + only be able to dependency inject objects acquired from Spring or + subsequently presented to a specific Spring dependency injection + method). Roo applications use this useful feature in a number of + areas, such as @PersistenceContext injection into entities. + --> + <context:spring-configured/> + <!-- + This declaration will cause Spring to locate every @Component, + @Repository and @Service in your application. In practical terms this + allows you to write a POJO and then simply annotate the new POJO as an + @Service and Spring will automatically detect, instantiate and + dependency inject your service at startup time. Importantly, you can + then also have your new service injected into any other class that + requires it simply by declaring a field for your service inside the + relying class and Spring will inject it. Note that two exclude filters + are declared. The first ensures that Spring doesn't spend time + introspecting Roo-specific ITD aspects. The second ensures Roo doesn't + instantiate your @Controller classes, as these should be instantiated + by a web tier application context. Refer to web.xml for more details + about the web tier application context setup services. + + Furthermore, this turns on @Autowired, @PostConstruct etc support. These + annotations allow you to use common Spring and Java Enterprise Edition + annotations in your classes without needing to do any special configuration. + The most commonly used annotation is @Autowired, which instructs Spring to + dependency inject an object into your class. + --> + <context:component-scan base-package="br.ufpr.c3sl.participatorio"> + <context:exclude-filter expression=".*_Roo_.*" type="regex"/> + <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/> + </context:component-scan> + <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource"> + <property name="driverClassName" value="${database.driverClassName}"/> + <property name="url" value="${database.url}"/> + <property name="username" value="${database.username}"/> + <property name="password" value="${database.password}"/> + <property name="testOnBorrow" value="true"/> + <property name="testOnReturn" value="true"/> + <property name="testWhileIdle" value="true"/> + <property name="timeBetweenEvictionRunsMillis" value="1800000"/> + <property name="numTestsPerEvictionRun" value="3"/> + <property name="minEvictableIdleTimeMillis" value="1800000"/> + </bean> + <bean class="org.springframework.orm.jpa.JpaTransactionManager" id="transactionManager"> + <property name="entityManagerFactory" ref="entityManagerFactory"/> + </bean> + <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/> + <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory"> + <property name="persistenceUnitName" value="persistenceUnit"/> + <property name="dataSource" ref="dataSource"/> + </bean> +</beans> diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..5014b358b525d5f9fc0ec08254e02fc86e58253a --- /dev/null +++ b/src/main/resources/log4j.properties @@ -0,0 +1,17 @@ +log4j.rootLogger=error, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# Print the date in ISO 8601 format +log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n + +log4j.appender.R=org.apache.log4j.RollingFileAppender +log4j.appender.R.File=application.log + +log4j.appender.R.MaxFileSize=100KB +# Keep one backup file +log4j.appender.R.MaxBackupIndex=1 + +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n diff --git a/src/main/webapp/WEB-INF/classes/alt.properties b/src/main/webapp/WEB-INF/classes/alt.properties new file mode 100644 index 0000000000000000000000000000000000000000..48df87ff7061bab6cc3792c035c5f8fdbf27bc33 --- /dev/null +++ b/src/main/webapp/WEB-INF/classes/alt.properties @@ -0,0 +1 @@ +styleSheet=resources/styles/alt.css diff --git a/src/main/webapp/WEB-INF/classes/standard.properties b/src/main/webapp/WEB-INF/classes/standard.properties new file mode 100644 index 0000000000000000000000000000000000000000..d8dc0164ddc2c680ecd7434013f1e61136e78a5e --- /dev/null +++ b/src/main/webapp/WEB-INF/classes/standard.properties @@ -0,0 +1 @@ +styleSheet=resources/styles/standard.css diff --git a/src/main/webapp/WEB-INF/i18n/application.properties b/src/main/webapp/WEB-INF/i18n/application.properties new file mode 100644 index 0000000000000000000000000000000000000000..e72171986178c15dd899ce345a44ddcb2b69a4bd --- /dev/null +++ b/src/main/webapp/WEB-INF/i18n/application.properties @@ -0,0 +1,58 @@ +#Updated at Thu Jan 24 10:53:39 BRST 2013 +#Thu Jan 24 10:53:39 BRST 2013 +application_name=Participatorio +label_br_ufpr_c3sl_participatorio_ministerio=Ministerio +label_br_ufpr_c3sl_participatorio_ministerio_id=Id +label_br_ufpr_c3sl_participatorio_ministerio_nome=Nome +label_br_ufpr_c3sl_participatorio_ministerio_plural=Ministerios +label_br_ufpr_c3sl_participatorio_ministerio_version=Version +label_br_ufpr_c3sl_participatorio_projeto=Projeto +label_br_ufpr_c3sl_participatorio_projeto_acao=Acao +label_br_ufpr_c3sl_participatorio_projeto_bairro=Bairro +label_br_ufpr_c3sl_participatorio_projeto_cep=Cep +label_br_ufpr_c3sl_participatorio_projeto_comofunciona=Como Funciona +label_br_ufpr_c3sl_participatorio_projeto_complemento=Complemento +label_br_ufpr_c3sl_participatorio_projeto_datainicio=Data Inicio +label_br_ufpr_c3sl_participatorio_projeto_demanda=Demanda +label_br_ufpr_c3sl_participatorio_projeto_desclegislacao=Desc Legislacao +label_br_ufpr_c3sl_participatorio_projeto_diasfuncionamento=Dias Funcionamento +label_br_ufpr_c3sl_participatorio_projeto_email=Email +label_br_ufpr_c3sl_participatorio_projeto_estado=Estado +label_br_ufpr_c3sl_participatorio_projeto_estadosmunicipiocomprograma=Estados Municipio Com Programa +label_br_ufpr_c3sl_participatorio_projeto_estrutura=Estrutura +label_br_ufpr_c3sl_participatorio_projeto_formaacesso=Forma Acesso +label_br_ufpr_c3sl_participatorio_projeto_horariofuncionamento=Horario Funcionamento +label_br_ufpr_c3sl_participatorio_projeto_id=Id +label_br_ufpr_c3sl_participatorio_projeto_justificativa=Justificativa +label_br_ufpr_c3sl_participatorio_projeto_legislacaopropria=Legislacao Propria +label_br_ufpr_c3sl_participatorio_projeto_mecanismos=Mecanismos +label_br_ufpr_c3sl_participatorio_projeto_meta=Meta +label_br_ufpr_c3sl_participatorio_projeto_ministerio=Ministerio +label_br_ufpr_c3sl_participatorio_projeto_municipio=Municipio +label_br_ufpr_c3sl_participatorio_projeto_nome=Nome +label_br_ufpr_c3sl_participatorio_projeto_noticias=Noticias +label_br_ufpr_c3sl_participatorio_projeto_numero=Numero +label_br_ufpr_c3sl_participatorio_projeto_objetivo=Objetivo +label_br_ufpr_c3sl_participatorio_projeto_obs=Obs +label_br_ufpr_c3sl_participatorio_projeto_orcamento=Orcamento +label_br_ufpr_c3sl_participatorio_projeto_outroacao=Outro Acao +label_br_ufpr_c3sl_participatorio_projeto_pai=Pai +label_br_ufpr_c3sl_participatorio_projeto_parcerias=Parcerias +label_br_ufpr_c3sl_participatorio_projeto_plural=Projetoes +label_br_ufpr_c3sl_participatorio_projeto_possuimonitoramento=Possui Monitoramento +label_br_ufpr_c3sl_participatorio_projeto_publicoalvo=Publico Alvo +label_br_ufpr_c3sl_participatorio_projeto_publicprioritario=Public Prioritario +label_br_ufpr_c3sl_participatorio_projeto_responsaveis=Responsaveis +label_br_ufpr_c3sl_participatorio_projeto_responsavel=Responsavel +label_br_ufpr_c3sl_participatorio_projeto_rua=Rua +label_br_ufpr_c3sl_participatorio_projeto_site=Site +label_br_ufpr_c3sl_participatorio_projeto_telefoneministerio=Telefone Ministerio +label_br_ufpr_c3sl_participatorio_projeto_telefones=Telefones +label_br_ufpr_c3sl_participatorio_projeto_temporalidade=Temporalidade +label_br_ufpr_c3sl_participatorio_projeto_version=Version +menu_category_ministerio_label=Ministerio +menu_category_projeto_label=Projeto +menu_item_ministerio_list_label=Ministerios +menu_item_ministerio_new_label=Ministerio +menu_item_projeto_list_label=Projetoes +menu_item_projeto_new_label=Projeto diff --git a/src/main/webapp/WEB-INF/i18n/messages.properties b/src/main/webapp/WEB-INF/i18n/messages.properties new file mode 100644 index 0000000000000000000000000000000000000000..be4a7613801d351f2fbb784019e1c494b70c764b --- /dev/null +++ b/src/main/webapp/WEB-INF/i18n/messages.properties @@ -0,0 +1,99 @@ +#menu +global_menu_new=Create new {0} +global_menu_list=List all {0} +global_menu_find=Find by {0} +global_language_switch=Switch language to {0} +global_language=Language +global_sponsored=Sponsored by SpringSource +global_theme=Theme +global_theme_alt=alt +global_theme_standard=standard +global_generic={0} + +#welcome page +welcome_titlepane=Welcome to {0} +welcome_h3=Welcome to {0} +welcome_text=Spring Roo provides interactive, lightweight and user customizable tooling that enables rapid delivery of high performance enterprise Java applications. + +#entity labels +entity_list_all=List all {0} +entity_show=Show {0} +entity_create=Create new {0} +entity_update=Update {0} +entity_delete=Delete {0} +entity_delete_confirm=Are you sure want to delete this item? +entity_find=Find {0} +entity_not_found=No {0} found. +entity_not_found_single=No {0} found with this id. +entity_dependency_required=The following dependencies need to be created first: +entity_reference_not_managed=This relationship is managed from the {0} side. + +#button labels +button_home=Home +button_save=Save +button_update=Update +button_find=Find +button_cancel=Cancel +button_proceed=Proceed +button_submit=Submit +button_reset=Reset +button_end=End +button_showmessage=Show Message +button_showstacktrace=Show Stack Trace +button_showcookie=Show Cookie + +#field labels +field_simple_validation=Enter {0} {1} +field_invalid_email=Please enter a valid email +field_invalid_number=Number with \\'-\\' or \\'.\\' allowed +field_invalid_integer=Integer numbers only +field_invalid=Please enter valid {0} +field_required=required + +#list labels +list_first=First Page +list_next=Next Page +list_previous=Previous Page +list_last=Last Page +list_page=Page {0} of {1} +list_size=List results per page: + +#selenium +selenium_menu_test_suite=Test Suite + +#exception +exception_message=Exception Message +exception_stacktrace=Exception Stack Trace +exception_cookie=Cookies +exception_details=Details + +#dataAccessFailure_jspx +error_dataaccessfailure_title=Data access failure +error_dataaccessfailure_problemdescription=Sorry, a problem occurred while accessing the database. + +#resourceNotFound_jspx +error_resourcenotfound_title=Requested Resource Not Found +error_resourcenotfound_problemdescription=Sorry, we did not find the resource you were looking for. + +#uncaughtException_jspx +error_uncaughtexception_title=Internal Error +error_uncaughtexception_problemdescription=Sorry, we encountered an internal error. + +#webflow +webflow_menu_enter=Enter {0} flow +webflow_state1_title=Spring Web Flow - View State One +webflow_state1_message=This is a simple example to get started with Spring Web Flow. The buttons below lead you to another view state (Proceed) or to an end state. +webflow_state2_title=Spring Web Flow - View State Two +webflow_state2_message=This is a simple example to get started with Spring Web Flow. The buttons below lead you to another view state (Proceed) or to an end state. +webflow_endstate_title=Spring Web Flow - End State +webflow_endstate_message=You have now reached the end of this flow. + +#security +security_login_title=Spring Security Login +security_login_message=You have tried to access a protected area of this application. By default you can login as "admin", with a password of "admin". +security_login_form_name=Name +security_login_form_name_message=Enter your name +security_login_form_password=Password +security_login_form_password_message=Enter your password +security_login_unsuccessful=Your login attempt was not successful, try again. Reason: +security_logout=Logout \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/layouts/default.jspx b/src/main/webapp/WEB-INF/layouts/default.jspx new file mode 100644 index 0000000000000000000000000000000000000000..b045bc0f36ef53bc712c4594ec6e8a0e8902bf05 --- /dev/null +++ b/src/main/webapp/WEB-INF/layouts/default.jspx @@ -0,0 +1,28 @@ +<html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tiles="http://tiles.apache.org/tags-tiles" xmlns:spring="http://www.springframework.org/tags" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" > + + <jsp:output doctype-root-element="HTML" doctype-system="about:legacy-compat" /> + + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:directive.page pageEncoding="UTF-8" /> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=8" /> + + <util:load-scripts /> + + <spring:message code="application_name" var="app_name" htmlEscape="false"/> + <title><spring:message code="welcome_h3" arguments="${app_name}" /></title> + </head> + + <body class="tundra spring"> + <div id="wrapper"> + <tiles:insertAttribute name="header" ignore="true" /> + <tiles:insertAttribute name="menu" ignore="true" /> + <div id="main"> + <tiles:insertAttribute name="body"/> + <tiles:insertAttribute name="footer" ignore="true"/> + </div> + </div> + </body> +</html> diff --git a/src/main/webapp/WEB-INF/layouts/layouts.xml b/src/main/webapp/WEB-INF/layouts/layouts.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c9d6d4bb629c09c799c1a3ca674e58973f2838d --- /dev/null +++ b/src/main/webapp/WEB-INF/layouts/layouts.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE tiles-definitions PUBLIC + "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" + "http://tiles.apache.org/dtds/tiles-config_2_1.dtd"> + +<tiles-definitions> + + <definition name="default" template="/WEB-INF/layouts/default.jspx"> + <put-attribute name="header" value="/WEB-INF/views/header.jspx" /> + <put-attribute name="menu" value="/WEB-INF/views/menu.jspx" /> + <put-attribute name="footer" value="/WEB-INF/views/footer.jspx" /> + </definition> + + <definition name="public" template="/WEB-INF/layouts/default.jspx"> + <put-attribute name="header" value="/WEB-INF/views/header.jspx" /> + <put-attribute name="footer" value="/WEB-INF/views/footer.jspx" /> + </definition> + +</tiles-definitions> diff --git a/src/main/webapp/WEB-INF/spring/webmvc-config.xml b/src/main/webapp/WEB-INF/spring/webmvc-config.xml new file mode 100644 index 0000000000000000000000000000000000000000..c15a5580e09cd1ae4042648d673a2b758f1f298c --- /dev/null +++ b/src/main/webapp/WEB-INF/spring/webmvc-config.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"> + + <!-- The controllers are autodetected POJOs labeled with the @Controller annotation. --> + <context:component-scan base-package="br.ufpr.c3sl.participatorio" use-default-filters="false"> + <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/> + </context:component-scan> + + <!-- Turns on support for mapping requests to Spring MVC @Controller methods + Also registers default Formatters and Validators for use across all @Controllers --> + <mvc:annotation-driven conversion-service="applicationConversionService"/> + + + <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources --> + <mvc:resources location="/, classpath:/META-INF/web-resources/" mapping="/resources/**"/> + + <!-- Allows for mapping the DispatcherServlet to "/" by forwarding static resource + requests to the container's default Servlet --> + <mvc:default-servlet-handler/> + + <!-- Register "global" interceptor beans to apply to all registered HandlerMappings --> + <mvc:interceptors> + <bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor"/> + <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="lang"/> + </mvc:interceptors> + + <!-- Selects a static view for rendering without the need for an explicit controller --> + <mvc:view-controller path="/login"/> + <mvc:view-controller path="/" view-name="index"/> + <mvc:view-controller path="/uncaughtException"/> + <mvc:view-controller path="/resourceNotFound"/> + <mvc:view-controller path="/dataAccessFailure"/> + + <!-- Resolves localized messages*.properties and application.properties files in the application to allow for internationalization. + The messages*.properties files translate Roo generated messages which are part of the admin interface, the + application.properties resource bundle localizes all application specific messages such as entity names and menu items. --> + <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application" p:fallbackToSystemLocale="false"/> + + <!-- Store preferred language configuration in a cookie --> + <bean class="org.springframework.web.servlet.i18n.CookieLocaleResolver" id="localeResolver" p:cookieName="locale"/> + + <!-- Resolves localized <theme_name>.properties files in the classpath to allow for theme support --> + <bean class="org.springframework.ui.context.support.ResourceBundleThemeSource" id="themeSource"/> + + <!-- Store preferred theme configuration in a cookie --> + <bean class="org.springframework.web.servlet.theme.CookieThemeResolver" id="themeResolver" p:cookieName="theme" p:defaultThemeName="standard"/> + + <!-- This bean resolves specific types of exceptions to corresponding logical - view names for error views. + The default behaviour of DispatcherServlet - is to propagate all exceptions to the servlet + container: this will happen - here with all other types of exceptions. --> + <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver" p:defaultErrorView="uncaughtException"> + <property name="exceptionMappings"> + <props> + <prop key=".DataAccessException">dataAccessFailure</prop> + <prop key=".NoSuchRequestHandlingMethodException">resourceNotFound</prop> + <prop key=".TypeMismatchException">resourceNotFound</prop> + <prop key=".MissingServletRequestParameterException">resourceNotFound</prop> + </props> + </property> + </bean> + + <!-- Enable this for integration of file upload functionality --> + <bean class="org.springframework.web.multipart.commons.CommonsMultipartResolver" id="multipartResolver"/> +<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" id="tilesViewResolver"> + <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/> + </bean> + <bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" id="tilesConfigurer"> + <property name="definitions"> + <list> + <value>/WEB-INF/layouts/layouts.xml</value> + <!-- Scan views directory for Tiles configurations --> + <value>/WEB-INF/views/**/views.xml</value> + </list> + </property> + </bean> +<bean class="br.ufpr.c3sl.participatorio.web.ApplicationConversionServiceFactoryBean" id="applicationConversionService"/> +</beans> diff --git a/src/main/webapp/WEB-INF/tags/form/create.tagx b/src/main/webapp/WEB-INF/tags/form/create.tagx new file mode 100644 index 0000000000000000000000000000000000000000..f8d78e791560fb5de4adf13b3636c1b77fcb4094 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/create.tagx @@ -0,0 +1,61 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes"/> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)"/> + <jsp:directive.attribute name="modelAttribute" type="java.lang.String" required="true" rtexprvalue="true" description="The name of the model attribute for form binding"/> + <jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="Specify the relative URL path (wit leading /)" /> + <jsp:directive.attribute name="compositePkField" type="java.lang.String" required="false" rtexprvalue="true" description="The field name of the composite primary key (only used if a composite PK is present in the form backing object)" /> + <jsp:directive.attribute name="multipart" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if this is a multipart form (default: false)" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this object, will default to a message bundle if not supplied"/> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Control if the title pane is opened or closed by default (default: true)"/> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)"/> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + <c:set var="enctype" value="application/x-www-form-urlencoded"/> + <c:if test="${multipart}"> + <c:set var="enctype" value="multipart/form-data"/> + </c:if> + <spring:message arguments="${label}" code="entity_create" var="title_msg" htmlEscape="false" /> + <util:panel id="${id}" title="${title_msg}" openPane="${openPane}"> + <spring:url value="${path}" var="form_url"/> + <c:set var="jsCall" value=""/> + <c:if test="${not empty compositePkField}"> + <c:set var="jsCall" value="encodePk()" /> + </c:if> + <form:form action="${form_url}" method="POST" modelAttribute="${modelAttribute}" enctype="${enctype}" onsubmit="${jsCall}"> + <form:errors cssClass="errors" delimiter="<p/>"/> + <c:if test="${not empty compositePkField}"> + <form:hidden id="_${fn:escapeXml(compositePkField)}_id" path="${fn:escapeXml(compositePkField)}" /> + <script type="text/javascript"> + <![CDATA[ + dojo.require("dojox.encoding.base64"); + function encodePk() { + var obj = new Object(); + dojo.query("input[name^=\"${compositePkField}.\"]").forEach(function(node, index, nodelist){ + obj[node.name.substring('${compositePkField}'.length + 1)] = node.value; + }); + var json = dojo.toJson(obj); + var tokArr = []; + for (var i = 0; i < json.length; i++) { + tokArr.push(json.charCodeAt(i)); + } + var encoded = dojox.encoding.base64.encode(tokArr); + dojo.byId('_${fn:escapeXml(compositePkField)}_id').value = encoded; + } + ]]> + </script> + </c:if> + <jsp:doBody /> + <div class="submit" id="${fn:escapeXml(id)}_submit"> + <spring:message code="button_save" var="save_button" htmlEscape="false" /> + <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));</script> + <input id="proceed" type="submit" value="${fn:escapeXml(save_button)}"/> + </div> + </form:form> + </util:panel> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/dependency.tagx b/src/main/webapp/WEB-INF/tags/form/dependency.tagx new file mode 100644 index 0000000000000000000000000000000000000000..4888a1283accce601460545e66ee2b7300a8582b --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/dependency.tagx @@ -0,0 +1,25 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes"/> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)"/> + <jsp:directive.attribute name="dependencies" type="java.util.Collection" required="true" rtexprvalue="true" description="The collection of dependencies which need to be listed"/> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this object, will default to a message bundle if not supplied"/> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Control if the title pane is opened or closed by default (default: true)"/> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)"/> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false"/> + </c:if> + <spring:message arguments="${label}" code="entity_create" var="title_msg" htmlEscape="false" /> + <util:panel id="${fn:escapeXml(id)}" title="${fn:escapeXml(title_msg)}" openPane="${openPane}"> + <spring:message code="entity_dependency_required"/> + <c:forEach items="${dependencies}" var="dependency" > + <p> + <field:reference field="${dependency[0]}" id="${fn:escapeXml(id)}_${dependency[0]}" path="/${dependency[1]}"/> + </p> + </c:forEach> + </util:panel> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/checkbox.tagx b/src/main/webapp/WEB-INF/tags/form/fields/checkbox.tagx new file mode 100644 index 0000000000000000000000000000000000000000..1804424d25e6a39313eda375f4acb84570824e4a --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/checkbox.tagx @@ -0,0 +1,38 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="disableFormBinding" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Set to true to disable Spring form binding" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + <c:set var="sec_field"> + <spring:escapeBody javaScriptEscape="true">${field}</spring:escapeBody> + </c:set> + + <script type="text/javascript">dojo.require("dijit.form.CheckBox");</script> + <div id="_${sec_id}_id"> + <label for="_${sec_field}_id"> + <c:out value="${fn:escapeXml(label)}" />: + </label> + <c:choose> + <c:when test="${disableFormBinding}"> + <input id="_${sec_field}_id" name="${sec_field}" type="checkbox"/> + </c:when> + <c:otherwise> + <form:checkbox id="_${sec_field}_id" path="${sec_field}"/> + </c:otherwise> + </c:choose> + <script type="text/javascript"> + Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id', widgetType : 'dijit.form.CheckBox', widgetAttrs : {}})); + </script> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/column.tagx b/src/main/webapp/WEB-INF/tags/form/fields/column.tagx new file mode 100644 index 0000000000000000000000000000000000000000..cfaddabd0d7fe8dfcdb15b541d0ebfc4b65b5cfe --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/column.tagx @@ -0,0 +1,63 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="property" type="java.lang.String" required="true" rtexprvalue="true" description="The property (field name) of the dataset to be displayed in a column (required)." /> + <jsp:directive.attribute name="maxLength" type="java.lang.Integer" required="false" rtexprvalue="true" description="Max displayed text length (default '10'). Unlimited if negative" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The column label to be used in the table (optional)." /> + <jsp:directive.attribute name="date" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate that this field is of type java.util.Date" /> + <jsp:directive.attribute name="calendar" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate that this field is of type java.util.Calendar" /> + <jsp:directive.attribute name="dateTimePattern" type="java.lang.String" required="false" rtexprvalue="true" description="The date / time pattern to use if the field is a date or calendar type" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${empty dateTimePattern}"> + <c:set value="MM/dd/yyyy" var="dateTimePattern" /> + </c:if> + + <c:choose> + <c:when test="${date and empty columnTypes}"> + <c:set var="columnTypes" value="date" scope="request" /> + <c:set var="columnDatePatterns" value="${dateTimePattern}" scope="request" /> + </c:when> + <c:when test="${date and not empty columnTypes}"> + <c:set var="columnTypes" value="${columnTypes}✏date" scope="request" /> + <c:set var="columnDatePatterns" value="${columnDatePatterns}✏${dateTimePattern}" scope="request" /> + </c:when> + <c:when test="${calendar and empty columnTypes}"> + <c:set var="columnTypes" value="calendar" scope="request" /> + <c:set var="columnDatePatterns" value="${dateTimePattern}" scope="request" /> + </c:when> + <c:when test="${calendar and not empty columnTypes}"> + <c:set var="columnTypes" value="${columnTypes}✏calendar" scope="request" /> + <c:set var="columnDatePatterns" value="${columnDatePatterns}✏${dateTimePattern}" scope="request" /> + </c:when> + <c:when test="${empty columnTypes}"> + <c:set var="columnTypes" value="default" scope="request" /> + <c:set var="columnDatePatterns" value="none" scope="request" /> + </c:when> + <c:otherwise> + <c:set var="columnTypes" value="${columnTypes}✏default" scope="request" /> + <c:set var="columnDatePatterns" value="${columnDatePatterns}✏none" scope="request" /> + </c:otherwise> + </c:choose> + + <c:choose> + <c:when test="${empty columnProperties and empty columnLabels}"> + <c:set var="columnProperties" value="${property}" scope="request" /> + <c:set var="columnLabels" value="${label}" scope="request" /> + <c:set var="columnMaxLengths" value="${empty maxLength ? 128 : maxLength}" scope="request" /> + </c:when> + <c:otherwise> + <c:set var="columnProperties" value="${columnProperties}✏${property}" scope="request" /> + <c:set var="columnLabels" value="${columnLabels}✏${label}" scope="request" /> + <c:set var="columnMaxLengths" value="${columnMaxLengths}✏${empty maxLength ? 128 : maxLength}" scope="request" /> + </c:otherwise> + </c:choose> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/datetime.tagx b/src/main/webapp/WEB-INF/tags/form/fields/datetime.tagx new file mode 100644 index 0000000000000000000000000000000000000000..93466128385cd57471f53fa134c9234cb1a18a10 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/datetime.tagx @@ -0,0 +1,75 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="dateTimePattern" type="java.lang.String" required="true" rtexprvalue="true" description="The format accepted in this field" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="required" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicates if this field is required (default false)" /> + <jsp:directive.attribute name="disabled" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if this field should be enabled" /> + <jsp:directive.attribute name="validationRegex" type="java.lang.String" required="false" rtexprvalue="true" description="Specify regular expression to be used for the validation of the input contents" /> + <jsp:directive.attribute name="validationMessageCode" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message (message property code) to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="validationMessage" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="future" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if the date / time should be in the future" /> + <jsp:directive.attribute name="past" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if the date / time should be in the past" /> + <jsp:directive.attribute name="disableFormBinding" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Set to true to disable Spring form binding" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty disabled}"> + <c:set value="false" var="disabled" /> + </c:if> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + <c:set var="sec_field"> + <spring:escapeBody javaScriptEscape="true" >${field}</spring:escapeBody> + </c:set> + + <c:if test="${empty required}"> + <c:set value="false" var="required" /> + </c:if> + + <script type="text/javascript">dojo.require('dijit.form.DateTextBox')</script> + <div id="_${sec_id}_id"> + <label for="_${sec_field}_id"> + <c:out value="${label}" /> + : + </label> + <c:choose> + <c:when test="${disableFormBinding}"> + <input id="_${sec_field}_id" name="${sec_field}" /> + </c:when> + <c:otherwise> + <form:input id="_${sec_field}_id" path="${sec_field}" disabled="${disabled}" /> + <br /> + <form:errors cssClass="errors" id="_${sec_field}_error_id" path="${sec_field}" /> + </c:otherwise> + </c:choose> + <spring:message arguments="${fn:escapeXml(label)}" code="field_invalid" var="field_invalid" htmlEscape="false" /> + <c:choose> + <c:when test="${required}"> + <spring:message code="field_required" var="field_required" htmlEscape="false" /> + <spring:message argumentSeparator="," arguments="${label},(${field_required})" code="field_simple_validation" var="field_validation" htmlEscape="false" /> + </c:when> + <c:otherwise> + <spring:message argumentSeparator="," arguments="${label}, " code="field_simple_validation" var="field_validation" htmlEscape="false" /> + </c:otherwise> + </c:choose> + <script type="text/javascript"> + <c:set var="sec_field_validation"> + <spring:escapeBody javaScriptEscape="true">${field_validation}</spring:escapeBody> + </c:set> + <c:set var="sec_field_invalid"> + <spring:escapeBody javaScriptEscape="true">${field_invalid}</spring:escapeBody> + </c:set> + <c:set var="sec_dateTimePattern"> + <spring:escapeBody javaScriptEscape="true">${dateTimePattern}</spring:escapeBody> + </c:set> + Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id', widgetType : 'dijit.form.DateTextBox', widgetAttrs : {promptMessage: '${sec_field_validation}', invalidMessage: '${sec_field_invalid}', required: ${required}, constraints: {datePattern : '${sec_dateTimePattern}', required : ${required}}, datePattern : '${sec_dateTimePattern}'}})); </script> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/display.tagx b/src/main/webapp/WEB-INF/tags/form/fields/display.tagx new file mode 100644 index 0000000000000000000000000000000000000000..a6e8f43c42e96b7ed1ec6de5192a5ae41efe04c8 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/display.tagx @@ -0,0 +1,48 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="object" type="java.lang.Object" required="true" rtexprvalue="true" description="The form backing object" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field name" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="date" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate that this field is of type java.util.Date" /> + <jsp:directive.attribute name="calendar" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate that this field is of type java.util.Calendar" /> + <jsp:directive.attribute name="dateTimePattern" type="java.lang.String" required="false" rtexprvalue="true" description="The date / time pattern to use if the field is a date or calendar type" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + <c:if test="${not empty object and empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${empty dateTimePattern}"> + <c:set value="MM/dd/yyyy" var="dateTimePattern" /> + </c:if> + + <div id="_${fn:escapeXml(id)}_id"> + <label for="_${fn:escapeXml(field)}_id"> + <c:out value="${label}" /> + : + </label> + <div class="box" id="_${fn:escapeXml(id)}_${fn:escapeXml(field)}_id"> + <c:choose> + <c:when test="${date}"> + <spring:escapeBody> + <fmt:formatDate value="${object[field]}" pattern="${fn:escapeXml(dateTimePattern)}" /> + </spring:escapeBody> + </c:when> + <c:when test="${calendar}"> + <spring:escapeBody> + <fmt:formatDate value="${object[field].time}" pattern="${fn:escapeXml(dateTimePattern)}" /> + </spring:escapeBody> + </c:when> + <c:otherwise> + <spring:eval expression="object[field]" /> + </c:otherwise> + </c:choose> + </div> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/editor.tagx b/src/main/webapp/WEB-INF/tags/form/fields/editor.tagx new file mode 100644 index 0000000000000000000000000000000000000000..c4c61928593df60f167b646670a973e673c28670 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/editor.tagx @@ -0,0 +1,60 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="required" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicates if this field is required (default false)" /> + <jsp:directive.attribute name="disabled" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if this field should be enabled" /> + <jsp:directive.attribute name="validationRegex" type="java.lang.String" required="false" rtexprvalue="true" description="Specify regular expression to be used for the validation of the input contents" /> + <jsp:directive.attribute name="validationMessageCode" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message (message property code) to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="validationMessage" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty disabled}"> + <c:set value="false" var="disabled" /> + </c:if> + + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${empty required}"> + <c:set value="false" var="required" /> + </c:if> + + <c:set var="sec_field"> + <spring:escapeBody javaScriptEscape="true" >${field}</spring:escapeBody> + </c:set> + + <script type="text/javascript">dojo.require("dijit.Editor");</script> + <div id="_${fn:escapeXml(id)}_id"> + <label for="_${sec_field}_id"> + <c:out value="${fn:escapeXml(label)}" /> + : + </label> + <form:hidden id="_${sec_field}_id" path="${sec_field}" /> + <div> + <div id="_${sec_field}_id_"></div> + <script type="text/javascript"> + Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id_', widgetType : 'dijit.Editor', widgetAttrs : {disabled: ${disabled}}})); + dojo.addOnLoad(function () { + var src = dojo.byId('_${sec_field}_id'); + var rte = dijit.byId('_${sec_field}_id_'); + rte.disabled = ${disabled}; + rte.onLoadDeferred.addCallback(function(){ + rte.setValue(src.value); + dojo.connect(rte, 'onBlur', function(){src.value = rte.getValue();}); + }); + }); + </script> + </div> + <br /> + <form:errors cssClass="errors" id="_${sec_field}_error_id" path="${sec_field}" /> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/input.tagx b/src/main/webapp/WEB-INF/tags/form/fields/input.tagx new file mode 100644 index 0000000000000000000000000000000000000000..aff5ea18159a05a5b204cfcfbdc2b6538e7bf05c --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/input.tagx @@ -0,0 +1,108 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="labelCode" type="java.lang.String" required="false" rtexprvalue="true" description="Key for label message bundle if label is not supplied" /> + <jsp:directive.attribute name="required" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicates if this field is required (default false)" /> + <jsp:directive.attribute name="disabled" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if this field should be enabled" /> + <jsp:directive.attribute name="validationRegex" type="java.lang.String" required="false" rtexprvalue="true" description="Specify regular expression to be used for the validation of the input contents" /> + <jsp:directive.attribute name="validationMessageCode" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message (message property code) to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="validationMessage" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="min" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the minimum length of the input contents" /> + <jsp:directive.attribute name="max" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the maximum length of the input contents" /> + <jsp:directive.attribute name="decimalMin" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the minimum size of the input contents" /> + <jsp:directive.attribute name="decimalMax" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the maximum size of the input contents" /> + <jsp:directive.attribute name="disableFormBinding" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Set to true to disable Spring form binding" /> + <jsp:directive.attribute name="type" type="java.lang.String" required="false" rtexprvalue="true" description="Set field type (default 'text', or 'password')" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty type}"> + <c:set value="text" var="type" /> + </c:if> + + <c:if test="${empty disabled}"> + <c:set value="false" var="disabled" /> + </c:if> + + <c:if test="${empty label}"> + <c:if test="${empty labelCode}"> + <c:set var="labelCode" value="${fn:substringAfter(id,'_')}" /> + </c:if> + <spring:message code="label_${fn:toLowerCase(labelCode)}" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${empty validationMessage}"> + <c:choose> + <c:when test="${empty validationMessageCode}"> + <spring:message arguments="${fn:escapeXml(label)}" code="field_invalid" var="field_invalid" htmlEscape="false" /> + </c:when> + <c:otherwise> + <spring:message arguments="${fn:escapeXml(label)}" code="${validationMessageCode}" var="field_invalid" htmlEscape="false" /> + </c:otherwise> + </c:choose> + </c:if> + + <c:if test="${empty required}"> + <c:set value="false" var="required" /> + </c:if> + + <c:set var="sec_field"> + <spring:escapeBody javaScriptEscape="true" >${field}</spring:escapeBody> + </c:set> + + <div id="_${fn:escapeXml(id)}_id"> + <label for="_${sec_field}_id"> + <c:out value="${fn:escapeXml(label)}" /> + : + </label> + <c:choose> + <c:when test="${disableFormBinding}"> + <input id="_${sec_field}_id" name="${sec_field}" type="${fn:escapeXml(type)}" /> + </c:when> + <c:otherwise> + <c:choose> + <c:when test="${type eq 'password'}"> + <form:password id="_${sec_field}_id" path="${sec_field}" disabled="${disabled}" /> + </c:when> + <c:otherwise> + <form:input id="_${sec_field}_id" path="${sec_field}" disabled="${disabled}" /> + </c:otherwise> + </c:choose> + <br /> + <form:errors cssClass="errors" id="_${sec_field}_error_id" path="${sec_field}" /> + </c:otherwise> + </c:choose> + <c:choose> + <c:when test="${required}"> + <spring:message code="field_required" var="field_required" htmlEscape="false" /> + <spring:message argumentSeparator="," arguments="${label},(${field_required})" code="field_simple_validation" var="field_validation" htmlEscape="false" /> + </c:when> + <c:otherwise> + <spring:message argumentSeparator="," arguments="${label}, " code="field_simple_validation" var="field_validation" htmlEscape="false" /> + </c:otherwise> + </c:choose> + <c:set var="sec_field_validation"> + <spring:escapeBody javaScriptEscape="true">${field_validation}</spring:escapeBody> + </c:set> + <c:set var="sec_field_invalid"> + <spring:escapeBody javaScriptEscape="true" htmlEscape="true">${field_invalid}</spring:escapeBody> + </c:set> + <c:set var="sec_field_required"> + <spring:escapeBody javaScriptEscape="true">${field_required}</spring:escapeBody> + </c:set> + <c:set var="sec_validation_regex" value="" /> + <c:if test="${!empty validationRegex}"> + <c:set var="sec_validation_regex" value="regExp : '${validationRegex}', " /> + </c:if> + <script type="text/javascript"> + Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id', widgetType : 'dijit.form.ValidationTextBox', widgetAttrs : {promptMessage: '${sec_field_validation}', invalidMessage: '${sec_field_invalid}', required : ${required}, ${sec_validation_regex} missingMessage : '${sec_field_required}' }})); + </script> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/reference.tagx b/src/main/webapp/WEB-INF/tags/form/fields/reference.tagx new file mode 100644 index 0000000000000000000000000000000000000000..a99eb1ca307387a05646b5a148e1b4ba6faf4e15 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/reference.tagx @@ -0,0 +1,41 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="The relative path to the respource" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="required" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicates if this field is required (default false)" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <div id="_${fn:escapeXml(id)}_id"> + <label for="_${fn:escapeXml(field)}_id"> + <c:out value="${fn:escapeXml(label)}" /> + : + </label> + <spring:url value="${path}" var="create_url"> + <spring:param name="form" /> + </spring:url> + <a href="${create_url}"> + <spring:url value="/resources/images/add.png" var="create_img_url" /> + <spring:message arguments="${field}" code="global_menu_new" var="add_message" htmlEscape="false" /> + <img alt="${fn:escapeXml(add_message)}" src="${create_img_url}" title="${fn:escapeXml(add_message)}" /> + </a> + <c:out value=" " /> + <spring:message arguments="${label}" code="entity_not_found" /> + <c:if test="${not empty required and required eq 'true'}"> + ( + <spring:message code="field_required" /> + ) + </c:if> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/select.tagx b/src/main/webapp/WEB-INF/tags/form/fields/select.tagx new file mode 100644 index 0000000000000000000000000000000000000000..e454985b20d1521885e2e113fa3db6a207d12be0 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/select.tagx @@ -0,0 +1,199 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="The relative path to the referenced resource" /> + <jsp:directive.attribute name="items" type="java.util.Collection" required="true" rtexprvalue="true" description="The name of the collection displayed in the select box" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="itemLabel" type="java.lang.String" required="false" rtexprvalue="true" description="Name of the property mapped to the inner text of the 'option' tag (will override the configured converter)" /> + <jsp:directive.attribute name="itemValue" type="java.lang.String" required="false" rtexprvalue="true" description="The identifier used as value in the select box (defaults to 'id' for non enum types)" /> + <jsp:directive.attribute name="required" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicates if this field is required (default false)" /> + <jsp:directive.attribute name="disabled" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if this field should be enabled" /> + <jsp:directive.attribute name="multiple" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if the select box should allow multiple selections" /> + <jsp:directive.attribute name="disableFormBinding" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Set to true to disable Spring form binding" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty disabled}"> + <c:set value="false" var="disabled" /> + </c:if> + + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${empty required}"> + <c:set value="false" var="required" /> + </c:if> + + <c:if test="${empty multiple}"> + <c:set value="false" var="multiple" /> + </c:if> + + <c:set var="sec_field"> + <spring:escapeBody javaScriptEscape="true" >${field}</spring:escapeBody> + </c:set> + + <c:set var="sec_itemLabel"> + <spring:escapeBody htmlEscape="true" >${itemLabel}</spring:escapeBody> + </c:set> + + <div id="_${fn:escapeXml(id)}_id"> + <c:choose> + <c:when test="${not empty items}"> + <label for="_${sec_field}_id"> + <c:out value="${fn:escapeXml(label)}" /> + : + </label> + <c:choose> + <c:when test="${empty itemValue}"> + <c:choose> + <c:when test="${disableFormBinding}"> + <c:choose> + <c:when test="${multiple}"> + <select id="_${sec_field}_id" name="${sec_field}" multiple="${multiple}"> + <c:forEach items="${items}" var="item"> + <option value="${item}"> + <c:choose> + <c:when test="${empty itemLabel}"> + <spring:eval expression="item" /> + </c:when> + <c:otherwise> + <spring:eval expression="item[sec_itemLabel]"/> + </c:otherwise> + </c:choose> + </option> + </c:forEach> + </select> + </c:when> + <c:otherwise> + <select id="_${sec_field}_id" name="${sec_field}"> + <c:forEach items="${items}" var="item"> + <option value="${item}"> + <c:choose> + <c:when test="${empty itemLabel}"> + <spring:eval expression="item" /> + </c:when> + <c:otherwise> + <spring:eval expression="item[sec_itemLabel]"/> + </c:otherwise> + </c:choose> + </option> + </c:forEach> + </select> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <c:choose> + <c:when test="${empty itemLabel}"> + <c:choose> + <c:when test="${multiple}"> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" multiple="${multiple}" /> + </c:when> + <c:otherwise> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" /> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <c:choose> + <c:when test="${multiple}"> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" multiple="${multiple}" itemLabel="${sec_itemLabel}"/> + </c:when> + <c:otherwise> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" itemLabel="${sec_itemLabel}"/> + </c:otherwise> + </c:choose> + </c:otherwise> + </c:choose> + <br /> + <form:errors cssClass="errors" id="_${sec_field}_error_id" path="${sec_field}" /> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <c:choose> + <c:when test="${disableFormBinding}"> + <c:choose> + <c:when test="${multiple}"> + <select id="_${sec_field}_id" name="${sec_field}" multiple="${multiple}"> + <c:forEach items="${items}" var="item"> + <option value="${item[fn:escapeXml(itemValue)]}"> + <c:choose> + <c:when test="${empty itemLabel}"> + <spring:eval expression="item" /> + </c:when> + <c:otherwise> + <spring:eval expression="item[sec_itemLabel]"/> + </c:otherwise> + </c:choose> + </option> + </c:forEach> + </select> + </c:when> + <c:otherwise> + <select id="_${sec_field}_id" name="${sec_field}" multiple="${multiple}"> + <c:forEach items="${items}" var="item"> + <option value="${item[fn:escapeXml(itemValue)]}"> + <c:choose> + <c:when test="${empty itemLabel}"> + <spring:eval expression="item" /> + </c:when> + <c:otherwise> + <spring:eval expression="item[sec_itemLabel]"/> + </c:otherwise> + </c:choose> + </option> + </c:forEach> + </select> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <c:choose> + <c:when test="${empty itemLabel}"> + <c:choose> + <c:when test="${multiple}"> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" multiple="${multiple}" itemValue="${fn:escapeXml(itemValue)}" /> + </c:when> + <c:otherwise> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" itemValue="${fn:escapeXml(itemValue)}" /> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <c:choose> + <c:when test="${multiple}"> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" multiple="${multiple}" itemValue="${fn:escapeXml(itemValue)}" itemLabel="${sec_itemLabel}"/> + </c:when> + <c:otherwise> + <form:select id="_${sec_field}_id" items="${items}" path="${sec_field}" disabled="${disabled}" itemValue="${fn:escapeXml(itemValue)}" itemLabel="${sec_itemLabel}"/> + </c:otherwise> + </c:choose> + </c:otherwise> + </c:choose> + <br /> + <form:errors cssClass="errors" id="_${sec_field}_error_id" path="${sec_field}" /> + </c:otherwise> + </c:choose> + </c:otherwise> + </c:choose> + <c:choose> + <c:when test="${multiple == false}"> + <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id', widgetType: 'dijit.form.FilteringSelect', widgetAttrs : {hasDownArrow : true}})); </script> + </c:when> + <!-- disabled due to http://jira.springframework.org/browse/ROO-909 <c:otherwise> <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${field}_id', widgetType: 'dijit.form.MultiSelect', widgetAttrs : {}})); </script> </c:otherwise> --> + </c:choose> + </c:when> + <c:otherwise> + <field:reference field="${label}" id="${id}" path="${path}" required="${required}" /> + </c:otherwise> + </c:choose> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/simple.tagx b/src/main/webapp/WEB-INF/tags/form/fields/simple.tagx new file mode 100644 index 0000000000000000000000000000000000000000..f8a86f328129c62429809879475fcfe8bae595bb --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/simple.tagx @@ -0,0 +1,35 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="text" type="java.lang.String" required="false" rtexprvalue="true" description="The text to be presented" /> + <jsp:directive.attribute name="messageCode" type="java.lang.String" required="false" rtexprvalue="true" description="The code for the message to be presented" /> + <jsp:directive.attribute name="messageCodeAttribute" type="java.lang.String" required="false" rtexprvalue="true" description="The attribute for the message code sto be presented" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <div id="_${fn:escapeXml(id)}_id"> + <label for="_${fn:escapeXml(field)}_id"> + <c:out value="${label}" /> + : + </label> + <c:choose> + <c:when test="${not empty messageCode}"> + <spring:message code="${messageCode}" arguments="${messageCodeAttribute}" /> + </c:when> + <c:otherwise> + <spring:eval expression="text" /> + </c:otherwise> + </c:choose> + </div> + <br /> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/table.tagx b/src/main/webapp/WEB-INF/tags/form/fields/table.tagx new file mode 100644 index 0000000000000000000000000000000000000000..80962b33a9aadff90d62e21f5e7a3905202f9377 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/table.tagx @@ -0,0 +1,162 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.tag import="java.util.ArrayList" /> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="data" type="java.util.Collection" required="true" rtexprvalue="true" description="The collection to be displayed in the table" /> + <jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="Specify the URL path" /> + <jsp:directive.attribute name="typeIdFieldName" type="java.lang.String" required="false" rtexprvalue="true" description="The identifier field name for the type (defaults to 'id')" /> + <jsp:directive.attribute name="create" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include 'create' link into table (default true)" /> + <jsp:directive.attribute name="update" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include 'update' link into table (default true)" /> + <jsp:directive.attribute name="delete" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include 'delete' link into table (default true)" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:set var="columnProperties" scope="request" /> + <c:set var="columnLabels" scope="request" /> + <c:set var="columnMaxLengths" scope="request" /> + <c:set var="columnTypes" scope="request" /> + <c:set var="columnDatePatterns" scope="request" /> + + <jsp:doBody /> + + <c:if test="${empty typeIdFieldName}"> + <c:set var="typeIdFieldName" value="id" /> + </c:if> + + <c:if test="${empty update}"> + <c:set var="update" value="true" /> + </c:if> + + <c:if test="${empty delete}"> + <c:set var="delete" value="true" /> + </c:if> + + <spring:message var="typeName" code="menu_item_${fn:toLowerCase(fn:split(id,'_')[fn:length(fn:split(id,'_')) - 1])}_new_label" htmlEscape="false" /> + <c:set var="lengths" value="${fn:split(columnMaxLengths, '✏')}" scope="request" /> + <c:set var="types" value="${fn:split(columnTypes, '✏')}" scope="request" /> + <c:set var="patterns" value="${fn:split(columnDatePatterns, '✏')}" scope="request" /> + + <spring:eval var="colCounter" expression="1" /> + + <table> + <thead> + <tr> + <c:forTokens items="${columnLabels}" delims="${'✏'}" var="columnHeading"> + <th> + <c:out value="${columnHeading}" /> + <spring:eval var="colCounter" expression="colCounter + 1" /> + </th> + </c:forTokens> + <th></th> + <c:if test="${update}"> + <th></th> + <spring:eval var="colCounter" expression="colCounter + 1" /> + </c:if> + <c:if test="${delete}"> + <th></th> + <spring:eval var="colCounter" expression="colCounter + 1" /> + </c:if> + </tr> + </thead> + <c:forEach items="${data}" var="item"> + <tr> + <c:forTokens items="${columnProperties}" delims="${'✏'}" var="column" varStatus="num"> + <c:set var="columnMaxLength" value="${lengths[num.count-1]}" /> + <c:set var="columnType" value="${types[num.count-1]}" /> + <c:set var="columnDatePattern" value="${patterns[num.count-1]}" /> + <td> + <c:choose> + <c:when test="${columnType eq 'date'}"> + <spring:escapeBody> + <fmt:formatDate value="${item[column]}" pattern="${fn:escapeXml(columnDatePattern)}" var="colTxt" /> + </spring:escapeBody> + </c:when> + <c:when test="${columnType eq 'calendar'}"> + <spring:escapeBody> + <fmt:formatDate value="${item[column].time}" pattern="${fn:escapeXml(columnDatePattern)}" var="colTxt"/> + </spring:escapeBody> + </c:when> + <c:otherwise> + <c:set var="colTxt"> + <spring:eval expression="item[column]" htmlEscape="false" /> + </c:set> + </c:otherwise> + </c:choose> + <c:if test="${columnMaxLength ge 0}"> + <c:set value="${fn:substring(colTxt, 0, columnMaxLength)}" var="colTxt" /> + </c:if> + <c:out value="${colTxt}" /> + </td> + </c:forTokens> + <c:set var="itemId"><spring:eval expression="item[typeIdFieldName]"/></c:set> + <td class="utilbox"> + <spring:url value="${path}/${itemId}" var="show_form_url" /> + <spring:url value="/resources/images/show.png" var="show_image_url" /> + <spring:message arguments="${typeName}" code="entity_show" var="show_label" htmlEscape="false" /> + <a href="${show_form_url}" alt="${fn:escapeXml(show_label)}" title="${fn:escapeXml(show_label)}"> + <img alt="${fn:escapeXml(show_label)}" class="image" src="${show_image_url}" title="${fn:escapeXml(show_label)}" /> + </a> + </td> + <c:if test="${update}"> + <td class="utilbox"> + <spring:url value="${path}/${itemId}" var="update_form_url"> + <spring:param name="form" /> + </spring:url> + <spring:url value="/resources/images/update.png" var="update_image_url" /> + <spring:message arguments="${typeName}" code="entity_update" var="update_label" htmlEscape="false" /> + <a href="${update_form_url}" alt="${fn:escapeXml(update_label)}" title="${fn:escapeXml(update_label)}"> + <img alt="${fn:escapeXml(update_label)}" class="image" src="${update_image_url}" title="${fn:escapeXml(update_label)}" /> + </a> + </td> + </c:if> + <c:if test="${delete}"> + <td class="utilbox"> + <spring:url value="${path}/${itemId}" var="delete_form_url" /> + <spring:url value="/resources/images/delete.png" var="delete_image_url" /> + <form:form action="${delete_form_url}" method="DELETE"> + <spring:message arguments="${typeName}" code="entity_delete" var="delete_label" htmlEscape="false" /> + <c:set var="delete_confirm_msg"> + <spring:escapeBody javaScriptEscape="true"> + <spring:message code="entity_delete_confirm" /> + </spring:escapeBody> + </c:set> + <input alt="${fn:escapeXml(delete_label)}" class="image" src="${delete_image_url}" title="${fn:escapeXml(delete_label)}" type="image" value="${fn:escapeXml(delete_label)}" onclick="return confirm('${delete_confirm_msg}');" /> + <c:if test="${not empty param.page}"> + <input name="page" type="hidden" value="1" /> + </c:if> + <c:if test="${not empty param.size}"> + <input name="size" type="hidden" value="${fn:escapeXml(param.size)}" /> + </c:if> + </form:form> + </td> + </c:if> + </tr> + </c:forEach> + <tr class="footer"> + <td colspan="${colCounter}"> + <c:if test="${empty create or create}"> + <span class="new"> + <spring:url value="${path}" var="create_url"> + <spring:param name="form" /> + </spring:url> + <a href="${create_url}"> + <spring:url value="/resources/images/add.png" var="create_img_url" /> + <spring:message arguments="${typeName}" code="global_menu_new" var="add_message" htmlEscape="false" /> + <img alt="${fn:escapeXml(add_message)}" src="${create_img_url}" title="${fn:escapeXml(add_message)}" /> + </a> + </span> + <c:out value=" " /> + </c:if> + <c:if test="${not empty maxPages}"> + <util:pagination maxPages="${maxPages}" page="${param.page}" size="${param.size}" /> + </c:if> + </td> + </tr> + </table> + + </c:if> + +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/fields/textarea.tagx b/src/main/webapp/WEB-INF/tags/form/fields/textarea.tagx new file mode 100644 index 0000000000000000000000000000000000000000..1b5ba2384f2044d9cb2cac048052f5e48e4a9dd4 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/fields/textarea.tagx @@ -0,0 +1,47 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="required" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicates if this field is required (default false)" /> + <jsp:directive.attribute name="disabled" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Specify if this field should be enabled" /> + <jsp:directive.attribute name="validationRegex" type="java.lang.String" required="false" rtexprvalue="true" description="Specify regular expression to be used for the validation of the input contents" /> + <jsp:directive.attribute name="validationMessageCode" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message (message property code) to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="validationMessage" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the message to be displayed if the regular expression validation fails" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty disabled}"> + <c:set value="false" var="disabled" /> + </c:if> + + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${empty required}"> + <c:set value="false" var="required" /> + </c:if> + + <c:set var="sec_field"> + <spring:escapeBody javaScriptEscape="true" >${field}</spring:escapeBody> + </c:set> + + <script type="text/javascript">dojo.require("dijit.form.SimpleTextarea");</script> + <div id="_${fn:escapeXml(id)}_id"> + <label for="_${sec_field}_id"> + <c:out value="${fn:escapeXml(label)}" /> + : + </label> + <form:textarea id="_${sec_field}_id" path="${sec_field}" disabled="${disabled}" /> + <br /> + <form:errors cssClass="errors" id="_${sec_field}_error_id" path="${sec_field}" /> + <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id', widgetType : 'dijit.form.SimpleTextarea', widgetAttrs : {disabled : ${disabled}}})); </script> + </div> + <br /> + + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/find.tagx b/src/main/webapp/WEB-INF/tags/form/find.tagx new file mode 100644 index 0000000000000000000000000000000000000000..095f20fdf0f08dad85acb5a243e3c22e5086aa85 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/find.tagx @@ -0,0 +1,31 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes"/> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)"/> + <jsp:directive.attribute name="finderName" type="java.lang.String" required="true" rtexprvalue="true" description="The finder name"/> + <jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="Specify the relative URL path (with leading /)" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Control if the title pane is opened or closed by default (default: true)"/> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)"/> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <c:set var="entityClass" value="${fn:substringAfter(id,'ff_')}" /> + <spring:message code="label_${fn:toLowerCase(entityClass)}_plural" var="label" htmlEscape="false" /> + </c:if> + <spring:message arguments="${fn:escapeXml(label)}" code="entity_find" var="title_msg" htmlEscape="false" /> + <util:panel id="${id}" title="${title_msg}" openPane="${openPane}"> + <spring:url value="${path}" var="form_url" /> + <form:form action="${form_url}" method="GET"> + <input type="hidden" name="find" value="${fn:escapeXml(finderName)}" /> + <jsp:doBody /> + <div class="submit" id="${fn:escapeXml(id)}_${fn:escapeXml(finderName)}_submit"> + <spring:message code="button_find" var="find_button" htmlEscape="false" /> + <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));</script> + <input id="proceed" type="submit" value="${fn:escapeXml(find_button)}"/> + </div> + </form:form> + </util:panel> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/list.tagx b/src/main/webapp/WEB-INF/tags/form/list.tagx new file mode 100644 index 0000000000000000000000000000000000000000..b81d256690086767a16c7dd6a7d62f6ed39f8d4d --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/list.tagx @@ -0,0 +1,31 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="items" type="java.util.Collection" required="true" rtexprvalue="true" description="The form backing object name" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this object, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="labelPlural" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this object, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Control if the title pane is opened or closed by default (default: true)" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + <c:if test="${empty labelPlural}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}_plural" var="labelPlural" htmlEscape="false" /> + </c:if> + <spring:message arguments="${labelPlural}" code="entity_list_all" var="title_msg" htmlEscape="false" /> + <util:panel id="${id}" title="${title_msg}" openPane="${openPane}"> + <c:choose> + <c:when test="${not empty items}"> + <jsp:doBody /> + </c:when> + <c:otherwise> + <spring:message arguments="${label}" code="entity_not_found" /> + </c:otherwise> + </c:choose> + </util:panel> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/show.tagx b/src/main/webapp/WEB-INF/tags/form/show.tagx new file mode 100644 index 0000000000000000000000000000000000000000..47cc06aa5e3219bdaadb60d45763a38e0c76e379 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/show.tagx @@ -0,0 +1,103 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="object" type="java.lang.Object" required="true" rtexprvalue="true" description="The form backing object" /> + <jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="Specify the URL path" /> + <jsp:directive.attribute name="list" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include 'list' link into table (default true)" /> + <jsp:directive.attribute name="create" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include 'create' link into table (default true)" /> + <jsp:directive.attribute name="update" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include 'update' link into table (default true)" /> + <jsp:directive.attribute name="delete" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include 'delete' link into table (default true)" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this object, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Control if the title pane is opened or closed by default (default: true)" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${empty list}"> + <c:set var="list" value="true" /> + </c:if> + + <c:if test="${empty create}"> + <c:set var="create" value="true" /> + </c:if> + + <c:if test="${empty update}"> + <c:set var="update" value="true" /> + </c:if> + + <c:if test="${empty delete}"> + <c:set var="delete" value="true" /> + </c:if> + + <spring:message var="typeName" code="menu_item_${fn:toLowerCase(fn:split(id,'_')[fn:length(fn:split(id,'_')) - 1])}_new_label" htmlEscape="false" /> + <spring:message var="typeNamePlural" code="menu_item_${fn:toLowerCase(fn:split(id,'_')[fn:length(fn:split(id,'_')) - 1])}_list_label" htmlEscape="false" /> + + <spring:message arguments="${label}" code="entity_show" var="title_msg" htmlEscape="false" /> + <util:panel id="${id}" title="${title_msg}" openPane="${openPane}"> + <c:choose> + <c:when test="${not empty object}"> + <jsp:doBody /> + <div class="quicklinks"> + <span> + <c:if test="${delete}"> + <spring:url value="${path}/${itemId}" var="delete_form_url" /> + <spring:url value="/resources/images/delete.png" var="delete_image_url" /> + <form:form action="${delete_form_url}" method="DELETE"> + <spring:message arguments="${typeName}" code="entity_delete" var="delete_label" htmlEscape="false" /> + <c:set var="delete_confirm_msg"> + <spring:escapeBody javaScriptEscape="true"> + <spring:message code="entity_delete_confirm" /> + </spring:escapeBody> + </c:set> + <input alt="${fn:escapeXml(delete_label)}" class="image" src="${delete_image_url}" title="${fn:escapeXml(delete_label)}" type="image" value="${fn:escapeXml(delete_label)}" onclick="return confirm('${fn:escapeXml(delete_confirm_msg)}');" /> + </form:form> + </c:if> + </span> + <span> + <c:if test="${update}"> + <spring:url value="${path}/${itemId}" var="update_form_url"> + <spring:param name="form" /> + </spring:url> + <spring:url value="/resources/images/update.png" var="update_image_url" /> + <spring:message arguments="${typeName}" code="entity_update" var="update_label" htmlEscape="false" /> + <a href="${update_form_url}" alt="${fn:escapeXml(update_label)}" title="${fn:escapeXml(update_label)}"> + <img alt="${fn:escapeXml(update_label)}" class="image" src="${update_image_url}" title="${fn:escapeXml(update_label)}" /> + </a> + </c:if> + </span> + <span> + <c:if test="${create}"> + <spring:url value="${path}" var="create_form_url"> + <spring:param name="form" /> + </spring:url> + <spring:url value="/resources/images/create.png" var="create_image_url" /> + <spring:message arguments="${typeName}" code="entity_create" var="create_label" htmlEscape="false" /> + <a href="${create_form_url}" alt="${fn:escapeXml(create_label)}" title="${fn:escapeXml(create_label)}"> + <img alt="${fn:escapeXml(create_label)}" class="image" src="${create_image_url}" title="${fn:escapeXml(create_label)}" /> + </a> + </c:if> + </span> + <span> + <c:if test="${list}"> + <spring:url value="${path}" var="list_form_url" /> + <spring:url value="/resources/images/list.png" var="list_image_url" /> + <spring:message arguments="${typeNamePlural}" code="entity_list_all" var="list_label" htmlEscape="false" /> + <a href="${list_form_url}" alt="${fn:escapeXml(list_label)}" title="${fn:escapeXml(list_label)}"> + <img alt="${fn:escapeXml(list_label)}" class="image" src="${list_image_url}" title="${fn:escapeXml(list_label)}" /> + </a> + </c:if> + </span> + </div> + </c:when> + <c:otherwise> + <spring:message arguments="${label}" code="entity_not_found_single" /> + </c:otherwise> + </c:choose> + </util:panel> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/form/update.tagx b/src/main/webapp/WEB-INF/tags/form/update.tagx new file mode 100644 index 0000000000000000000000000000000000000000..01217c5189cd7e40c5fbb907a4cedf07f783c211 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/form/update.tagx @@ -0,0 +1,47 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="modelAttribute" type="java.lang.String" required="true" rtexprvalue="true" description="The name of the model attribute for form binding" /> + <jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="Specify the relative URL path (with leading /)" /> + <jsp:directive.attribute name="multipart" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if this is a multipart form (default: false)" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this object, will default to a message bundle if not supplied" /> + <jsp:directive.attribute name="idField" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the field name of the id field (default 'id')" /> + <jsp:directive.attribute name="versionField" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the field name of the version field (default 'version'). If specified 'none' the version field will not be inlcuded (versionField='none')." /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Control if the title pane is opened or closed by default (default: true)" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + <c:if test="${empty label}"> + <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" /> + </c:if> + <c:if test="${empty idField}"> + <c:set value="id" var="idField" /> + </c:if> + <c:if test="${empty versionField}"> + <c:set value="version" var="versionField" /> + </c:if> + <c:set var="enctype" value="application/x-www-form-urlencoded"/> + <c:if test="${multipart}"> + <c:set var="enctype" value="multipart/form-data"/> + </c:if> + <spring:message arguments="${label}" code="entity_update" var="title_msg" htmlEscape="false" /> + <util:panel id="${id}" title="${title_msg}" openPane="${openPane}"> + <spring:url value="${path}" var="form_url" /> + <form:form action="${form_url}" method="PUT" modelAttribute="${modelAttribute}" enctype="${enctype}"> + <form:errors cssClass="errors" delimiter="<p/>" /> + <jsp:doBody /> + <div class="submit" id="${fn:escapeXml(id)}_submit"> + <spring:message code="button_save" var="save_button" htmlEscape="false" /> + <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));</script> + <input id="proceed" type="submit" value="${fn:escapeXml(save_button)}" /> + </div> + <form:hidden id="_${fn:escapeXml(idField)}_id" path="${fn:escapeXml(idField)}" /> + <c:if test="${versionField ne 'none'}"> + <form:hidden id="_${fn:escapeXml(versionField)}_id" path="${fn:escapeXml(versionField)}" /> + </c:if> + </form:form> + </util:panel> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/menu/category.tagx b/src/main/webapp/WEB-INF/tags/menu/category.tagx new file mode 100644 index 0000000000000000000000000000000000000000..f78f81f3913943698881691c52ed51bab82a89b3 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/menu/category.tagx @@ -0,0 +1,25 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes"/> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)"/> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label for this category (if not set the resource bundle is used)"/> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)"/> + + <c:if test="${empty render or render}"> + + <c:if test="${empty label}"> + <spring:message code="menu_category_${fn:toLowerCase(fn:substringAfter(id,'_'))}_label" var="label" htmlEscape="false"/> + </c:if> + + <li id="${fn:escapeXml(id)}"> + <h2> + <c:out value="${label}" /> + </h2> + <ul> + <jsp:doBody /> + </ul> + </li> + + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/menu/item.tagx b/src/main/webapp/WEB-INF/tags/menu/item.tagx new file mode 100644 index 0000000000000000000000000000000000000000..b1768a11aad3e1d646434a48e6fad0e18c32a649 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/menu/item.tagx @@ -0,0 +1,29 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="url" type="java.lang.String" required="true" rtexprvalue="true" description="The link URL" /> + <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this menu item" /> + <jsp:directive.attribute name="messageCode" type="java.lang.String" required="false" rtexprvalue="true" description="The global message code to be used (works in conjunction with label)" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty label}"> + <spring:message code="menu_item_${fn:toLowerCase(fn:substringAfter(id,'_'))}_label" var="label" htmlEscape="false" /> + </c:if> + + <c:if test="${not empty messageCode}"> + <spring:message code="${messageCode}" var="label" arguments="${label}" htmlEscape="false" /> + </c:if> + + <li id="${fn:escapeXml(id)}"> + <spring:url value="${url}" var="menu_item_url"/> + <a href="${menu_item_url}" title="${fn:escapeXml(label)}"> + <c:out value="${label}"/> + </a> + </li> + + </c:if> +</jsp:root> diff --git a/src/main/webapp/WEB-INF/tags/menu/menu.tagx b/src/main/webapp/WEB-INF/tags/menu/menu.tagx new file mode 100644 index 0000000000000000000000000000000000000000..f16269aa73c139bc58ae0e6c960997d394de3541 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/menu/menu.tagx @@ -0,0 +1,13 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes"/> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)"/> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)"/> + + <c:if test="${empty render or render}"> + <ul id="${fn:escapeXml(id)}"> + <jsp:doBody /> + </ul> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/util/language.tagx b/src/main/webapp/WEB-INF/tags/util/language.tagx new file mode 100644 index 0000000000000000000000000000000000000000..c894b75d63c5e483b3e065133267072f5655bec8 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/util/language.tagx @@ -0,0 +1,31 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="locale" type="java.lang.String" required="true" rtexprvalue="true" description="The locale for the language to be added." /> + <jsp:directive.attribute name="label" type="java.lang.String" required="true" rtexprvalue="true" description="The country label for the language to be added." /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + + <c:if test="${empty render or render}"> + <spring:url var="img" value="/resources/images/${locale}.png" /> + <spring:url var="url" value=""> + <c:if test="${null ne param.form}"> + <spring:param name="form" /> + </c:if> + <c:if test="${not empty param.find}"> + <spring:param name="find" value="${param.find}" /> + </c:if> + <spring:param name="lang" value="${locale}" /> + <c:if test="${not empty param.page}"> + <spring:param name="page" value="${param.page}" /> + </c:if> + <c:if test="${not empty param.size}"> + <spring:param name="size" value="${param.size}" /> + </c:if> + </spring:url> + <spring:message code="global_language_switch" arguments="${label}" var="lang_label" htmlEscape="false" /> + <a href="${url}" title="${fn:escapeXml(lang_label)}"> + <img class="flag" src="${img}" alt="${fn:escapeXml(lang_label)}" /> + </a> + <c:out value=" " /> + </c:if> +</jsp:root> diff --git a/src/main/webapp/WEB-INF/tags/util/load-scripts.tagx b/src/main/webapp/WEB-INF/tags/util/load-scripts.tagx new file mode 100644 index 0000000000000000000000000000000000000000..3aa5ace4b259c4aa708d9486d00b1881d7b3a9a8 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/util/load-scripts.tagx @@ -0,0 +1,29 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + + <jsp:output omit-xml-declaration="yes" /> + + <spring:theme code="styleSheet" var="roo_css" /> + <spring:url value="/${roo_css}" var="roo_css_url" /> + <spring:url value="/resources/dojo/dojo.js" var="dojo_url" /> + <spring:url value="/resources/dijit/themes/tundra/tundra.css" var="tundra_url" /> + <spring:url value="/resources/spring/Spring.js" var="spring_url" /> + <spring:url value="/resources/spring/Spring-Dojo.js" var="spring_dojo_url" /> + <spring:url value="/resources/images/favicon.ico" var="favicon" /> + <link rel="stylesheet" type="text/css" href="${tundra_url}" /> + <link rel="stylesheet" type="text/css" media="screen" href="${roo_css_url}" /> + <link rel="SHORTCUT ICON" href="${favicon}" /> + + <!-- Get the user local from the page context (it was set by Spring MVC's locale resolver) --> + <c:set var="userLocale"> + <c:set var="plocale">${pageContext.response.locale}</c:set> + <c:out value="${fn:replace(plocale, '_', '-')}" default="en" /> + </c:set> + + <script type="text/javascript">var djConfig = {parseOnLoad: false, isDebug: false, locale: '${fn:toLowerCase(userLocale)}'};</script> + + <script src="${dojo_url}" type="text/javascript"><!-- required for FF3 and Opera --></script> + <script src="${spring_url}" type="text/javascript"><!-- /required for FF3 and Opera --></script> + <script src="${spring_dojo_url}" type="text/javascript"><!-- required for FF3 and Opera --></script> + <script language="JavaScript" type="text/javascript">dojo.require("dojo.parser");</script> + +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/util/pagination.tagx b/src/main/webapp/WEB-INF/tags/util/pagination.tagx new file mode 100644 index 0000000000000000000000000000000000000000..5c6a3ddfedde53f81982d51fb48117181800f5a2 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/util/pagination.tagx @@ -0,0 +1,87 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="maxPages" type="java.lang.Integer" required="true" rtexprvalue="true" description="The maximum number of pages available (ie tableRecordCount / size)" /> + <jsp:directive.attribute name="page" type="java.lang.Integer" required="false" rtexprvalue="true" description="The current page (not required, defaults to 1)" /> + <jsp:directive.attribute name="size" type="java.lang.Integer" required="false" rtexprvalue="true" description="The number of records per page (not required, defaults to 10)" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + + <c:if test="${empty render or render}"> + + <c:if test="${empty page || page lt 1}"> + <c:set var="page" value="1" /> + </c:if> + + <c:if test="${empty size || size lt 1}"> + <c:set var="size" value="10" /> + </c:if> + + <spring:message code="list_size" var="list_size" htmlEscape="false" /> + <c:out value="${list_size} " /> + + <c:forEach var="i" begin="5" end="25" step="5"> + <c:choose> + <c:when test="${size == i}"> + <c:out value="${i}" /> + </c:when> + <c:otherwise> + <spring:url value="" var="sizeUrl"> + <spring:param name="page" value="1" /> + <spring:param name="size" value="${i}" /> + </spring:url> + <a href="${sizeUrl}">${i}</a> + </c:otherwise> + </c:choose> + <c:out value=" " /> + </c:forEach> + <c:out value="| " /> + + <c:if test="${page ne 1}"> + <spring:url value="" var="first"> + <spring:param name="page" value="1" /> + <spring:param name="size" value="${size}" /> + </spring:url> + <spring:url value="/resources/images/resultset_first.png" var="first_image_url" /> + <spring:message code="list_first" var="first_label" htmlEscape="false" /> + <a class="image" href="${first}" title="${fn:escapeXml(first_label)}"> + <img alt="${fn:escapeXml(first_label)}" src="${first_image_url}" /> + </a> + </c:if> + <c:if test="${page gt 1}"> + <spring:url value="" var="previous"> + <spring:param name="page" value="${page - 1}" /> + <spring:param name="size" value="${size}" /> + </spring:url> + <spring:url value="/resources/images/resultset_previous.png" var="previous_image_url" /> + <spring:message code="list_previous" var="previous_label" htmlEscape="false" /> + <a class="image" href="${previous}" title="${fn:escapeXml(previous_label)}"> + <img alt="${fn:escapeXml(previous_label)}" src="${previous_image_url}" /> + </a> + </c:if> + <c:out value=" " /> + <spring:message code="list_page" arguments="${page},${maxPages}" argumentSeparator="," /> + <c:out value=" " /> + <c:if test="${page lt maxPages}"> + <spring:url value="" var="next"> + <spring:param name="page" value="${page + 1}" /> + <spring:param name="size" value="${size}" /> + </spring:url> + <spring:url value="/resources/images/resultset_next.png" var="next_image_url" /> + <spring:message code="list_next" var="next_label" htmlEscape="false" /> + <a class="image" href="${next}" title="${fn:escapeXml(next_label)}"> + <img alt="${fn:escapeXml(next_label)}" src="${next_image_url}" /> + </a> + </c:if> + <c:if test="${page ne maxPages}"> + <spring:url value="" var="last"> + <spring:param name="page" value="${maxPages}" /> + <spring:param name="size" value="${size}" /> + </spring:url> + <spring:url value="/resources/images/resultset_last.png" var="last_image_url" /> + <spring:message code="list_last" var="last_label" htmlEscape="false" /> + <a class="image" href="${last}" title="${fn:escapeXml(last_label)}"> + <img alt="${fn:escapeXml(last_label)}" src="${last_image_url}" /> + </a> + </c:if> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/util/panel.tagx b/src/main/webapp/WEB-INF/tags/util/panel.tagx new file mode 100644 index 0000000000000000000000000000000000000000..a1d58257a3446e6294b1f3dbf0f6d94ab92d2c3c --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/util/panel.tagx @@ -0,0 +1,33 @@ +<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> + <jsp:directive.attribute name="title" type="java.lang.String" required="true" rtexprvalue="true" description="The page title (required)" /> + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + <jsp:directive.attribute name="openPane" type="java.lang.String" required="false" rtexprvalue="true" description="Control if the title pane is opened or closed by default (default: true)" /> + <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" /> + + <c:if test="${empty render or render}"> + <c:if test="${empty openPane}"> + <c:set value="true" var="openPane" /> + </c:if> + + <c:set var="sec_id"> + <spring:escapeBody javaScriptEscape="true" >${id}</spring:escapeBody> + </c:set> + + <c:set var="sec_openPane"> + <spring:escapeBody javaScriptEscape="true" >${openPane}</spring:escapeBody> + </c:set> + + <c:set var="sec_title"> + <spring:escapeBody javaScriptEscape="true" >${title}</spring:escapeBody> + </c:set> + + <script type="text/javascript">dojo.require('dijit.TitlePane');</script> + <div id="_title_${sec_id}_id"> + <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : '_title_${sec_id}_id', widgetType : 'dijit.TitlePane', widgetAttrs : {title: '${sec_title}', open: ${sec_openPane}}})); </script> + <jsp:doBody /> + </div> + </c:if> +</jsp:root> diff --git a/src/main/webapp/WEB-INF/tags/util/placeholder.tagx b/src/main/webapp/WEB-INF/tags/util/placeholder.tagx new file mode 100644 index 0000000000000000000000000000000000000000..0ff9617d9b4190e1e3477c7b52fcd6bf8814a293 --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/util/placeholder.tagx @@ -0,0 +1,5 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="description" type="java.lang.String" required="false" rtexprvalue="true" description="Can be used to describe the purpose of this element" /> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/util/theme.tagx b/src/main/webapp/WEB-INF/tags/util/theme.tagx new file mode 100644 index 0000000000000000000000000000000000000000..6fe7723fe954735704cac1183ca39d5ff41e107a --- /dev/null +++ b/src/main/webapp/WEB-INF/tags/util/theme.tagx @@ -0,0 +1,36 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:output omit-xml-declaration="yes" /> + + <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" /> + + <c:if test="${empty render or render}"> + <span> + <c:out value=" | " /> + <spring:message code="global_theme" /> + <c:out value=": " /> + <spring:url var="url_theme1" value=""> + <spring:param name="theme" value="standard" /> + <c:if test="${not empty param.page}"> + <spring:param name="page" value="${param.page}" /> + </c:if> + <c:if test="${not empty param.size}"> + <spring:param name="size" value="${param.size}" /> + </c:if> + </spring:url> + <spring:message code="global_theme_standard" var="theme_standard" htmlEscape="false" /> + <a href="${url_theme1}" title="${fn:escapeXml(theme_standard)}">${fn:escapeXml(theme_standard)}</a> + <c:out value=" | " /> + <spring:url var="url_theme2" value=""> + <spring:param name="theme" value="alt" /> + <c:if test="${not empty param.page}"> + <spring:param name="page" value="${param.page}" /> + </c:if> + <c:if test="${not empty param.size}"> + <spring:param name="size" value="${param.size}" /> + </c:if> + </spring:url> + <spring:message code="global_theme_alt" var="theme_alt" htmlEscape="false" /> + <a href="${url_theme2}" title="${fn:escapeXml(theme_alt)}">${fn:escapeXml(theme_alt)}</a> + </span> + </c:if> +</jsp:root> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx b/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx new file mode 100644 index 0000000000000000000000000000000000000000..15d9b23ee33bbab849ec9b9fa90ee07cdc4c4d73 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx @@ -0,0 +1,30 @@ +<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:output omit-xml-declaration="yes" /> + <spring:message var="title" code="error_dataaccessfailure_title" htmlEscape="false" /> + <util:panel id="title" title="${title}"> + <h2>${fn:escapeXml(title)}</h2> + <p> + <spring:message code="error_dataaccessfailure_problemdescription" /> + </p> + <c:if test="${not empty exception}"> + <p> + <h4> + <spring:message code="exception_details" /> + </h4> + <spring:message var="message" code="exception_message" /> + <util:panel id="_message" title="${message}" openPane="false"> + <c:out value="${exception.localizedMessage}" /> + </util:panel> + <spring:message var="stacktrace" code="exception_stacktrace" /> + <util:panel id="_exception" title="${stacktrace}" openPane="false"> + <c:forEach items="${exception.stackTrace}" var="trace"> + <c:out value="${trace}" /> + <br /> + </c:forEach> + </util:panel> + </p> + </c:if> + </util:panel> +</div> + diff --git a/src/main/webapp/WEB-INF/views/footer.jspx b/src/main/webapp/WEB-INF/views/footer.jspx new file mode 100644 index 0000000000000000000000000000000000000000..ed77f7f7f66c5112f502ab819f75f6af8f11f488 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/footer.jspx @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" id="footer" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + + <spring:url value="/" var="home"/> + <span> + <a href="${home}"> + <spring:message code="button_home"/> + </a> + </span> + <c:if test="${pageContext['request'].userPrincipal != null}"> + <c:out value=" | "/> + <span> + <spring:url value="/resources/j_spring_security_logout" var="logout"/> + <a href="${logout}"> + <spring:message code="security_logout"/> + </a> + </span> + </c:if> + + <span id="language"> + <c:out value=" | "/> + <spring:message code="global_language"/> + <c:out value=": "/> + <util:language label="English" locale="en"/> + </span> + <util:theme/> + + <spring:url value="/resources/images/springsource-logo.png" var="logo"/> + <spring:message code="global_sponsored" htmlEscape="false" var="sponsored"/> + <span> + <a href="http://springsource.com" title="${fn:escapeXml(sponsored)}"> + <img align="right" alt="${fn:escapeXml(sponsored)}" src="${logo}"/> + </a> + </span> +</div> diff --git a/src/main/webapp/WEB-INF/views/header.jspx b/src/main/webapp/WEB-INF/views/header.jspx new file mode 100644 index 0000000000000000000000000000000000000000..dbcf9504214da91b1899f2382e25e49c3bd0243a --- /dev/null +++ b/src/main/webapp/WEB-INF/views/header.jspx @@ -0,0 +1,11 @@ +<div id="header" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:output omit-xml-declaration="yes" /> + + <spring:url var="banner" value="/resources/images/banner-graphic.png" /> + <spring:url var="home" value="/" /> + <spring:message code="button_home" var="home_label" htmlEscape="false" /> + <a href="${home}" name="${fn:escapeXml(home_label)}" title="${fn:escapeXml(home_label)}"> + <img src="${banner}" /> + </a> +</div> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/index-template.jspx b/src/main/webapp/WEB-INF/views/index-template.jspx new file mode 100644 index 0000000000000000000000000000000000000000..07000646a38946f6a50632b507874f1b7f81955f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/index-template.jspx @@ -0,0 +1,11 @@ +<div xmlns:spring="http://www.springframework.org/tags" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:output omit-xml-declaration="yes" /> + <spring:message var="title" htmlEscape="false" /> + <util:panel id="title" title="${title}"> + <spring:message code="application_name" var="app_name" htmlEscape="false" /> + <h3> + <spring:message code="welcome_titlepane" arguments="${app_name}" /> + </h3> + </util:panel> +</div> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/index.jspx b/src/main/webapp/WEB-INF/views/index.jspx new file mode 100644 index 0000000000000000000000000000000000000000..12b501465653a3ff63e9f0e4a9619c106d4abca7 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/index.jspx @@ -0,0 +1,14 @@ +<div xmlns:spring="http://www.springframework.org/tags" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:output omit-xml-declaration="yes" /> + <spring:message var="app_name" code="application_name" htmlEscape="false" /> + <spring:message var="title" code="welcome_titlepane" arguments="${app_name}" htmlEscape="false" /> + <util:panel id="title" title="${title}"> + <h3> + <spring:message code="welcome_h3" arguments="${app_name}" /> + </h3> + <p> + <spring:message code="welcome_text" /> + </p> + </util:panel> +</div> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/login.jspx b/src/main/webapp/WEB-INF/views/login.jspx new file mode 100644 index 0000000000000000000000000000000000000000..a4a04fb63cea713f33e8d76d0538f15916304635 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/login.jspx @@ -0,0 +1,60 @@ +<div xmlns:spring="http://www.springframework.org/tags" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:output omit-xml-declaration="yes" /> + <spring:message code="security_login_title" var="title" htmlEscape="false" /> + <util:panel id="title" title="${title}"> + <c:if test="${not empty param.login_error}"> + <div class="errors"> + <p> + <spring:message code="security_login_unsuccessful" /> + <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" /> + . + </p> + </div> + </c:if> + <c:if test="${empty param.login_error}"> + <p> + <spring:message code="security_login_message" /> + </p> + </c:if> + <spring:url value="/resources/j_spring_security_check" var="form_url" /> + <form name="f" action="${fn:escapeXml(form_url)}" method="POST"> + <div> + <label for="j_username"> + <spring:message code="security_login_form_name" /> + </label> + <input id="j_username" type='text' name='j_username' style="width:150px" /> + <spring:message code="security_login_form_name_message" var="name_msg" htmlEscape="false" /> + <script type="text/javascript"> + <c:set var="sec_name_msg"> + <spring:escapeBody javaScriptEscape="true">${name_msg}</spring:escapeBody> + </c:set> + Spring.addDecoration(new Spring.ElementDecoration({elementId : "j_username", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "${sec_name_msg}", required : true}})); + </script> + </div> + <br /> + <div> + <label for="j_password"> + <spring:message code="security_login_form_password" /> + </label> + <input id="j_password" type='password' name='j_password' style="width:150px" /> + <spring:message code="security_login_form_password_message" var="pwd_msg" htmlEscape="false" /> + <script type="text/javascript"> + <c:set var="sec_pwd_msg"> + <spring:escapeBody javaScriptEscape="true">${pwd_msg}</spring:escapeBody> + </c:set> + Spring.addDecoration(new Spring.ElementDecoration({elementId : "j_password", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "${sec_pwd_msg}", required : true}})); + </script> + </div> + <br /> + <div class="submit"> + <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));</script> + <spring:message code="button_submit" var="submit_label" htmlEscape="false" /> + <input id="proceed" type="submit" value="${fn:escapeXml(submit_label)}" /> + <spring:message code="button_reset" var="reset_label" htmlEscape="false" /> + <input id="reset" type="reset" value="${fn:escapeXml(reset_label)}" /> + </div> + </form> + </util:panel> +</div> + diff --git a/src/main/webapp/WEB-INF/views/menu.jspx b/src/main/webapp/WEB-INF/views/menu.jspx new file mode 100644 index 0000000000000000000000000000000000000000..6faf6fa4ab8d25c43560acf868ba5c24413b7e12 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/menu.jspx @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:menu="urn:jsptagdir:/WEB-INF/tags/menu" id="menu" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <menu:menu id="_menu" z="nZaf43BjUg1iM0v70HJVEsXDopc="> + <menu:category id="c_projeto" z="l9PWsmyhBz6vdxQqJihZDnWRr4o="> + <menu:item id="i_projeto_new" messageCode="global_menu_new" url="/projetoes?form" z="OY49hJ+taMk1k3ASiEFt4sGXCSU="/> + <menu:item id="i_projeto_list" messageCode="global_menu_list" url="/projetoes?page=1&size=${empty param.size ? 10 : param.size}" z="x1vvsZFRYLoITzX2jIKG93Z4DWM="/> + </menu:category> + <menu:category id="c_ministerio" z="bdCebF8Z2eynkkyAMp/B5OZGV9A="> + <menu:item id="i_ministerio_new" messageCode="global_menu_new" url="/ministerios?form" z="6OpG3M2+Gvw8amn9aYg7/7zwAds="/> + <menu:item id="i_ministerio_list" messageCode="global_menu_list" url="/ministerios?page=1&size=${empty param.size ? 10 : param.size}" z="3dj4WmtVHkR+jV7Vbj/veXWsVQ8="/> + </menu:category> + </menu:menu> +</div> diff --git a/src/main/webapp/WEB-INF/views/ministerios/create.jspx b/src/main/webapp/WEB-INF/views/ministerios/create.jspx new file mode 100644 index 0000000000000000000000000000000000000000..7ef9b0ef658677ce64264d53c19ac2d2f92f2571 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/ministerios/create.jspx @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <form:create id="fc_br_ufpr_c3sl_participatorio_Ministerio" modelAttribute="ministerio" path="/ministerios" render="${empty dependencies}" z="zFAfmO+ojFRFW8rhlxTLRFVLj6s="> + <field:input field="nome" id="c_br_ufpr_c3sl_participatorio_Ministerio_nome" z="yG0O6P0xDGYX41VMy1AV+XEGemo="/> + </form:create> + <form:dependency dependencies="${dependencies}" id="d_br_ufpr_c3sl_participatorio_Ministerio" render="${not empty dependencies}" z="B69MecuQMoIzCowcRx8qS4z7Yd4="/> +</div> diff --git a/src/main/webapp/WEB-INF/views/ministerios/list.jspx b/src/main/webapp/WEB-INF/views/ministerios/list.jspx new file mode 100644 index 0000000000000000000000000000000000000000..fca28ee14b9207dfe15d30abf6a6328056caf39c --- /dev/null +++ b/src/main/webapp/WEB-INF/views/ministerios/list.jspx @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" xmlns:table="urn:jsptagdir:/WEB-INF/tags/form/fields" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <page:list id="pl_br_ufpr_c3sl_participatorio_Ministerio" items="${ministerios}" z="OZNBGYIzHd1qC9OQ+i13VQ8s3/M="> + <table:table data="${ministerios}" id="l_br_ufpr_c3sl_participatorio_Ministerio" path="/ministerios" z="P1bAiKQ+BGFvNP1KqqMoRxIHoIY="> + <table:column id="c_br_ufpr_c3sl_participatorio_Ministerio_nome" property="nome" z="xiFf6v1g/16N6c5s6GGRN8140NI="/> + </table:table> + </page:list> +</div> diff --git a/src/main/webapp/WEB-INF/views/ministerios/show.jspx b/src/main/webapp/WEB-INF/views/ministerios/show.jspx new file mode 100644 index 0000000000000000000000000000000000000000..49fec2be483dda1cecc8cd872935922461934c4c --- /dev/null +++ b/src/main/webapp/WEB-INF/views/ministerios/show.jspx @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <page:show id="ps_br_ufpr_c3sl_participatorio_Ministerio" object="${ministerio}" path="/ministerios" z="/7b1hWstg5lLMuf7PmBH1LAFVxk="> + <field:display field="nome" id="s_br_ufpr_c3sl_participatorio_Ministerio_nome" object="${ministerio}" z="QI1Poo7nRY0v4kuC7+Wsd/GG+Vw="/> + </page:show> +</div> diff --git a/src/main/webapp/WEB-INF/views/ministerios/update.jspx b/src/main/webapp/WEB-INF/views/ministerios/update.jspx new file mode 100644 index 0000000000000000000000000000000000000000..0982cce44bcf84edf38f3a5e2b60c13fdaafd6d0 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/ministerios/update.jspx @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <form:update id="fu_br_ufpr_c3sl_participatorio_Ministerio" modelAttribute="ministerio" path="/ministerios" versionField="Version" z="BuiK3CNmnibJH2SIOLeWBF1y0HY="> + <field:input field="nome" id="c_br_ufpr_c3sl_participatorio_Ministerio_nome" z="yG0O6P0xDGYX41VMy1AV+XEGemo="/> + </form:update> +</div> diff --git a/src/main/webapp/WEB-INF/views/ministerios/views.xml b/src/main/webapp/WEB-INF/views/ministerios/views.xml new file mode 100644 index 0000000000000000000000000000000000000000..1c4f3f463e9a9568c32a7761ebaf7b7536998232 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/ministerios/views.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" "http://tiles.apache.org/dtds/tiles-config_2_1.dtd"> +<tiles-definitions> + <definition extends="default" name="ministerios/list"> + <put-attribute name="body" value="/WEB-INF/views/ministerios/list.jspx"/> + </definition> +<definition extends="default" name="ministerios/show"> + <put-attribute name="body" value="/WEB-INF/views/ministerios/show.jspx"/> + </definition> +<definition extends="default" name="ministerios/create"> + <put-attribute name="body" value="/WEB-INF/views/ministerios/create.jspx"/> + </definition> +<definition extends="default" name="ministerios/update"> + <put-attribute name="body" value="/WEB-INF/views/ministerios/update.jspx"/> + </definition> +</tiles-definitions> diff --git a/src/main/webapp/WEB-INF/views/projetoes/create.jspx b/src/main/webapp/WEB-INF/views/projetoes/create.jspx new file mode 100644 index 0000000000000000000000000000000000000000..4dc2ce0b2ccddc6d3999bb8b4ca00605eca1615b --- /dev/null +++ b/src/main/webapp/WEB-INF/views/projetoes/create.jspx @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <form:create id="fc_br_ufpr_c3sl_participatorio_Projeto" modelAttribute="projeto" path="/projetoes" render="${empty dependencies}" z="uklzONF0yIPjbEJFSlLMffVUn7g="> + <field:select field="pai" id="c_br_ufpr_c3sl_participatorio_Projeto_pai" itemValue="id" items="${projetoes}" path="/projetoes" z="JkbtdV8KzNjMFgvmaNi11XbZ+Ss="/> + <field:input field="nome" id="c_br_ufpr_c3sl_participatorio_Projeto_nome" z="5egNGMKHSYOQCuslpB7cYfsCJns="/> + <field:select field="demanda" id="c_br_ufpr_c3sl_participatorio_Projeto_demanda" items="${tipodemandas}" path="tipodemandas" z="LZLJJHDisgTZb2HVM3SXZRFRKZo="/> + <field:select field="acao" id="c_br_ufpr_c3sl_participatorio_Projeto_acao" items="${tipoacaos}" path="tipoacaos" z="TknEprFT06hffWHIizWjHzzhBB8="/> + <field:input field="outroAcao" id="c_br_ufpr_c3sl_participatorio_Projeto_outroAcao" z="gKzGjxAdyPnPD7zoeTc+ZPLtejY="/> + <field:select field="ministerio" id="c_br_ufpr_c3sl_participatorio_Projeto_ministerio" itemValue="id" items="${ministerios}" path="/ministerios" z="64Y1pviPhH0YUpX4/TLAcEiNf8A="/> + <field:input field="objetivo" id="c_br_ufpr_c3sl_participatorio_Projeto_objetivo" z="7NQc7nBdNKGMsVO2gcJ58+nFc0E="/> + <field:input field="rua" id="c_br_ufpr_c3sl_participatorio_Projeto_rua" z="NZ6M3HEDzpkKDIvxyk8iZYFchQA="/> + <field:input field="numero" id="c_br_ufpr_c3sl_participatorio_Projeto_numero" z="xaLTEtm6Pc1D6VgioTdMcQXkq8s="/> + <field:input field="complemento" id="c_br_ufpr_c3sl_participatorio_Projeto_complemento" z="N2Lya9vot39QnzhJ8pqU5d+vzB0="/> + <field:input field="bairro" id="c_br_ufpr_c3sl_participatorio_Projeto_bairro" z="4IENKq7T4UaF0f/0uwCBcT3xtlI="/> + <field:input field="municipio" id="c_br_ufpr_c3sl_participatorio_Projeto_municipio" z="IRx9hrCWxHAzvD0dA+1xxmH/V90="/> + <field:input field="cep" id="c_br_ufpr_c3sl_participatorio_Projeto_cep" z="gVIPRkUIL6GZ45ZU0ehzfXTt4CU="/> + <field:input field="responsavel" id="c_br_ufpr_c3sl_participatorio_Projeto_responsavel" z="qHPooL9WJIOr9aiVpu272tRcYlg="/> + <field:input field="telefones" id="c_br_ufpr_c3sl_participatorio_Projeto_telefones" z="XN9R1Y3TkGJDhJjNR7Ac+uUA10g="/> + <field:input field="email" id="c_br_ufpr_c3sl_participatorio_Projeto_email" validationMessageCode="field_invalid_email" z="wec+yBsxP/CfoGtMjMYu8XOiz8E="/> + <field:input field="publicoAlvo" id="c_br_ufpr_c3sl_participatorio_Projeto_publicoAlvo" z="rfW62fR8G11PyQwsAU15sdK6804="/> + <field:input field="formaAcesso" id="c_br_ufpr_c3sl_participatorio_Projeto_formaAcesso" z="HY3pNe95ZaxAxVS55E5bDnn84FE="/> + <field:input field="site" id="c_br_ufpr_c3sl_participatorio_Projeto_site" z="UtAhbsHkmV/py/BCglNJT4jnKNk="/> + <field:input field="comoFunciona" id="c_br_ufpr_c3sl_participatorio_Projeto_comoFunciona" z="WQT9VOPh8Yng7sdWkKBfWrWJvzY="/> + <field:input field="noticias" id="c_br_ufpr_c3sl_participatorio_Projeto_noticias" z="QvhayaNYZLWbn4Kdz/1ukvJWaQw="/> + <field:input field="horarioFuncionamento" id="c_br_ufpr_c3sl_participatorio_Projeto_horarioFuncionamento" z="/wgLwa6KbhG4wv0vWFn869KF4hg="/> + <field:select field="diasFuncionamento" id="c_br_ufpr_c3sl_participatorio_Projeto_diasFuncionamento" items="${tipodiassemanas}" path="tipodiassemanas" z="+BjTvC5bM2N7YGK48eWFIePY8Ks="/> + <field:input field="estrutura" id="c_br_ufpr_c3sl_participatorio_Projeto_estrutura" z="BMTcTzuUYCoKhXapXah2VN/qPuE="/> + <field:input field="responsaveis" id="c_br_ufpr_c3sl_participatorio_Projeto_responsaveis" z="gmi09GGEpF9pDXN7/aviynR3tBs="/> + <field:input field="telefoneMinisterio" id="c_br_ufpr_c3sl_participatorio_Projeto_telefoneMinisterio" z="UGH0aw3XZuQmgwr0sIS1O9KhHbQ="/> + <field:input field="orcamento" id="c_br_ufpr_c3sl_participatorio_Projeto_orcamento" z="sJO2DC6kqSRPUz5DC5eA/bddxvc="/> + <field:input field="justificativa" id="c_br_ufpr_c3sl_participatorio_Projeto_justificativa" z="bxuZxUlVF/K6r0D/vZ2gLJOYqus="/> + <field:input field="meta" id="c_br_ufpr_c3sl_participatorio_Projeto_meta" z="X67itR3Kt3CcPmnMLE3pk8gJnTQ="/> + <field:select field="temporalidade" id="c_br_ufpr_c3sl_participatorio_Projeto_temporalidade" items="${tipotemporalidades}" path="tipotemporalidades" z="DxeDx4ck5sWIKaomza63nyKiAeQ="/> + <field:checkbox field="possuiMonitoramento" id="c_br_ufpr_c3sl_participatorio_Projeto_possuiMonitoramento" z="/JVVLQICEG8G6erZgd6P7rhoNqM="/> + <field:input field="estadosMunicipioComPrograma" id="c_br_ufpr_c3sl_participatorio_Projeto_estadosMunicipioComPrograma" z="XOH+gInejGvAnV1UOGHZHSlh0kw="/> + <field:input field="publicPrioritario" id="c_br_ufpr_c3sl_participatorio_Projeto_publicPrioritario" z="ZiO1CZu1gNdDb59SvP41Qnpj/io="/> + <field:datetime dateTimePattern="${projeto_datainicio_date_format}" field="dataInicio" id="c_br_ufpr_c3sl_participatorio_Projeto_dataInicio" z="B4b6arF1P2Q4KSgME04mPIWp7Zs="/> + <field:input field="mecanismos" id="c_br_ufpr_c3sl_participatorio_Projeto_mecanismos" z="YCRKTWq1a3Fd0ZHbAwcxKS+vACY="/> + <field:input field="parcerias" id="c_br_ufpr_c3sl_participatorio_Projeto_parcerias" z="x374RYBQGz62YCy6JRm7HDk6kFs="/> + <field:checkbox field="legislacaoPropria" id="c_br_ufpr_c3sl_participatorio_Projeto_legislacaoPropria" z="0FyUiOC8dXYS2KQh9us8ZFSrfU0="/> + <field:input field="descLegislacao" id="c_br_ufpr_c3sl_participatorio_Projeto_descLegislacao" z="Y9X3/A7OHfh+T5M4c7uRjtx2Uak="/> + <field:input field="obs" id="c_br_ufpr_c3sl_participatorio_Projeto_obs" z="5b+Wjz0npE5n2wk2R6g1fJZD0VA="/> + <field:select field="estado" id="c_br_ufpr_c3sl_participatorio_Projeto_estado" items="${tipostatuses}" path="tipostatuses" z="K+kNv0Ov3Ulu6LiKPBQ71hczlOA="/> + </form:create> + <form:dependency dependencies="${dependencies}" id="d_br_ufpr_c3sl_participatorio_Projeto" render="${not empty dependencies}" z="nyMkb0MYQtlthVlj4JcyqCQYyRg="/> +</div> diff --git a/src/main/webapp/WEB-INF/views/projetoes/list.jspx b/src/main/webapp/WEB-INF/views/projetoes/list.jspx new file mode 100644 index 0000000000000000000000000000000000000000..01c8f20a3ec0188ce1ecc1215de61fbc5007774f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/projetoes/list.jspx @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" xmlns:table="urn:jsptagdir:/WEB-INF/tags/form/fields" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <page:list id="pl_br_ufpr_c3sl_participatorio_Projeto" items="${projetoes}" z="xI7fvnW1b0tKUMMJrSKIiv3ycH0="> + <table:table data="${projetoes}" id="l_br_ufpr_c3sl_participatorio_Projeto" path="/projetoes" z="kamtALNOBI9qFO/YY+1GYa1OhVw="> + <table:column id="c_br_ufpr_c3sl_participatorio_Projeto_pai" property="pai" z="JnX374OPNV+3oLlfOcMYu3wG024="/> + <table:column id="c_br_ufpr_c3sl_participatorio_Projeto_nome" property="nome" z="djZOsc2/qBPTa0C3ffNAlDEgP0U="/> + <table:column id="c_br_ufpr_c3sl_participatorio_Projeto_demanda" property="demanda" z="K99mnRN9vX7sE9XtHufPcJBkBdg="/> + <table:column id="c_br_ufpr_c3sl_participatorio_Projeto_acao" property="acao" z="2hGM9LKsHjh5/zpeavaa+slBUkA="/> + <table:column id="c_br_ufpr_c3sl_participatorio_Projeto_outroAcao" property="outroAcao" z="KDK14ptwJLWXh4xCooeqI+wBnJk="/> + <table:column id="c_br_ufpr_c3sl_participatorio_Projeto_ministerio" property="ministerio" z="qYUkNm475DOx0s81JEz3ff7BQho="/> + </table:table> + </page:list> +</div> diff --git a/src/main/webapp/WEB-INF/views/projetoes/show.jspx b/src/main/webapp/WEB-INF/views/projetoes/show.jspx new file mode 100644 index 0000000000000000000000000000000000000000..ac51cecd1f5f9ccae804bdb3c6d42e41a5df7eee --- /dev/null +++ b/src/main/webapp/WEB-INF/views/projetoes/show.jspx @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <page:show id="ps_br_ufpr_c3sl_participatorio_Projeto" object="${projeto}" path="/projetoes" z="D0oL5mYFetkn/bZXW31CJL2EDUE="> + <field:display field="pai" id="s_br_ufpr_c3sl_participatorio_Projeto_pai" object="${projeto}" z="4n4Iw3sGl6fL8jHSE2fUat8qLN4="/> + <field:display field="nome" id="s_br_ufpr_c3sl_participatorio_Projeto_nome" object="${projeto}" z="rsXBQmVxhOA6fpmBsaOOxZCOB5w="/> + <field:display field="demanda" id="s_br_ufpr_c3sl_participatorio_Projeto_demanda" object="${projeto}" z="4hH5xcrgPv71j3pdYFSKwrXUrwY="/> + <field:display field="acao" id="s_br_ufpr_c3sl_participatorio_Projeto_acao" object="${projeto}" z="8jgJ6LdiyoFYt6MyFWDV/UGMm2o="/> + <field:display field="outroAcao" id="s_br_ufpr_c3sl_participatorio_Projeto_outroAcao" object="${projeto}" z="zVcl2n2r3xxTceF3vPcaYnWIYiY="/> + <field:display field="ministerio" id="s_br_ufpr_c3sl_participatorio_Projeto_ministerio" object="${projeto}" z="Xf3IQ962bkf9Ezm92UBXGE2bWwc="/> + <field:display field="objetivo" id="s_br_ufpr_c3sl_participatorio_Projeto_objetivo" object="${projeto}" z="OvVo10fuXWdSkQG0eG9B8g4HFRE="/> + <field:display field="rua" id="s_br_ufpr_c3sl_participatorio_Projeto_rua" object="${projeto}" z="bblSx22OBZWuIl+gLXduDRjpIIo="/> + <field:display field="numero" id="s_br_ufpr_c3sl_participatorio_Projeto_numero" object="${projeto}" z="M95uXy/hfhB5n7Y2KlB2nrIpTTo="/> + <field:display field="complemento" id="s_br_ufpr_c3sl_participatorio_Projeto_complemento" object="${projeto}" z="u/OhcL1R2KO8bc3ZT6wk+WIlcJQ="/> + <field:display field="bairro" id="s_br_ufpr_c3sl_participatorio_Projeto_bairro" object="${projeto}" z="3ZCePyHKnaz5YWxSPoF9ruIUGgM="/> + <field:display field="municipio" id="s_br_ufpr_c3sl_participatorio_Projeto_municipio" object="${projeto}" z="DcdSDhxOxkqkd5V7r+QIjFPISPY="/> + <field:display field="cep" id="s_br_ufpr_c3sl_participatorio_Projeto_cep" object="${projeto}" z="h2INizgFtGHENL1zTlGj8RzYASs="/> + <field:display field="responsavel" id="s_br_ufpr_c3sl_participatorio_Projeto_responsavel" object="${projeto}" z="69bymzXlQBFLm1MLDdyBWxNnT1Q="/> + <field:display field="telefones" id="s_br_ufpr_c3sl_participatorio_Projeto_telefones" object="${projeto}" z="EHi6lsxuyNDv167TejS+qseIGbY="/> + <field:display field="email" id="s_br_ufpr_c3sl_participatorio_Projeto_email" object="${projeto}" z="aGC3uOYrEG/v868j6HanVCKAG0I="/> + <field:display field="publicoAlvo" id="s_br_ufpr_c3sl_participatorio_Projeto_publicoAlvo" object="${projeto}" z="f4D8z3yit2O9z1UgRnFWWHDyZ8I="/> + <field:display field="formaAcesso" id="s_br_ufpr_c3sl_participatorio_Projeto_formaAcesso" object="${projeto}" z="ndyJFMwcaQLW7Uri/SNNoszuWmI="/> + <field:display field="site" id="s_br_ufpr_c3sl_participatorio_Projeto_site" object="${projeto}" z="7w9AuurEp/01nbMH7hzlHbNWaqw="/> + <field:display field="comoFunciona" id="s_br_ufpr_c3sl_participatorio_Projeto_comoFunciona" object="${projeto}" z="cS8QtgfO1QUSq5l/QWQ1U2bKQQo="/> + <field:display field="noticias" id="s_br_ufpr_c3sl_participatorio_Projeto_noticias" object="${projeto}" z="nEHfcQlWOOOgyvriBFeCQAQxpNw="/> + <field:display field="horarioFuncionamento" id="s_br_ufpr_c3sl_participatorio_Projeto_horarioFuncionamento" object="${projeto}" z="I41X3LZzuQydAhMwexe+wnM5SzQ="/> + <field:display field="diasFuncionamento" id="s_br_ufpr_c3sl_participatorio_Projeto_diasFuncionamento" object="${projeto}" z="IPVS6qq+YWGueSJwyVFOIxU30uM="/> + <field:display field="estrutura" id="s_br_ufpr_c3sl_participatorio_Projeto_estrutura" object="${projeto}" z="rkpe20h3HUIEJAX8Z/egSw2kqhU="/> + <field:display field="responsaveis" id="s_br_ufpr_c3sl_participatorio_Projeto_responsaveis" object="${projeto}" z="Aala68TzEKIlGRJal9+v1icoBVc="/> + <field:display field="telefoneMinisterio" id="s_br_ufpr_c3sl_participatorio_Projeto_telefoneMinisterio" object="${projeto}" z="kZ48wV4jcUxHdOkClF5ust9xrKY="/> + <field:display field="orcamento" id="s_br_ufpr_c3sl_participatorio_Projeto_orcamento" object="${projeto}" z="T39I2SFBXuSFtuoGWD4YLIvNXEw="/> + <field:display field="justificativa" id="s_br_ufpr_c3sl_participatorio_Projeto_justificativa" object="${projeto}" z="SQH4nA7skZjQ6CC8qt0m1pqMUtg="/> + <field:display field="meta" id="s_br_ufpr_c3sl_participatorio_Projeto_meta" object="${projeto}" z="VzMChl+L7hz13lKe5aQBe6PVYug="/> + <field:display field="temporalidade" id="s_br_ufpr_c3sl_participatorio_Projeto_temporalidade" object="${projeto}" z="c0vwiEWkdMXFYh46/H2SB9CvNp4="/> + <field:display field="possuiMonitoramento" id="s_br_ufpr_c3sl_participatorio_Projeto_possuiMonitoramento" object="${projeto}" z="68BwSuL6hKNgh0DkIhlPGjfOy24="/> + <field:display field="estadosMunicipioComPrograma" id="s_br_ufpr_c3sl_participatorio_Projeto_estadosMunicipioComPrograma" object="${projeto}" z="j+RNU5XRo7dJ7mYkopzGJDjRrAs="/> + <field:display field="publicPrioritario" id="s_br_ufpr_c3sl_participatorio_Projeto_publicPrioritario" object="${projeto}" z="NTzu874oLhM1rqol0BmiwlEjrOo="/> + <field:display date="true" dateTimePattern="${projeto_datainicio_date_format}" field="dataInicio" id="s_br_ufpr_c3sl_participatorio_Projeto_dataInicio" object="${projeto}" z="Hdta14bxSk6t2J59rKyH70bW9gk="/> + <field:display field="mecanismos" id="s_br_ufpr_c3sl_participatorio_Projeto_mecanismos" object="${projeto}" z="rIkBzBq2mNO/WNbKWgjXCX6pa2Y="/> + <field:display field="parcerias" id="s_br_ufpr_c3sl_participatorio_Projeto_parcerias" object="${projeto}" z="3+nq+7n1btRPfaFxvQx3XwMBwFY="/> + <field:display field="legislacaoPropria" id="s_br_ufpr_c3sl_participatorio_Projeto_legislacaoPropria" object="${projeto}" z="wChuy6QkKZdbT7+Uv3xVw5syDtA="/> + <field:display field="descLegislacao" id="s_br_ufpr_c3sl_participatorio_Projeto_descLegislacao" object="${projeto}" z="JL3fGOirqjzo/jfvrpOEsWfdtuE="/> + <field:display field="obs" id="s_br_ufpr_c3sl_participatorio_Projeto_obs" object="${projeto}" z="+RB342ExVwf7Jpb2LEAVsNVT3tY="/> + <field:display field="estado" id="s_br_ufpr_c3sl_participatorio_Projeto_estado" object="${projeto}" z="QQqAirebJjfsfFvZ2yTuji9gMYY="/> + </page:show> +</div> diff --git a/src/main/webapp/WEB-INF/views/projetoes/update.jspx b/src/main/webapp/WEB-INF/views/projetoes/update.jspx new file mode 100644 index 0000000000000000000000000000000000000000..4f11eae869c2d459e820a1d46951d35fed0bab28 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/projetoes/update.jspx @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<div xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8"/> + <jsp:output omit-xml-declaration="yes"/> + <form:update id="fu_br_ufpr_c3sl_participatorio_Projeto" modelAttribute="projeto" path="/projetoes" versionField="Version" z="5Ih+lV0KpGE1fSZecQ2VR8b5JFQ="> + <field:select field="pai" id="c_br_ufpr_c3sl_participatorio_Projeto_pai" itemValue="id" items="${projetoes}" path="/projetoes" z="JkbtdV8KzNjMFgvmaNi11XbZ+Ss="/> + <field:input field="nome" id="c_br_ufpr_c3sl_participatorio_Projeto_nome" z="5egNGMKHSYOQCuslpB7cYfsCJns="/> + <field:select field="demanda" id="c_br_ufpr_c3sl_participatorio_Projeto_demanda" items="${tipodemandas}" path="tipodemandas" z="LZLJJHDisgTZb2HVM3SXZRFRKZo="/> + <field:select field="acao" id="c_br_ufpr_c3sl_participatorio_Projeto_acao" items="${tipoacaos}" path="tipoacaos" z="TknEprFT06hffWHIizWjHzzhBB8="/> + <field:input field="outroAcao" id="c_br_ufpr_c3sl_participatorio_Projeto_outroAcao" z="gKzGjxAdyPnPD7zoeTc+ZPLtejY="/> + <field:select field="ministerio" id="c_br_ufpr_c3sl_participatorio_Projeto_ministerio" itemValue="id" items="${ministerios}" path="/ministerios" z="64Y1pviPhH0YUpX4/TLAcEiNf8A="/> + <field:input field="objetivo" id="c_br_ufpr_c3sl_participatorio_Projeto_objetivo" z="7NQc7nBdNKGMsVO2gcJ58+nFc0E="/> + <field:input field="rua" id="c_br_ufpr_c3sl_participatorio_Projeto_rua" z="NZ6M3HEDzpkKDIvxyk8iZYFchQA="/> + <field:input field="numero" id="c_br_ufpr_c3sl_participatorio_Projeto_numero" z="xaLTEtm6Pc1D6VgioTdMcQXkq8s="/> + <field:input field="complemento" id="c_br_ufpr_c3sl_participatorio_Projeto_complemento" z="N2Lya9vot39QnzhJ8pqU5d+vzB0="/> + <field:input field="bairro" id="c_br_ufpr_c3sl_participatorio_Projeto_bairro" z="4IENKq7T4UaF0f/0uwCBcT3xtlI="/> + <field:input field="municipio" id="c_br_ufpr_c3sl_participatorio_Projeto_municipio" z="IRx9hrCWxHAzvD0dA+1xxmH/V90="/> + <field:input field="cep" id="c_br_ufpr_c3sl_participatorio_Projeto_cep" z="gVIPRkUIL6GZ45ZU0ehzfXTt4CU="/> + <field:input field="responsavel" id="c_br_ufpr_c3sl_participatorio_Projeto_responsavel" z="qHPooL9WJIOr9aiVpu272tRcYlg="/> + <field:input field="telefones" id="c_br_ufpr_c3sl_participatorio_Projeto_telefones" z="XN9R1Y3TkGJDhJjNR7Ac+uUA10g="/> + <field:input field="email" id="c_br_ufpr_c3sl_participatorio_Projeto_email" validationMessageCode="field_invalid_email" z="wec+yBsxP/CfoGtMjMYu8XOiz8E="/> + <field:input field="publicoAlvo" id="c_br_ufpr_c3sl_participatorio_Projeto_publicoAlvo" z="rfW62fR8G11PyQwsAU15sdK6804="/> + <field:input field="formaAcesso" id="c_br_ufpr_c3sl_participatorio_Projeto_formaAcesso" z="HY3pNe95ZaxAxVS55E5bDnn84FE="/> + <field:input field="site" id="c_br_ufpr_c3sl_participatorio_Projeto_site" z="UtAhbsHkmV/py/BCglNJT4jnKNk="/> + <field:input field="comoFunciona" id="c_br_ufpr_c3sl_participatorio_Projeto_comoFunciona" z="WQT9VOPh8Yng7sdWkKBfWrWJvzY="/> + <field:input field="noticias" id="c_br_ufpr_c3sl_participatorio_Projeto_noticias" z="QvhayaNYZLWbn4Kdz/1ukvJWaQw="/> + <field:input field="horarioFuncionamento" id="c_br_ufpr_c3sl_participatorio_Projeto_horarioFuncionamento" z="/wgLwa6KbhG4wv0vWFn869KF4hg="/> + <field:select field="diasFuncionamento" id="c_br_ufpr_c3sl_participatorio_Projeto_diasFuncionamento" items="${tipodiassemanas}" path="tipodiassemanas" z="+BjTvC5bM2N7YGK48eWFIePY8Ks="/> + <field:input field="estrutura" id="c_br_ufpr_c3sl_participatorio_Projeto_estrutura" z="BMTcTzuUYCoKhXapXah2VN/qPuE="/> + <field:input field="responsaveis" id="c_br_ufpr_c3sl_participatorio_Projeto_responsaveis" z="gmi09GGEpF9pDXN7/aviynR3tBs="/> + <field:input field="telefoneMinisterio" id="c_br_ufpr_c3sl_participatorio_Projeto_telefoneMinisterio" z="UGH0aw3XZuQmgwr0sIS1O9KhHbQ="/> + <field:input field="orcamento" id="c_br_ufpr_c3sl_participatorio_Projeto_orcamento" z="sJO2DC6kqSRPUz5DC5eA/bddxvc="/> + <field:input field="justificativa" id="c_br_ufpr_c3sl_participatorio_Projeto_justificativa" z="bxuZxUlVF/K6r0D/vZ2gLJOYqus="/> + <field:input field="meta" id="c_br_ufpr_c3sl_participatorio_Projeto_meta" z="X67itR3Kt3CcPmnMLE3pk8gJnTQ="/> + <field:select field="temporalidade" id="c_br_ufpr_c3sl_participatorio_Projeto_temporalidade" items="${tipotemporalidades}" path="tipotemporalidades" z="DxeDx4ck5sWIKaomza63nyKiAeQ="/> + <field:checkbox field="possuiMonitoramento" id="c_br_ufpr_c3sl_participatorio_Projeto_possuiMonitoramento" z="/JVVLQICEG8G6erZgd6P7rhoNqM="/> + <field:input field="estadosMunicipioComPrograma" id="c_br_ufpr_c3sl_participatorio_Projeto_estadosMunicipioComPrograma" z="XOH+gInejGvAnV1UOGHZHSlh0kw="/> + <field:input field="publicPrioritario" id="c_br_ufpr_c3sl_participatorio_Projeto_publicPrioritario" z="ZiO1CZu1gNdDb59SvP41Qnpj/io="/> + <field:datetime dateTimePattern="${projeto_datainicio_date_format}" field="dataInicio" id="c_br_ufpr_c3sl_participatorio_Projeto_dataInicio" z="B4b6arF1P2Q4KSgME04mPIWp7Zs="/> + <field:input field="mecanismos" id="c_br_ufpr_c3sl_participatorio_Projeto_mecanismos" z="YCRKTWq1a3Fd0ZHbAwcxKS+vACY="/> + <field:input field="parcerias" id="c_br_ufpr_c3sl_participatorio_Projeto_parcerias" z="x374RYBQGz62YCy6JRm7HDk6kFs="/> + <field:checkbox field="legislacaoPropria" id="c_br_ufpr_c3sl_participatorio_Projeto_legislacaoPropria" z="0FyUiOC8dXYS2KQh9us8ZFSrfU0="/> + <field:input field="descLegislacao" id="c_br_ufpr_c3sl_participatorio_Projeto_descLegislacao" z="Y9X3/A7OHfh+T5M4c7uRjtx2Uak="/> + <field:input field="obs" id="c_br_ufpr_c3sl_participatorio_Projeto_obs" z="5b+Wjz0npE5n2wk2R6g1fJZD0VA="/> + <field:select field="estado" id="c_br_ufpr_c3sl_participatorio_Projeto_estado" items="${tipostatuses}" path="tipostatuses" z="K+kNv0Ov3Ulu6LiKPBQ71hczlOA="/> + </form:update> +</div> diff --git a/src/main/webapp/WEB-INF/views/projetoes/views.xml b/src/main/webapp/WEB-INF/views/projetoes/views.xml new file mode 100644 index 0000000000000000000000000000000000000000..9e9373c9c8a5c67f29813391a0491f607291db3b --- /dev/null +++ b/src/main/webapp/WEB-INF/views/projetoes/views.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" "http://tiles.apache.org/dtds/tiles-config_2_1.dtd"> +<tiles-definitions> + <definition extends="default" name="projetoes/list"> + <put-attribute name="body" value="/WEB-INF/views/projetoes/list.jspx"/> + </definition> +<definition extends="default" name="projetoes/show"> + <put-attribute name="body" value="/WEB-INF/views/projetoes/show.jspx"/> + </definition> +<definition extends="default" name="projetoes/create"> + <put-attribute name="body" value="/WEB-INF/views/projetoes/create.jspx"/> + </definition> +<definition extends="default" name="projetoes/update"> + <put-attribute name="body" value="/WEB-INF/views/projetoes/update.jspx"/> + </definition> +</tiles-definitions> diff --git a/src/main/webapp/WEB-INF/views/resourceNotFound.jspx b/src/main/webapp/WEB-INF/views/resourceNotFound.jspx new file mode 100644 index 0000000000000000000000000000000000000000..b3d27c7637de0f1361bd8f15f9d40f5706248da6 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/resourceNotFound.jspx @@ -0,0 +1,29 @@ +<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:output omit-xml-declaration="yes" /> + <spring:message var="title" code="error_resourcenotfound_title" htmlEscape="false" /> + <util:panel id="title" title="${title}"> + <h2>${fn:escapeXml(title)}</h2> + <p> + <spring:message code="error_resourcenotfound_problemdescription" /> + </p> + <c:if test="${not empty exception}"> + <p> + <h4> + <spring:message code="exception_details" /> + </h4> + <spring:message var="message" code="exception_message" htmlEscape="false" /> + <util:panel id="_message" title="${message}" openPane="false"> + <c:out value="${exception.localizedMessage}" /> + </util:panel> + <spring:message var="stacktrace" code="exception_stacktrace" htmlEscape="false" /> + <util:panel id="_exception" title="${stacktrace}" openPane="false"> + <c:forEach items="${exception.stackTrace}" var="trace"> + <c:out value="${trace}" /> + <br /> + </c:forEach> + </util:panel> + </p> + </c:if> + </util:panel> +</div> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/uncaughtException.jspx b/src/main/webapp/WEB-INF/views/uncaughtException.jspx new file mode 100644 index 0000000000000000000000000000000000000000..9180b0dac409c9e75820634097445c460668be46 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/uncaughtException.jspx @@ -0,0 +1,29 @@ +<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.page contentType="text/html;charset=UTF-8" /> + <jsp:output omit-xml-declaration="yes" /> + <spring:message var="title" code="error_uncaughtexception_title" htmlEscape="false" /> + <util:panel id="title" title="${title}"> + <h2>${fn:escapeXml(title)}</h2> + <p> + <spring:message code="error_uncaughtexception_problemdescription" /> + </p> + <c:if test="${not empty exception}"> + <p> + <h4> + <spring:message code="exception_details" /> + </h4> + <spring:message var="message" code="exception_message" htmlEscape="false" /> + <util:panel id="_message" title="${message}" openPane="false"> + <c:out value="${exception.localizedMessage}" /> + </util:panel> + <spring:message var="stacktrace" code="exception_stacktrace" htmlEscape="false" /> + <util:panel id="_exception" title="${stacktrace}" openPane="false"> + <c:forEach items="${exception.stackTrace}" var="trace"> + <c:out value="${trace}" /> + <br /> + </c:forEach> + </util:panel> + </p> + </c:if> + </util:panel> +</div> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/views.xml b/src/main/webapp/WEB-INF/views/views.xml new file mode 100644 index 0000000000000000000000000000000000000000..e92932a94d77d6d71def7bbbe9f6fecd50b66c5b --- /dev/null +++ b/src/main/webapp/WEB-INF/views/views.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" "http://tiles.apache.org/dtds/tiles-config_2_1.dtd"> +<tiles-definitions> + + <definition extends="default" name="index"> + <put-attribute name="body" value="/WEB-INF/views/index.jspx"/> + </definition> + + <definition extends="public" name="dataAccessFailure"> + <put-attribute name="body" value="/WEB-INF/views/dataAccessFailure.jspx"/> + </definition> + + <definition extends="public" name="resourceNotFound"> + <put-attribute name="body" value="/WEB-INF/views/resourceNotFound.jspx"/> + </definition> + + <definition extends="public" name="uncaughtException"> + <put-attribute name="body" value="/WEB-INF/views/uncaughtException.jspx"/> + </definition> + +<definition extends="public" name="login"> + <put-attribute name="body" value="/WEB-INF/views/login.jspx"/> + </definition> +</tiles-definitions> diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000000000000000000000000000000000..fdde65abb8b0cd6c929411a660c6b3a609ba2252 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> +<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> + + + <display-name>participatorio</display-name> + + <description>Roo generated participatorio application</description> + + + <!-- Enable escaping of form submission contents --> + <context-param> + <param-name>defaultHtmlEscape</param-name> + <param-value>true</param-value> + </context-param> + + <context-param> + <param-name>contextConfigLocation</param-name> + <param-value>classpath*:META-INF/spring/applicationContext*.xml</param-value> + </context-param> + + <filter> + <filter-name>CharacterEncodingFilter</filter-name> + <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> + <init-param> + <param-name>encoding</param-name> + <param-value>UTF-8</param-value> + </init-param> + <init-param> + <param-name>forceEncoding</param-name> + <param-value>true</param-value> + </init-param> + </filter> + + + + <filter> + <filter-name>HttpMethodFilter</filter-name> + <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> + </filter> + + + + <filter> + <filter-name>springSecurityFilterChain</filter-name> + <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> + </filter> + <filter> + <filter-name>Spring OpenEntityManagerInViewFilter</filter-name> + <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>CharacterEncodingFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <filter-mapping> + <filter-name>HttpMethodFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + + + <filter-mapping> + <filter-name>springSecurityFilterChain</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>Spring OpenEntityManagerInViewFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <!-- Creates the Spring Container shared by all Servlets and Filters --> + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> + + <!-- Handles Spring requests --> + <servlet> + <servlet-name>participatorio</servlet-name> + <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> + <init-param> + <param-name>contextConfigLocation</param-name> + <param-value>WEB-INF/spring/webmvc-config.xml</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>participatorio</servlet-name> + <url-pattern>/</url-pattern> + </servlet-mapping> + + <session-config> + <session-timeout>10</session-timeout> + </session-config> + + <error-page> + <exception-type>java.lang.Exception</exception-type> + <location>/uncaughtException</location> + </error-page> + + <error-page> + <error-code>404</error-code> + <location>/resourceNotFound</location> + </error-page> +</web-app> diff --git a/src/main/webapp/images/add.png b/src/main/webapp/images/add.png new file mode 100644 index 0000000000000000000000000000000000000000..d5bfa0719bc3a2ce4fc529403f0acd6b6057c956 Binary files /dev/null and b/src/main/webapp/images/add.png differ diff --git a/src/main/webapp/images/banner-graphic.png b/src/main/webapp/images/banner-graphic.png new file mode 100644 index 0000000000000000000000000000000000000000..7d2b78c6e370c97f342921e8158c324b73c8bda6 Binary files /dev/null and b/src/main/webapp/images/banner-graphic.png differ diff --git a/src/main/webapp/images/create.png b/src/main/webapp/images/create.png new file mode 100644 index 0000000000000000000000000000000000000000..d5bfa0719bc3a2ce4fc529403f0acd6b6057c956 Binary files /dev/null and b/src/main/webapp/images/create.png differ diff --git a/src/main/webapp/images/delete.png b/src/main/webapp/images/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..3141467c678d2b53f79deb22086a9cb3a576a08d Binary files /dev/null and b/src/main/webapp/images/delete.png differ diff --git a/src/main/webapp/images/en.png b/src/main/webapp/images/en.png new file mode 100644 index 0000000000000000000000000000000000000000..ff701e19f6d2c0658fb23b1d94124cba4ce60851 Binary files /dev/null and b/src/main/webapp/images/en.png differ diff --git a/src/main/webapp/images/favicon.ico b/src/main/webapp/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..c2f2b6ccdaa425cbd4acdff6e32860723ca35c87 Binary files /dev/null and b/src/main/webapp/images/favicon.ico differ diff --git a/src/main/webapp/images/list.png b/src/main/webapp/images/list.png new file mode 100644 index 0000000000000000000000000000000000000000..acc30b853b3740bad231e4daa8e9f5a81f3f757b Binary files /dev/null and b/src/main/webapp/images/list.png differ diff --git a/src/main/webapp/images/resultset_first.png b/src/main/webapp/images/resultset_first.png new file mode 100644 index 0000000000000000000000000000000000000000..b03eaf8b5416fa6878165d95116e73003f8445f5 Binary files /dev/null and b/src/main/webapp/images/resultset_first.png differ diff --git a/src/main/webapp/images/resultset_last.png b/src/main/webapp/images/resultset_last.png new file mode 100644 index 0000000000000000000000000000000000000000..8ec89478477aada6c95cac22920094dd12f399a7 Binary files /dev/null and b/src/main/webapp/images/resultset_last.png differ diff --git a/src/main/webapp/images/resultset_next.png b/src/main/webapp/images/resultset_next.png new file mode 100644 index 0000000000000000000000000000000000000000..e252606d3e68c6da135a9b165996d9da968ef7fc Binary files /dev/null and b/src/main/webapp/images/resultset_next.png differ diff --git a/src/main/webapp/images/resultset_previous.png b/src/main/webapp/images/resultset_previous.png new file mode 100644 index 0000000000000000000000000000000000000000..18f9cc10948f025fde708328fa704b520161e5f6 Binary files /dev/null and b/src/main/webapp/images/resultset_previous.png differ diff --git a/src/main/webapp/images/show.png b/src/main/webapp/images/show.png new file mode 100644 index 0000000000000000000000000000000000000000..2f193889f7ea091c292acdd684c595dcb206b5c4 Binary files /dev/null and b/src/main/webapp/images/show.png differ diff --git a/src/main/webapp/images/springsource-logo.png b/src/main/webapp/images/springsource-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e170f8abf778b24ed1de11dad6f1444e849269ba Binary files /dev/null and b/src/main/webapp/images/springsource-logo.png differ diff --git a/src/main/webapp/images/update.png b/src/main/webapp/images/update.png new file mode 100644 index 0000000000000000000000000000000000000000..046811ed7a6ef16be1a54bb860e1f22c6dacdacf Binary files /dev/null and b/src/main/webapp/images/update.png differ diff --git a/src/main/webapp/styles/alt.css b/src/main/webapp/styles/alt.css new file mode 100644 index 0000000000000000000000000000000000000000..dc99e4edf9aca4f1fc84cd9be8b624295b0d44ab --- /dev/null +++ b/src/main/webapp/styles/alt.css @@ -0,0 +1,369 @@ +/* main elements */ + +body,div,td { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #666; +} + +body { + background-color: #fff; + text-align: center; +} + +#header { + margin-bottom: 1em; +} + +#wrapper { + width:800px; + min-width: 800px; + max-width: 800px; + margin-right: auto; + margin-left: auto; + + /* fix max-width incompatibility in IE6 */ + width:expression(document.body.clientWidth > 800? "800px": "auto" ); + + overflow:hidden; + display:block; +} + +/* header and footer elements */ + +#main { + overflow:hidden; + display:box; +} + +#menu { + background: #eee; + position:relative; + float:right; + left:0px; + width:220px; + margin-left:15px; +} + +#menu ul{ + list-style: none; + margin: 0; + padding: 0; +} + +#menu ul li{ + padding: 0px; +} + + +#menu a, #menu h2 { + display: block; + margin: 0; + padding: 2px 6px; + color:#FFFFFF; +} + +#menu h2 { + color: #fff; + background: #648C1D; + text-transform: uppercase; + font-weight:bold; + font-size: 12px; +} + +#menu a { + color: #666666; + background: #efefef; + text-decoration: none; + padding: 2px 12px; +} + +#menu a:hover { + color: #648C1D; + background: #fff; +} + +#footer { + background:#fff; + border:none; + margin-top:15px; + border-top:1px solid #999999; +} + +#footer .new { + float:left; +} + +#footer a:link {color: #7db223;} + +.quicklinks { + clear:both; + padding-bottom: 15px +} +.quicklinks span { + float: right; +} + +label { + width:100px; + float:left; + margin-left: 5px; + margin-top: 0px; +} + +input { + height:20px; +} + +input, textarea, select { + border:1px solid #B3B3B3; +} + +input.image { + border: none; + height: auto; + vertical-align: middle; +} + +submit { + height:25px; +} + +div { + text-align: left; +} + +div .box { + display:block; + margin-left:105px; +} + +/* menu elements*/ + +a.menu, a.menu:link, a.menu:visited {display:block; width:150px; height:25px;} + +/* text styles */ + +h1,h2,h3 { + font-family: Helvetica, sans-serif; + color: #7db223; +} + +h1 { + font-size: 20px; + line-height: 26px; +} + +h2 { + font-size: 18px; + line-height: 20px; +} + +h3 { + font-size: 15px; + line-height: 21px; + color:#555; +} + +h4 { + font-size: 14px; + line-height: 20px; +} + +.errors { + color: red; + font-weight: bold; + display: block; + margin-left: 105px; +} + +a { + text-decoration: underline; + font-size: 12px; +} + +a img { + border: 0 none; + vertical-align: middle; +} + +tr:nth-child(odd) { + background-color: #FFFFFF; +} + +tr:nth-child(even) { + background-color: #EFEFEF; +} + +a:link { + color: #7db223; +} + +a:hover { + color: #456314; +} + +a:active { + color: #7db223; +} + +a:visited { + color: #7db223; +} + +li { + padding-top: 5px; + text-align: left; +} + +ul li { + margin:0 0 0.25em 0; + padding:0; +} +/* table elements */ + +table { + background: #EEEEEE; + margin: 2px 0 0 0; + border: 1px solid #BBBBBB; + border-collapse: collapse; + width: 100% +} + +table table { + margin: -5px 0; + border: 0px solid #e0e7d3; + width: 100%; +} + +table td,table th { + padding: 2px; + border: 1px solid #CCCCCC; +} + +table td form { + text-align:center; + vertical-align: middle; + margin: 0px; +} + +table th { + font-size: 0.9em; + text-align: left; + font-weight: bold; + color: #FFF; + background: #999; +} + +table thead { + font-weight: bold; + font-style: italic; + background-color: #BBBBBB; +} + +table a:link {color: #303030;} + +.utilbox {width: 18px;} + +caption { + caption-side: top; + width: auto; + text-align: left; + font-size: 12px; + color: #848f73; + padding-bottom: 4px; +} + +fieldset { + background: #e0e7d3; + padding: 8px; + padding-bottom: 22px; + border: none; + width: 560px; +} + +fieldset label { + width: 70px; + float: left; + margin-top: 1.7em; + margin-left: 20px; +} + +fieldset textfield { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset textarea { + margin: 3px; + height: 165px; + background: #e0e7d3; +} + +fieldset input { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset table { + width: 100%; +} + +fieldset th { + padding-left: 25px; +} + +.table-buttons { + background-color:#fff; + border:none; +} + +.table-buttons td { + border:none; +} + +.submit input { + border: 1px solid #BBBBBB; + color:#777777; + padding:2px 7px; + font-size:11px; + text-transform:uppercase; + font-weight:bold; + height:24px; +} + +.updated { + background:#ecf1e5; + font-size:11px; + margin-left:2px; + border:4px solid #ecf1e5; +} + +.updated td { + padding:2px 8px; + font-size:11px; + color:#888888; +} + +.dijitArrowButton { + height: 20px; +} + +.dijitTextArea{ + min-height:5.5em !important; + max-height:22em !important; + overflow-y: auto !important; + max-width: 175px; +} + +.RichTextEditable{ + min-height:18em !important; + max-height:18em !important; +} + +.flag { + height: 11px; + width: 16px; +} \ No newline at end of file diff --git a/src/main/webapp/styles/standard.css b/src/main/webapp/styles/standard.css new file mode 100644 index 0000000000000000000000000000000000000000..9f79bb08c4833849e3d75a3d3754b24a5916c1ca --- /dev/null +++ b/src/main/webapp/styles/standard.css @@ -0,0 +1,373 @@ +/* main elements */ + +body,div,td { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #666; +} + +body { + background-color: #fff; + text-align: center; +} + +#header { + margin-bottom: 1em; +} + +#wrapper { + width:800px; + min-width: 800px; + max-width: 800px; + margin-right: auto; + margin-left: auto; + + /* fix max-width incompatibility in IE6 */ + width:expression(document.body.clientWidth > 800? "800px": "auto" ); + + overflow:hidden; + display:block; +} + +/* header and footer elements */ + +#main { + overflow:hidden; + display:box; +} + +#menu { + background: #eee; + position:relative; + float:left; + left:0px; + width:220px; + margin-right:15px; +} + +#menu ul{ + list-style: none; + margin: 0; + padding: 0; +} + +#menu ul li{ + padding: 0px; +} + + +#menu a, #menu h2 { + display: block; + margin: 0; + padding: 2px 6px; + color:#FFFFFF; +} + +#menu h2 { + color: #fff; + background: #648C1D; + text-transform: uppercase; + font-weight:bold; + font-size: 12px; +} + +#menu a { + color: #666666; + background: #efefef; + text-decoration: none; + padding: 2px 12px; +} + +#menu a:hover { + color: #648C1D; + background: #fff; +} + +#footer { + background:#fff; + border:none; + margin-top:15px; + border-top:1px solid #999999; +} + +#footer .new { + float:left; +} + +#footer a:link {color: #7db223;} + +.quicklinks { + clear:both; + padding-bottom: 15px +} +.quicklinks span { + float: right; +} + +table.navigation { + border: 0px; +} + +label { + width:100px; + float:left; + margin-left: 5px; + margin-top: 0px; +} + +input { + height:20px; +} + +input, textarea, select { + border:1px solid #B3B3B3; +} + +input.image { + border: none; + height: auto; + vertical-align: middle; +} + +submit { + height:25px; +} + +div { + text-align: left; +} + +div .box { + display:block; + margin-left:105px; +} + +/* menu elements*/ + +a.menu, a.menu:link, a.menu:visited {display:block; width:150px; height:25px;} + +/* text styles */ + +h1,h2,h3 { + font-family: Helvetica, sans-serif; + color: #7db223; +} + +h1 { + font-size: 20px; + line-height: 26px; +} + +h2 { + font-size: 18px; + line-height: 20px; +} + +h3 { + font-size: 15px; + line-height: 21px; + color:#555; +} + +h4 { + font-size: 14px; + line-height: 20px; +} + +.errors { + color: red; + font-weight: bold; + display: block; + margin-left: 105px; +} + +a { + text-decoration: underline; + font-size: 12px; +} + +a img { + border: 0 none; + vertical-align: middle; +} + +tr:nth-child(odd) { + background-color: #FFFFFF; +} + +tr:nth-child(even) { + background-color: #EFEFEF; +} + +a:link { + color: #7db223; +} + +a:hover { + color: #456314; +} + +a:active { + color: #7db223; +} + +a:visited { + color: #7db223; +} + +li { + padding-top: 5px; + text-align: left; +} + +ul li { + margin:0 0 0.25em 0; + padding:0; +} +/* table elements */ + +table { + background: #EEEEEE; + margin: 2px 0 0 0; + border: 1px solid #BBBBBB; + border-collapse: collapse; + width: 100% +} + +table table { + margin: -5px 0; + border: 0px solid #e0e7d3; + width: 100%; +} + +table td,table th { + padding: 2px; + border: 1px solid #CCCCCC; +} + +table td form { + text-align:center; + vertical-align: middle; + margin: 0px; +} + +table th { + font-size: 0.9em; + text-align: left; + font-weight: bold; + color: #FFF; + background: #999; +} + +table thead { + font-weight: bold; + font-style: italic; + background-color: #BBBBBB; +} + +table a:link {color: #303030;} + +.utilbox {width: 18px;} + +caption { + caption-side: top; + width: auto; + text-align: left; + font-size: 12px; + color: #848f73; + padding-bottom: 4px; +} + +fieldset { + background: #e0e7d3; + padding: 8px; + padding-bottom: 22px; + border: none; + width: 560px; +} + +fieldset label { + width: 70px; + float: left; + margin-top: 1.7em; + margin-left: 20px; +} + +fieldset textfield { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset textarea { + margin: 3px; + height: 165px; + background: #e0e7d3; +} + +fieldset input { + margin: 3px; + height: 20px; + background: #e0e7d3; +} + +fieldset table { + width: 100%; +} + +fieldset th { + padding-left: 25px; +} + +.table-buttons { + background-color:#fff; + border:none; +} + +.table-buttons td { + border:none; +} + +.submit input { + border: 1px solid #BBBBBB; + color:#777777; + padding:2px 7px; + font-size:11px; + text-transform:uppercase; + font-weight:bold; + height:24px; +} + +.updated { + background:#ecf1e5; + font-size:11px; + margin-left:2px; + border:4px solid #ecf1e5; +} + +.updated td { + padding:2px 8px; + font-size:11px; + color:#888888; +} + +.dijitArrowButton { + height: 20px; +} + +.dijitTextArea{ + min-height:5.5em !important; + max-height:22em !important; + overflow-y: auto !important; + max-width: 175px; +} + +.RichTextEditable{ + min-height:18em !important; + max-height:18em !important; +} + +.flag { + height: 11px; + width: 16px; +} \ No newline at end of file