Person jrpdf report
"Jacques Morel" <[email protected]>
| Newsgroups | gmane.comp.java.xplanner.devel |
|---|---|
| Message-ID | <[email protected]> |
Mario, It is available from a Person view page (click on any person hyperlink or Me). Jacques On 5/5/06, Mario Rasgado <[email protected]> wrote: > > Hi jacques, i have other question again, now i have tu print a reporter of > Person that let you display the story where was a people whit with his times > in a week, I dont´now how begin, i have used ireport for to do my reports > with querys but i don´t know how i can to use it, because you has in the > struts-config.xml this: > > > > < > action path="/export/task/jrpdf" type=" > com.technoetic.xplanner.actions.ExportAction"> > > <bean> > > <property name="metaRepository" > > > <ref bean="metaRepository" ></ref> > > </property> > > <property name="type" > > > <value>com.technoetic.xplanner.domain.Task </value> > > </property> > > <property name="exporter" > > > <ref bean="reportExporter" ></ref> > > </property> > > </bean> > > </action> > > > > and I intent to use other this > > <action path="/export/person/jrpdf" type=" > com.technoetic.xplanner.actions.ExportAction"> > > <bean> > > <property name="metaRepository" > > > <ref bean="metaRepository" ></ref> > > </property> > > <property name="type" > > > <value>com.technoetic.xplanner.domain.Person </value> > > </property> > > <property name="exporter" > > > <ref bean="reportExporter" ></ref> > > </property> > > </bean> > > </action>but don´t find it, sompleople that helme. thanks. > > > On 5/4/06, Jacques Morel <[email protected]> wrote: > > > > Guys, > > > > As we talked about, we must make sure that all our queries work with > > HSQL. The properties file has all necessary configurations to run with HSQL. > > Let me know if we need more information. Right now not all ATs are passing > > with HSQL. > > Also, we should not use the BootstrapSystemUser anymore since we are > > using autopatch now. > > > > Jacques > > > > On 4 May 2006 09:58:46 -0000, scm-XLRE/[email protected] < > > scm-XLRE/[email protected]> wrote: > > > > > > Revision 1120 Author mprokopowicz Date 2006-05-04 05:58:45 -0400 > > > (Thu, 04 May 2006) Log Message > > > > > > delete iteration can only be performed by admin > > > > > > Modified Paths > > > > > > - > > > trunk/xplanner/src/com/technoetic/xplanner/security/install/BootstrapSystemUser.java<http://mail.google.com/mail/?&ik=66135db97b&view=cv&search=inbox&th=10b0037db937ea87&lvp=3&cvp=3&qt=&zx=3yzglam4b16m#10b0037db937ea87_10afecf4231b019a_trunkxplannersrccomtechnoeticxplannersecurityinstallBootstrapSystemUserjava> > > > - trunk/xplanner/war/WEB-INF/jsp/view/project.jsp<http://mail.google.com/mail/?&ik=66135db97b&view=cv&search=inbox&th=10b0037db937ea87&lvp=3&cvp=3&qt=&zx=3yzglam4b16m#10b0037db937ea87_10afecf4231b019a_trunkxplannerwarWEBINFjspviewprojectjsp> > > > > > > Added Paths > > > > > > - trunk/xplanner/resources/patches/patch0013_negative_permission_editor_cannot_delete_iteration.sql > > > > > > <http://mail.google.com/mail/?&ik=66135db97b&view=cv&search=inbox&th=10b0037db937ea87&lvp=3&cvp=3&qt=&zx=3yzglam4b16m#10b0037db937ea87_10afecf4231b019a_trunkxplannerresourcespatchespatch0013_negative_permission_editor_cannot_delete_iterationsql> > > > > > > Diff Added: > > > trunk/xplanner/resources/patches/patch0013_negative_permission_editor_cannot_delete_iteration.sql > > > (0 => 1120) > > > > > > --- trunk/xplanner/resources/patches/patch0013_negative_permission_editor_cannot_delete_iteration.sql (rev 0) > > > > > > +++ trunk/xplanner/resources/patches/patch0013_negative_permission_editor_cannot_delete_iteration.sql 2006-05-04 09:58:45 UTC (rev 1120) > > > > > > @@ -0,0 +1,3 @@ > > > +SELECT @id:=nextId FROM identifier; > > > +UPDATE identifier SET nextId = @id + 1; > > > +INSERT INTO permission VALUES(@id,3,'delete','system.project.iteration',0, 0); > > > > > > \ No newline at end of file > > > > > > Modified: > > > trunk/xplanner/src/com/technoetic/xplanner/security/install/BootstrapSystemUser.java > > > (1119 => 1120) > > > > > > --- trunk/xplanner/src/com/technoetic/xplanner/security/install/BootstrapSystemUser.java 2006-05-02 18:58:27 UTC (rev 1119) > > > > > > +++ trunk/xplanner/src/com/technoetic/xplanner/security/install/BootstrapSystemUser.java 2006-05-04 09:58:45 UTC (rev 1120) > > > > > > @@ -20,128 +20,130 @@ > > > import com.technoetic.xplanner.security.auth.Permission; > > > > > > public class BootstrapSystemUser { > > > - private Logger log = > > > Logger.getLogger(getClass()); > > > - protected static final String SYSADMIN_USER_ID = "sysadmin"; > > > - protected static final int PATCH_LEVEL = 2; > > > - protected static final String PATCH_NAME = "XPlanner bootstrap"; > > > > > > + private Logger log = Logger.getLogger(getClass()); > > > + protected static final String SYSADMIN_USER_ID = "sysadmin"; > > > + protected static final int PATCH_LEVEL = 2; > > > + protected static final String PATCH_NAME = "XPlanner bootstrap"; > > > > > > > > > - public BootstrapSystemUser() { > > > + public BootstrapSystemUser() { > > > // setLevel(new Integer(PATCH_LEVEL)); > > > // setName(PATCH_NAME); > > > > > > - } > > > + } > > > > > > - public void run(String sysadminId) throws Exception { > > > - try { > > > - HibernateHelper.initializeHibernate(); > > > - Session session = > > > GlobalSessionFactory.get().openSession(); > > > - try { > > > - List people = session.find("from person in class " + Person.class.getName() + > > > - " where > > > person.userId = ?", > > > - sysadminId, Hibernate.STRING); > > > - Iterator personItr = people.iterator(); > > > - Person sysadmin; > > > - if (personItr.hasNext > > > > > > ()) { > > > - sysadmin = (Person) personItr.next(); > > > - log.info("using " + sysadminId + " user"); > > > - } else { > > > - sysadmin = createSysAdmin(sysadminId, session); > > > > > > + public void run(String sysadminId) throws Exception { > > > + try { > > > + HibernateHelper.initializeHibernate(); > > > + Session session = GlobalSessionFactory.get().openSession(); > > > > > > + try { > > > + List people = session.find("from person in class " + Person.class.getName() + > > > + " where person.userId = ?", > > > + sysadminId, > > > Hibernate.STRING); > > > + Iterator personItr = people.iterator(); > > > + Person sysadmin; > > > + if (personItr.hasNext()) { > > > + sysadmin = (Person) personItr.next > > > > > > (); > > > + log.info("using " + sysadminId + " user"); > > > + } else { > > > + sysadmin = createSysAdmin(sysadminId, session); > > > + } > > > + Role viewerRole = initializeRole(session, "viewer", 1, 8); > > > > > > + Role editorRole = initializeRole(session, "editor", 2, 7); > > > + Role adminRole = initializeRole(session, "admin", 3, 6); > > > + Role sysadminRole = initializeRole(session, SYSADMIN_USER_ID, 4, 5); > > > > > > + addRoleAssociation(session, sysadminRole.getId(), sysadmin.getId(), 0); > > > + createPermission(session, sysadminRole, "%", "%"); > > > + createNegativePermission(session, editorRole, " > > > system.project", "create.project"); > > > + createNegativePermission(session, editorRole, "system.person", "create.person"); > > > + createNegativePermission(session, adminRole, " > > > system.project", "create.project"); > > > + createNegativePermission(session, editorRole, "system.project.iteration", "delete"); > > > + createPermission(session, adminRole, "%", "admin%"); > > > > > > + createPermission(session, editorRole, "%", "create%"); > > > + createPermission(session, editorRole, "%", "edit%"); > > > + createPermission(session, editorRole, "%", "integrate%"); > > > > > > + createPermission(session, editorRole, "%", "delete%"); > > > + createPermission(session, viewerRole, "%", "read%"); > > > + session.flush > > > > > > (); > > > + session.connection().commit(); > > > + } finally { > > > + session.close(); > > > } > > > - Role viewerRole = initializeRole(session, "viewer", 1, 8); > > > > > > - Role editorRole = initializeRole(session, "editor", 2, 7); > > > - Role adminRole = initializeRole(session, "admin", 3, 6); > > > - Role sysadminRole = initializeRole(session, SYSADMIN_USER_ID, 4, 5); > > > > > > - addRoleAssociation(session, sysadminRole.getId(), sysadmin.getId(), 0); > > > - createPermission(session, sysadminRole, "%", "%"); > > > - createNegativePermission(session, editorRole, " > > > system.project", "create.project"); > > > - createNegativePermission(session, editorRole, "system.person", "create.person"); > > > - createNegativePermission(session, adminRole, " > > > system.project", "create.project"); > > > - createPermission(session, adminRole, "%", "admin%"); > > > - createPermission(session, editorRole, "%", "create%"); > > > > > > - createPermission(session, editorRole, "%", "edit%"); > > > - createPermission(session, editorRole, "%", "integrate%"); > > > - createPermission(session, editorRole, "%", "delete%"); > > > > > > - createPermission(session, viewerRole, "%", "read%"); > > > - session.flush(); > > > - session.connection().commit(); > > > - } finally { > > > - session.close > > > > > > (); > > > - } > > > - } catch (Exception e) { > > > - e.printStackTrace(); > > > - throw e; > > > - } > > > - } > > > + } catch (Exception e) { > > > + e.printStackTrace(); > > > + throw e; > > > > > > + } > > > + } > > > > > > - private Person createSysAdmin(String sysadminId, Session session) throws HibernateException { > > > - Person sysadmin; > > > - log.info("creating " + sysadminId + " user"); > > > > > > - sysadmin = new Person(); > > > - sysadmin.setUserId(sysadminId); > > > - sysadmin.setName(sysadminId); > > > - sysadmin.setInitials("SYS"); > > > - sysadmin.setEmail(" > > > > > > [email protected]"); > > > - sysadmin.setPassword("1tGWp1Bdm02Sw4bD7/o0N2ao405Tf8kjxGBW/A=="); // password=admin > > > - sysadmin.setLastUpdateTime(new Date()); > > > - session.save(sysadmin); > > > - return sysadmin; > > > > > > - } > > > + private Person createSysAdmin(String sysadminId, Session session) throws HibernateException { > > > + Person sysadmin; > > > + log.info("creating " + sysadminId + " user"); > > > > > > + sysadmin = new Person(); > > > + sysadmin.setUserId(sysadminId); > > > + sysadmin.setName(sysadminId); > > > + sysadmin.setInitials("SYS"); > > > + sysadmin.setEmail(" > > > > > > [email protected]"); > > > + sysadmin.setPassword("1tGWp1Bdm02Sw4bD7/o0N2ao405Tf8kjxGBW/A=="); // password=admin > > > + sysadmin.setLastUpdateTime(new Date()); > > > + session.save(sysadmin); > > > > > > > > > + return sysadmin; > > > + } > > > > > > - private void addRoleAssociation(Session session, int roleId, int personId, int projectId) throws HibernateException { > > > - session.save(new RoleAssociation(projectId, personId, roleId)); > > > > > > - } > > > + private void addRoleAssociation(Session session, int roleId, int personId, int projectId) > > > + throws HibernateException { > > > + session.save(new RoleAssociation(projectId, personId, roleId)); > > > > > > + } > > > > > > - private void createPermission(Session session, Role sysadminRole, String resourceType, String permissionName) > > > - throws HibernateException { > > > - Permission permission = new Permission(resourceType, 0, > > > sysadminRole.getId(), permissionName); > > > - session.save(permission); > > > - } > > > + private void createPermission(Session session, Role role, String resourceType, String permissionName) > > > + throws HibernateException { > > > > > > + Permission permission = new Permission(resourceType, 0, role.getId(), permissionName); > > > + session.save(permission); > > > + } > > > > > > - private void createNegativePermission(Session session, Role sysadminRole, String resourceType, String permissionName) > > > > > > - throws HibernateException { > > > - Permission permission = new Permission(resourceType, 0, sysadminRole.getId(), permissionName); > > > - permission.setPositive(false); > > > - session.save(permission); > > > > > > - } > > > + private void createNegativePermission(Session session, Role role, String resourceType, String permissionName) > > > + throws HibernateException { > > > + Permission permission = new Permission(resourceType, 0, > > > role.getId(), permissionName); > > > + permission.setPositive(false); > > > + session.save(permission); > > > + } > > > > > > - private Role initializeRole(Session session, String roleName, int left, int right) throws HibernateException { > > > > > > - List roles = session.find("from role in class " + Role.class.getName() + " where role.name = ?", > > > > > > - roleName, Hibernate.STRING); > > > - Role role; > > > - if (roles.size() == 0) { > > > - log.info("creating role: " + roleName); > > > - role = new Role(roleName); > > > > > > - role.setLeft(left); > > > - role.setRight(right); > > > - session.save(role); > > > - } else { > > > - role = (Role) roles.get(0); > > > - } > > > - return role; > > > - } > > > > > > + private Role initializeRole(Session session, String roleName, int left, int right) throws HibernateException { > > > + List roles = session.find("from role in class " + Role.class.getName() + " where role.name > > > = ?", > > > + roleName, Hibernate.STRING); > > > + Role role; > > > + if (roles.size() == 0) { > > > + log.info("creating role: " + roleName); > > > + role = new Role(roleName); > > > > > > + role.setLeft(left); > > > + role.setRight(right); > > > + session.save(role); > > > + } else { > > > + role = (Role) roles.get(0); > > > + } > > > + return role; > > > + } > > > > > > > > > - public void migrate(MigrationContext context) throws MigrationException { > > > - try { > > > - run(SYSADMIN_USER_ID); > > > - } catch (Exception e) { > > > - throw new MigrationException("error during migration", e); > > > > > > - } > > > - finally { > > > - HsqlServer.shutdown(); > > > - } > > > - } > > > + public void migrate(MigrationContext context) throws MigrationException { > > > + try { > > > + run(SYSADMIN_USER_ID); > > > > > > + } catch (Exception e) { > > > + throw new MigrationException("error during migration", e); > > > + } > > > + finally { > > > + HsqlServer.shutdown(); > > > + } > > > + } > > > > > > > > > - public static void main(String[] args) { > > > - String sysadminId = SYSADMIN_USER_ID; > > > - if (args.length == 1) { > > > - sysadminId = args[0]; > > > - } > > > - BootstrapSystemUser action = new BootstrapSystemUser(); > > > > > > - try { > > > - action.run(sysadminId); > > > - } catch (Exception e) { > > > - e.printStackTrace(); > > > - } finally { > > > - HsqlServer.shutdown(); > > > - } > > > - } > > > + public static void main(String[] args) { > > > > > > + String sysadminId = SYSADMIN_USER_ID; > > > + if (args.length == 1) { > > > + sysadminId = args[0]; > > > + } > > > + BootstrapSystemUser action = new BootstrapSystemUser(); > > > + try { > > > > > > + action.run(sysadminId); > > > + } catch (Exception e) { > > > + e.printStackTrace(); > > > + } finally { > > > + HsqlServer.shutdown(); > > > + } > > > + } > > > } > > > > > > Modified: trunk/xplanner/war/WEB-INF/jsp/view/project.jsp (1119 => > > > 1120) > > > > > > --- trunk/xplanner/war/WEB-INF/jsp/view/project.jsp 2006-05-02 18:58:27 UTC (rev 1119) > > > +++ trunk/xplanner/war/WEB-INF/jsp/view/project.jsp 2006-05-04 09:58:45 UTC (rev 1120) > > > > > > @@ -1,8 +1,8 @@ > > > -<%@ page contentType = "text/html;charset=UTF-8"%> > > > +<%@ page contentType="text/html;charset=UTF-8" %> > > > <%@ page import="org.apache.struts.Globals > > > > > > , > > > com.technoetic.xplanner.actions.AbstractAction, > > > com.technoetic.xplanner.format.DecimalFormat, > > > - com.technoetic.xplanner.tags.displaytag.IterationRowDecorator > > > > > > "%> > > > + com.technoetic.xplanner.tags.displaytag.IterationRowDecorator" %> > > > <%@ taglib uri=" > > > > > > http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> > > > <%@ taglib uri=" > > > > > > http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> > > > <%@ taglib uri=" > > > > > > http://jakarta.apache.org/struts/tags-html" prefix="html" %> > > > @@ -12,7 +12,7 @@ > > > <%@ taglib uri=" > > > > > > http://xplanner.org/displaytag.sf.net" prefix="dt" %> > > > > > > <db:useBean id="project" type="com.technoetic.xplanner.domain.Project" scope="request"/> > > > > > > -<xplanner:content definition="tiles:view" > > > > +<xplanner:content definition="tiles:view"> > > > > > > <!-- DEBT: Should use "this" instead of project. This way nobody has to set it explicitly in the tile--> > > > > > > <tiles:put name="beanName">project</tiles:put> > > > @@ -28,30 +28,47 @@ > > > <bean:size id="iterationCount" name="project" property="iterations"/> > > > > > > <logic:greaterThan name="iterationCount" value="0"> > > > <p> > > > - <xplanner:writableTable wholeCollection='<%=project.getIterations() %>' permissions="edit,delete" > > > > > > - rowDecorator='<%= new IterationRowDecorator() %>' id="objecttable" name="requestScope.project" > > > - property="iterations" styleClass="objecttable" requestURI="" > > > > > > - defaultorder="descending" defaultsort="5" pagesize="10" > > > > - <dt:setProperty name="paging.banner.placement" value="bottom" /> > > > > > > > > > + <xplanner:writableTable wholeCollection='<%=project.getIterations() %>' permissions="edit,delete" > > > + rowDecorator='<%= new IterationRowDecorator() %>' id="objecttable" name=" > > > requestScope.project" > > > + property="iterations" styleClass="objecttable" requestURI="" > > > + defaultorder="descending" defaultsort="5" pagesize="10"> > > > > > > + <dt:setProperty name="paging.banner.placement" value="bottom"/> > > > <bean:define id="iteration" name="objecttable" type="com.technoetic.xplanner.domain.Iteration > > > > > > "/> > > > - <xplanner:actionButtonsColumn name="iteration" id="action" title='<%= messages.getMessage("iterations.tableheading.actions") %>' > > > > - <xplanner:isUserAuthorized name="iteration" permission='<%= > > > action.getPermission()%>'> > > > + <xplanner:actionButtonsColumn name="iteration" > > > + id="action" > > > + title='<%= > > > messages.getMessage("iterations.tableheading.actions") %>'> > > > + <xplanner:isUserAuthorized name="iteration" > > > + permission='<%=action.getPermission()%>' > > > > > > + resourceType="system.project.iteration"> > > > <xplanner:action actionRenderer='<%=action%>' targetBean='<%=iteration%>' fkey='<%=iteration.getProjectId > > > > > > ()%>'/> > > > </xplanner:isUserAuthorized> > > > </xplanner:actionButtonsColumn> > > > <dt:column title='<%= messages.getMessage(" > > > > > > objects.tableheading.id") %>'> > > > <xplanner:link page="/do/view/iteration" paramId="oid" paramName="iteration" paramProperty="id"> > > > > > > <jsp:getProperty name="iteration" property="id"/></xplanner:link></dt:column> > > > - <dt:column sortable="true" sortProperty="name" title='<%= > > > messages.getMessage("iterations.tableheading.iteration") %>'> > > > - <xplanner:link styleClass="name" page="/do/view/iteration" paramId="oid" paramName="iteration" paramProperty="id"> > > > > > > + <dt:column sortable="true" > > > + sortProperty="name" > > > + title='<%= messages.getMessage("iterations.tableheading.iteration") %>'> > > > > > > + <xplanner:link styleClass="name" > > > + page="/do/view/iteration" > > > + paramId="oid" > > > + paramName="iteration" > > > > > > + paramProperty="id"> > > > <jsp:getProperty name="iteration" property="name"/></xplanner:link></dt:column> > > > > > > > > > - <dt:column sortable="true" sortProperty="startDate" title='<%= messages.getMessage("iterations.tableheading.startDate") %>'> > > > + <dt:column sortable="true" > > > > > > + sortProperty="startDate" > > > + title='<%= messages.getMessage("iterations.tableheading.startDate") %>'> > > > <xplanner:formatDate formatKey=" > > > format.date" name="iteration" property="startDate"/></dt:column> > > > - <dt:column sortable="true" sortProperty="endDate" title='<%= messages.getMessage > > > > > > ("iterations.tableheading.endDate") %>'> > > > + <dt:column sortable="true" > > > + sortProperty="endDate" > > > + title='<%= messages.getMessage > > > > > > ("iterations.tableheading.endDate") %>'> > > > <xplanner:formatDate formatKey="format.date" name="iteration" property="endDate"/></dt:column> > > > > > > - <dt:column sortable="true" sortProperty="daysWorked" title='<%= messages.getMessage("iterations.tableheading.days_worked") %>' align="right"> > > > > > > + <dt:column sortable="true" > > > + sortProperty="daysWorked" > > > + title='<%= messages.getMessage("iterations.tableheading.days_worked") %>' > > > > > > + align="right"> > > > <%= DecimalFormat.format(pageContext, iteration.getDaysWorked()) %></dt:column> > > > - <dt:column title='<%= > > > messages.getMessage("iterations.tableheading.stories") %>' align="right" > > > > + <dt:column title='<%= messages.getMessage("iterations.tableheading.stories") %>' align="right"> > > > > > > <%= iteration.getUserStories().size() %></dt:column> > > > </xplanner:writableTable> > > > </p> > > > @@ -68,20 +85,20 @@ > > > > > > > > > </p> > > > </logic:greaterThan> > > > > > > -<logic:equal name="iterationCount" value="0" > > > > +<logic:equal name="iterationCount" value="0"> > > > > > > <p class="highlighted_message"><bean:message key="iterations.none"/></p> > > > </logic:equal> > > > > > > -<tiles:put name="actions" direct="true" > > > > > > > +<tiles:put name="actions" direct="true"> > > > <xplanner:actionButtons > > > - name="project" id="action"> > > > + name="project" id="action"> > > > > > > <xplanner:isUserAuthorized name="project" permission='<%=action.getPermission()%>'> > > > <xplanner:link page='<%=action.getTargetPage()%>' paramId="oid" onclick='<%= > > > action.getOnclick()%>' > > > - paramName='<%=action.getDomainType()%>' paramProperty="id" useReturnto='<%=action.useReturnTo()%>'> > > > + paramName='<%= > > > action.getDomainType()%>' paramProperty="id" useReturnto='<%=action.useReturnTo()%>'> > > > <bean:message key='<%=action.getTitleKey()%>'/></xplanner:link> | > > > > > > </xplanner:isUserAuthorized> > > > </xplanner:actionButtons> > > > -<xplanner:isUserAuthorized resourceType="system.project.iteration" permission="create" > > > > > > > +<xplanner:isUserAuthorized resourceType="system.project.iteration" permission="create"> > > > <xplanner:link page="/do/edit/iteration"> > > > > > > > > > <bean:message key="project.link.create_iteration"/></xplanner:link> | > > > </xplanner:isUserAuthorized> > > > > > > > > > > > >