r340 - in trunk/chorem-webmotion/src/main: java/org/chorem/webmotion/actions java/org/chorem/webmotion/actions/project webapp/WEB-INF/jsp
Author: meynier Date: 2013-06-13 17:33:58 +0200 (Thu, 13 Jun 2013) New Revision: 340 Url: http://chorem.org/projects/chorem/repository/revisions/340 Log: added missing files for project dashboard Added: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSingleProject.jsp Added: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java (rev 0) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java 2013-06-13 15:33:58 UTC (rev 340) @@ -0,0 +1,38 @@ +package org.chorem.webmotion.actions.project; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.debux.webmotion.server.WebMotionController; +import org.chorem.ChoremClient; +import org.debux.webmotion.server.call.Call; +import org.debux.webmotion.server.render.Render; +import org.chorem.entities.Quotation; +import org.chorem.entities.Project; +import org.nuiton.wikitty.query.WikittyQuery; +import org.nuiton.wikitty.query.WikittyQueryMaker; +import org.nuiton.wikitty.query.WikittyQueryResult; + +public class DashboardProjectAction extends WebMotionController { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(DashboardProjectAction.class); + + public Render projectFilter(ChoremClient client, String id) { + + WikittyQuery projectQuery = new WikittyQueryMaker() + .eq(Project.ELEMENT_FIELD_PROJECT_NAME, id) + .end(); + + WikittyQueryResult<Project> result = + client.findAllByQuery(Project.class, projectQuery); + + System.out.println(result); + + return renderView("dashboardSingleProject.jsp", + "title", "Tableau de bord projet", "projects", result.getAll()); + } + + public Render requestProject(ChoremClient client, String projectname) { + return projectFilter(client, projectname); + } +} Added: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSingleProject.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSingleProject.jsp (rev 0) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSingleProject.jsp 2013-06-13 15:33:58 UTC (rev 340) @@ -0,0 +1,73 @@ +<%-- + #%L + Chorem webmotion + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2011 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib uri="/WEB-INF/wikitty.tld" prefix="w"%> + +<h1>${title}</h1> +<form class="well form-inline" method="GET"> +Nom du projet : <input class="input-large" type="text" name="projectname" value="${param.projectname}" placeholder="project name"/> +<input type="submit" class="btn"/> +</form> +<c:choose> +<c:when test="${projects.size() == 1}"> +<%//Project table generation %> +<table class="table table-striped table-bordered table-condensed"> + <thead> + <tr> + <th>Project</th> + <th>Description</th> + </tr> + </thead> + <c:forEach var="p" items="${projects}"> + <tbody> + <tr> + <td>${p.name}</td> + <td>${p.description}</td> + </tr> + </tbody> + </c:forEach> + </table> +</c:when> + +<c:otherwise> +<c:if test="${param.projectname.length() != 0 }"> +Projet inexistant +</c:if> + + +</c:otherwise> + + +</c:choose> + + + + + + + + +
participants (1)
-
meynier@users.chorem.org