Author: maksimkaszynski
Date: 2008-02-11 13:12:10 -0500 (Mon, 11 Feb 2008)
New Revision: 6015
Added:
trunk/samples/jira-data/
trunk/samples/jira-data/pom.xml
trunk/samples/jira-data/src/
trunk/samples/jira-data/src/main/
trunk/samples/jira-data/src/main/java/
trunk/samples/jira-data/src/main/java/META-INF/
trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF
trunk/samples/jira-data/src/main/java/org/
trunk/samples/jira-data/src/main/java/org/richfaces/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/bean/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
trunk/samples/jira-data/src/main/resources/
trunk/samples/jira-data/src/main/resources/META-INF/
trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml
trunk/samples/jira-data/src/main/resources/jira-issues.jar
trunk/samples/jira-data/src/test/
trunk/samples/jira-data/src/test/java/
trunk/samples/jira-data/src/test/java/org/
trunk/samples/jira-data/src/test/java/org/richfaces/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java
Removed:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/lib/jira-issues.jar
Modified:
trunk/
trunk/samples/pom.xml
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
trunk/samples/scrollableDataTableDemo/pom.xml
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/
trunk/sandbox/samples/sortingFilteringDemo/pom.xml
trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF
Log:
refactored scrollable data table demo
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- .project
.checkstyle
target
+ .project
.checkstyle
target
.metadata
Property changes on: trunk/samples/jira-data
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.*
Added: trunk/samples/jira-data/pom.xml
===================================================================
--- trunk/samples/jira-data/pom.xml (rev 0)
+++ trunk/samples/jira-data/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -0,0 +1,20 @@
+<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">
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>jira-data</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>webapp Maven Webapp</name>
+ <dependencies>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/samples/jira-data/src/main/java/META-INF/MANIFEST.MF 2008-02-11 18:12:10 UTC
(rev 6015)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added:
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,309 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Channel.java,v
$
+ * $Revision: 1.8 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortOrder;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ * @modified by Anton Belevich
+ *
+ */
+public class Channel {
+
+ private static final Log log = LogFactory.getLog(Channel.class);
+
+ private static final Comparator<Issue> byIdDesc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o2.getIndex() - o1.getIndex();
+ }
+ };
+ private static final Comparator<Issue> byIdAsc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o1.getIndex() - o2.getIndex();
+ }
+ };
+
+ private static final Comparator<Issue> byPriAsc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o1.getPriority().getId() - o2.getPriority().getId();
+ }
+ };
+ private static final Comparator<Issue> byPriDesc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return o2.getPriority().getId() - o1.getPriority().getId();
+ }
+ };
+
+ private static final Comparator<JiraUser> jiraUserComparator = new
Comparator<JiraUser> () {
+ public int compare(JiraUser o1, JiraUser o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ };
+
+ private static final Comparator<Issue> byAssigneeAsc = new
Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return jiraUserComparator.compare(o1.getAssignee(), o2.getAssignee());
+ }
+ };
+ private static final Comparator<Issue> byAssigneeDesc = new
Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return -byAssigneeAsc.compare(o1, o2);
+ }
+ };
+
+ static final Comparator<Issue> byReporterAsc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return jiraUserComparator.compare(o1.getReporter(), o2.getReporter());
+ }
+ };
+ static final Comparator<Issue> byReporterDesc = new Comparator<Issue>(){
+ public int compare(Issue o1, Issue o2) {
+ return -byReporterAsc.compare(o1, o2);
+ }
+ };
+
+ static final Comparator<Issue> byStatusAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getStatus().getId() - o2.getStatus().getId();
+ };
+ };
+
+ static final Comparator<Issue> byStatusDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byStatusAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byKeyAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getKey().compareTo(o2.getKey());
+ };
+ };
+
+ static final Comparator<Issue> byKeyDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byKeyAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byResolutionDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -byResolutionAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> byResolutionAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getResolution().compareTo(o2.getResolution());
+ };
+ };
+
+ static final Comparator<Issue> bySummaryDesc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return -bySummaryAsc.compare(o1, o2);
+ };
+ };
+
+ static final Comparator<Issue> bySummaryAsc = new Comparator<Issue>() {
+ public int compare(Issue o1, Issue o2) {
+ return o1.getSummary().compareTo(o2.getSummary());
+ };
+ };
+
+
+ private List<Issue> issues = new ArrayList<Issue>();
+ private String title;
+ private String description;
+ private String link;
+ private String language;
+
+ private Map <Integer, Issue> index = new HashMap<Integer, Issue>();
+
+
+
+
+ public int size() {
+ return issues.size();
+ }
+
+ /**
+ * Execute query. Care for sorting
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @return
+ */
+ public List <Issue> executeQuery(int startRow, int endRow, SortOrder sortOrder) {
+ log.trace("Channel.executeQuery()");
+ List <Issue> copy = getIssues();
+ if (sortOrder != null) {
+ copy = new ArrayList<Issue>(getIssues());
+ Comparator<Issue> comparator = createComparator(sortOrder);
+ if (comparator != null) {
+ Collections.sort(copy, comparator);
+ }
+ }
+ List <Issue> issuz = new ArrayList<Issue>(endRow - startRow + 1);
+ for(int i = startRow; i < endRow; i++ ) {
+ issuz.add(copy.get(i));
+ }
+ return issuz;
+ }
+
+
+ /**
+ * @return the language
+ */
+ public String getLanguage() {
+ return language;
+ }
+ /**
+ * @param language the language to set
+ */
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ /**
+ * @return the link
+ */
+ public String getLink() {
+ return link;
+ }
+ /**
+ * @param link the link to set
+ */
+ public void setLink(String link) {
+ this.link = link;
+ }
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return the issues
+ */
+ public List<Issue> getIssues() {
+ return issues;
+ }
+ /**
+ * @param issues the issues to set
+ */
+ public void setIssues(List<Issue> issues) {
+ this.issues = issues;
+ }
+
+ public void addIssue(Issue issue) {
+ if (issues.size() > 5) {
+ return;
+ }
+ issues.add(issue);
+ index.put(issue.getIndex(), issue);
+ }
+ /**
+ * @return the index
+ */
+ public Map<Integer, Issue> getIndex() {
+ return index;
+ }
+ /**
+ * @param index the index to set
+ */
+ public void setIndex(Map<Integer, Issue> index) {
+ this.index = index;
+ }
+
+
+ protected Comparator <Issue> createComparator(SortOrder sortOrder) {
+
+ SortField [] fields = sortOrder.getFields();
+ if (fields != null && fields.length > 0) {
+ SortField field = fields[0];
+ int prop = field.getIndex();
+ boolean asc = field.getAscending().booleanValue();
+
+ switch (prop) {
+ case 0:
+ return asc ? byIdAsc : byIdDesc;
+ case 1:
+ return asc ? byKeyAsc : byKeyDesc;
+ case 2:
+ return asc ? bySummaryAsc : bySummaryDesc;
+ case 3:
+ return asc ? byAssigneeAsc : byAssigneeDesc;
+ case 4:
+ return asc ? byStatusAsc : byStatusDesc;
+ case 5:
+ return asc ? byReporterAsc : byReporterDesc;
+ case 6:
+ return asc ? byPriAsc: byPriDesc;
+ case 7:
+ return asc ? byResolutionAsc : byResolutionDesc;
+ }
+ }
+
+ return null;
+ }
+
+ public Issue findById(Integer id) {
+ return getIndex().get(id);
+ }
+
+ public Issue findIssueByKey(Object id) {
+
+ for (Issue issue : getIssues()) {
+ if (issue.getId().equals(id)) {
+ return issue;
+ }
+ }
+
+ return null;
+ }
+
+ public void replace(Integer id, List<Issue> list) {
+ Issue issue = issues.get(id.intValue());
+ issues.removeAll(list);
+ issues.addAll(issues.indexOf(issue)+1, list);
+ }
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,383 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Issue.java,v
$
+ * $Revision: 1.6 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Issue {
+ private static int issueIndex = 0;
+
+ private int index = ++issueIndex;
+
+ private String title;
+ private String link;
+ private String description;
+ private String environment;
+ private Key key;
+ private Type type;
+ private Priority priority;
+ private JiraUser assignee;
+ private JiraUser reporter;
+ private String summary;
+ private Status status;
+ private String resolution;
+ private String created;
+ private String updated;
+ private String version;
+ private String component;
+ private String due;
+ private String votes;
+ private String customfields;
+
+ //TODO: provide correct mapping
+ private String comments;
+ private String fixVersion;
+ private String timeestimate;
+ private String timespent;
+
+ //TODO: provide correct mapping
+ private String issuelinks;
+
+ private String timeoriginalestimate;
+
+ /**
+ * @return the timeoriginalestimate
+ */
+ public String getTimeoriginalestimate() {
+ return timeoriginalestimate;
+ }
+ /**
+ * @param timeoriginalestimate the timeoriginalestimate to set
+ */
+ public void setTimeoriginalestimate(String timeoriginalestimate) {
+ this.timeoriginalestimate = timeoriginalestimate;
+ }
+ /**
+ * @return the timespent
+ */
+ public String getTimespent() {
+ return timespent;
+ }
+ /**
+ * @param timespent the timespent to set
+ */
+ public void setTimespent(String timespent) {
+ this.timespent = timespent;
+ }
+ /**
+ * @return the comments
+ */
+ public String getComments() {
+ return comments;
+ }
+ /**
+ * @param comments the comments to set
+ */
+ public void setComments(String comments) {
+ this.comments = comments;
+ }
+ /**
+ * @return the customfields
+ */
+ public String getCustomfields() {
+ return customfields;
+ }
+ /**
+ * @param customfields the customfields to set
+ */
+ public void setCustomfields(String customfields) {
+ this.customfields = customfields;
+ }
+ /**
+ * @return the votes
+ */
+ public String getVotes() {
+ return votes;
+ }
+ /**
+ * @param votes the votes to set
+ */
+ public void setVotes(String votes) {
+ this.votes = votes;
+ }
+ /**
+ * @return the due
+ */
+ public String getDue() {
+ return due;
+ }
+ /**
+ * @param due the due to set
+ */
+ public void setDue(String due) {
+ this.due = due;
+ }
+ /**
+ * @return the component
+ */
+ public String getComponent() {
+ return component;
+ }
+ /**
+ * @param component the component to set
+ */
+ public void setComponent(String component) {
+ this.component = component;
+ }
+ /**
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+ /**
+ * @param version the version to set
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+ /**
+ * @return the created
+ */
+ public String getCreated() {
+ return created;
+ }
+ /**
+ * @param created the created to set
+ */
+ public void setCreated(String created) {
+ this.created = created;
+ }
+ /**
+ * @return the updated
+ */
+ public String getUpdated() {
+ return updated;
+ }
+ /**
+ * @param updated the updated to set
+ */
+ public void setUpdated(String updated) {
+ this.updated = updated;
+ }
+ /**
+ * @return the resolution
+ */
+ public String getResolution() {
+ return resolution;
+ }
+ /**
+ * @param resolution the resolution to set
+ */
+ public void setResolution(String resolution) {
+ this.resolution = resolution;
+ }
+ /**
+ * @return the status
+ */
+ public Status getStatus() {
+ return status;
+ }
+ /**
+ * @param status the status to set
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+ /**
+ * @return the summary
+ */
+ public String getSummary() {
+ return summary;
+ }
+ /**
+ * @param summary the summary to set
+ */
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+ /**
+ * @return the assignee
+ */
+ public JiraUser getAssignee() {
+ return assignee;
+ }
+ /**
+ * @param assignee the assignee to set
+ */
+ public void setAssignee(JiraUser assignee) {
+ this.assignee = assignee;
+ }
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ /*if (description != null && description.length() > 2000) {
+ description = description.substring(0, 2000);
+ }*/
+ this.description = description;
+ }
+ /**
+ * @return the environment
+ */
+ public String getEnvironment() {
+ return environment;
+ }
+ /**
+ * @param environment the environment to set
+ */
+ public void setEnvironment(String environment) {
+ this.environment = environment;
+ }
+ /**
+ * @return the key
+ */
+ public Key getKey() {
+ return key;
+ }
+ /**
+ * @param key the key to set
+ */
+ public void setKey(Key key) {
+ this.key = key;
+ }
+ /**
+ * @return the link
+ */
+ public String getLink() {
+ return link;
+ }
+ /**
+ * @param link the link to set
+ */
+ public void setLink(String link) {
+ this.link = link;
+ }
+ /**
+ * @return the priority
+ */
+ public Priority getPriority() {
+ return priority;
+ }
+ /**
+ * @param priority the priority to set
+ */
+ public void setPriority(Priority priority) {
+ this.priority = priority;
+ }
+ /**
+ * @return the reporter
+ */
+ public JiraUser getReporter() {
+ return reporter;
+ }
+ /**
+ * @param reporter the reporter to set
+ */
+ public void setReporter(JiraUser reporter) {
+ this.reporter = reporter;
+ }
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return the type
+ */
+ public Type getType() {
+ return type;
+ }
+ /**
+ * @param type the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+ /**
+ * @return the fixVersion
+ */
+ public String getFixVersion() {
+ return fixVersion;
+ }
+ /**
+ * @param fixVersion the fixVersion to set
+ */
+ public void setFixVersion(String fixVersion) {
+ this.fixVersion = fixVersion;
+ }
+ /**
+ * @return the timeestimate
+ */
+ public String getTimeestimate() {
+ return timeestimate;
+ }
+ /**
+ * @param timeestimate the timeestimate to set
+ */
+ public void setTimeestimate(String timeestimate) {
+ this.timeestimate = timeestimate;
+ }
+ /**
+ * @return the issuelinks
+ */
+ public String getIssuelinks() {
+ return issuelinks;
+ }
+ /**
+ * @param issuelinks the issuelinks to set
+ */
+ public void setIssuelinks(String issuelinks) {
+ this.issuelinks = issuelinks;
+ }
+ /**
+ * @return the index
+ */
+ public int getIndex() {
+ return (index);
+ }
+ /**
+ * @param index the index to set
+ */
+ public void setIndex(int index) {
+ this.index = index;
+ }
+ /**
+ * @return
+ * @see com.exadel.jsf.demo.datagrid.model.Priority#getId()
+ */
+ public int getPriorityId() {
+ return getPriority().getId();
+ }
+
+ public Serializable getId() {
+ // TODO Auto-generated method stub
+ return getKey();
+ }
+
+}
Added:
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,45 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/JiraUser.java,v
$
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JiraUser {
+ private String username;
+ private String name;
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return username;
+ }
+ /**
+ * @param username the username to set
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Key.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,71 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Key.java,v
$
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Key implements Comparable<Key>, Serializable{
+ private int id;
+ private String value;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Key o) {
+ return id - o.id;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Key) {
+ return ((Key) obj).id == id;
+ }
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return id;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(id);
+ }
+}
Added:
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Priority.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,64 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Priority.java,v
$
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Priority {
+ private int id;
+ private String name;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Priority) {
+ Priority priority = (Priority) obj;
+ return priority.id == id;
+ }
+ return false;
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return id;
+ }
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Rss.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,19 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Rss.java,v
$
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Rss {
+
+}
Added:
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Status.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,64 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Status.java,v
$
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Status {
+ private String name;
+ private int id;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Status) {
+ Status status = (Status) obj;
+ return status.id == id;
+ }
+ return false;
+ }
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return id;
+ }
+
+}
Added: trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java
===================================================================
--- trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/model/Type.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,44 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Type.java,v
$
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.demo.datagrid.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Type {
+ private int id;
+ private String name;
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added:
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
===================================================================
---
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
(rev 0)
+++
trunk/samples/jira-data/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,192 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/service/JiraService.java,v
$
+ * $Revision: 1.5 $
+ */
+
+package org.richfaces.demo.datagrid.service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.ExtendedBaseRules;
+import org.apache.commons.digester.Rule;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.demo.datagrid.model.Channel;
+import org.richfaces.demo.datagrid.model.Issue;
+import org.richfaces.demo.datagrid.model.JiraUser;
+import org.richfaces.demo.datagrid.model.Key;
+import org.richfaces.demo.datagrid.model.Priority;
+import org.richfaces.demo.datagrid.model.Status;
+import org.richfaces.demo.datagrid.model.Type;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JiraService {
+
+ private static final String KEY = "jiraService";
+
+ private static final Log log = LogFactory.getLog(JiraService.class);
+
+ /**
+ *
+ */
+ public JiraService() {
+ super();
+ log.trace("---> JiraService.JiraService()");
+ init();
+ }
+
+ private Channel channel = null;
+ public Channel getChannel() {
+
+ if (channel == null) {
+ init();
+ }
+
+ return channel;
+ }
+ public void setChannel(Channel channel) {
+ this.channel = channel;
+ }
+
+
+ static class JiraCursedRule extends Rule {
+
+ private String propertyName;
+
+ public JiraCursedRule(String propertyName) {
+ super();
+ this.propertyName = propertyName;
+ }
+
+ @Override
+ public void body(String namespace, String name, String text) throws Exception {
+ Object bean = digester.peek();
+ PropertyUtils.setSimpleProperty(bean, propertyName, text.trim());
+
+ }
+
+ @Override
+ public void finish() throws Exception {
+ // TODO Auto-generated method stub
+ super.finish();
+ }
+ }
+
+
+ private void init() {
+ System.out.println("JiraService.init()");
+ channel = new Channel();
+ Digester digester = new Digester();
+ digester.setValidating(false);
+ digester.setNamespaceAware(false);
+ digester.setEntityResolver(new EntityResolver() {
+ public InputSource resolveEntity(String publicId, String systemId) throws
SAXException, IOException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ });
+ digester.setRules(new ExtendedBaseRules());
+
+ digester.push(channel);
+
+ String path = "rss/channel";
+ digester.addBeanPropertySetter(path + "/?");
+
+ path = path + "/item";
+ String issuePath = path;
+ digester.addObjectCreate(path, Issue.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetNext(path, "addIssue");
+
+ path = issuePath + "/key";
+ digester.addObjectCreate(path, Key.class);
+ digester.addSetProperties(path);
+ digester.addRule(path, new JiraCursedRule("value"));
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetNext(path, "setKey");
+
+ path = issuePath + "/priority";
+ digester.addObjectCreate(path, Priority.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setPriority");
+
+ path = issuePath + "/status";
+ digester.addObjectCreate(path, Status.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setStatus");
+
+ path = issuePath + "/assignee";
+ digester.addObjectCreate(path, JiraUser.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setAssignee");
+
+ path = issuePath + "/reporter";
+ digester.addObjectCreate(path, JiraUser.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setReporter");
+
+ path = issuePath + "/type";
+ digester.addObjectCreate(path, Type.class);
+ digester.addSetProperties(path);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addRule(path, new JiraCursedRule("name"));
+ digester.addSetNext(path, "setType");
+ try {
+ //InputStream stream; //=
Thread.currentThread().getContextClassLoader().getResourceAsStream();
+ //stream =
FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/WEB-INF/xmldata/jira.xml");
+ //JarInputStream stream = getXMLInputStream();
+ InputStream stream =
Thread.currentThread().getContextClassLoader().getResourceAsStream("jira-issues.jar");
+ JarInputStream jarInputStream = new JarInputStream(stream);
+ JarEntry entry = null;
+
+ while((entry = jarInputStream.getNextJarEntry()) != null) {
+ String name = entry.getName();
+ if ("jira.xml".equals(name)) {
+ digester.parse(jarInputStream);
+ break;
+ }
+ }
+ jarInputStream.close();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public static final JiraService getInstance() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ELContext elContext = facesContext.getELContext();
+ ELResolver resolver = elContext.getELResolver();
+ Object value = resolver.getValue(elContext, null, KEY);
+ return (JiraService) value;
+ }
+}
Added: trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml
===================================================================
--- trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml
(rev 0)
+++ trunk/samples/jira-data/src/main/resources/META-INF/faces-config.xml 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.1//EN"
+
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>jiraService</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.datagrid.service.JiraService</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+</faces-config>
\ No newline at end of file
Added: trunk/samples/jira-data/src/main/resources/jira-issues.jar
===================================================================
(Binary files differ)
Property changes on: trunk/samples/jira-data/src/main/resources/jira-issues.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java
===================================================================
---
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java
(rev 0)
+++
trunk/samples/jira-data/src/test/java/org/richfaces/demo/datagrid/service/JiraServiceTest.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -0,0 +1,35 @@
+package org.richfaces.demo.datagrid.service;
+
+import org.richfaces.demo.datagrid.model.Channel;
+import org.richfaces.demo.datagrid.service.JiraService;
+
+import junit.framework.TestCase;
+
+public class JiraServiceTest extends TestCase {
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testJiraService() {
+ //fail("Not yet implemented");
+ }
+
+ public void testGetChannel() {
+ Channel channel = new JiraService().getChannel();
+ assertNotNull(channel);
+ }
+
+ public void testSetChannel() {
+ //fail("Not yet implemented");
+ }
+
+ public void testGetInstance() {
+ //fail("Not yet implemented");
+ }
+
+}
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -463,6 +463,7 @@
<module>combobox-sample</module>
<module>pickList-sample</module>
<module>progressBarDemo</module>
+ <module>jira-data</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-02-11 18:07:41 UTC
(rev 6014)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-02-11 18:12:10 UTC
(rev 6015)
@@ -43,14 +43,14 @@
<param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
<param-value>NEKO</param-value>
</context-param>
- <context-param>
+ <!--context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
- </context-param>
+ </context-param-->
<filter>
<display-name>Ajax4jsf Filter</display-name>
Modified: trunk/samples/scrollableDataTableDemo/pom.xml
===================================================================
--- trunk/samples/scrollableDataTableDemo/pom.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/samples/scrollableDataTableDemo/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -23,6 +23,11 @@
<artifactId>skins</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>jira-data</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>core</artifactId>
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,309 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Channel.java,v
$
- * $Revision: 1.8 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.richfaces.model.SortField;
-import org.richfaces.model.SortOrder;
-
-
-
-/**
- * @author Maksim Kaszynski
- * @modified by Anton Belevich
- *
- */
-public class Channel {
-
- private static final Log log = LogFactory.getLog(Channel.class);
-
- private static final Comparator<Issue> byIdDesc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o2.getIndex() - o1.getIndex();
- }
- };
- private static final Comparator<Issue> byIdAsc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o1.getIndex() - o2.getIndex();
- }
- };
-
- private static final Comparator<Issue> byPriAsc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o1.getPriority().getId() - o2.getPriority().getId();
- }
- };
- private static final Comparator<Issue> byPriDesc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return o2.getPriority().getId() - o1.getPriority().getId();
- }
- };
-
- private static final Comparator<JiraUser> jiraUserComparator = new
Comparator<JiraUser> () {
- public int compare(JiraUser o1, JiraUser o2) {
- return o1.getName().compareTo(o2.getName());
- }
- };
-
- private static final Comparator<Issue> byAssigneeAsc = new
Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return jiraUserComparator.compare(o1.getAssignee(), o2.getAssignee());
- }
- };
- private static final Comparator<Issue> byAssigneeDesc = new
Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return -byAssigneeAsc.compare(o1, o2);
- }
- };
-
- static final Comparator<Issue> byReporterAsc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return jiraUserComparator.compare(o1.getReporter(), o2.getReporter());
- }
- };
- static final Comparator<Issue> byReporterDesc = new Comparator<Issue>(){
- public int compare(Issue o1, Issue o2) {
- return -byReporterAsc.compare(o1, o2);
- }
- };
-
- static final Comparator<Issue> byStatusAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getStatus().getId() - o2.getStatus().getId();
- };
- };
-
- static final Comparator<Issue> byStatusDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -byStatusAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> byKeyAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getKey().compareTo(o2.getKey());
- };
- };
-
- static final Comparator<Issue> byKeyDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -byKeyAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> byResolutionDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -byResolutionAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> byResolutionAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getResolution().compareTo(o2.getResolution());
- };
- };
-
- static final Comparator<Issue> bySummaryDesc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return -bySummaryAsc.compare(o1, o2);
- };
- };
-
- static final Comparator<Issue> bySummaryAsc = new Comparator<Issue>() {
- public int compare(Issue o1, Issue o2) {
- return o1.getSummary().compareTo(o2.getSummary());
- };
- };
-
-
- private List<Issue> issues = new ArrayList<Issue>();
- private String title;
- private String description;
- private String link;
- private String language;
-
- private Map <Integer, Issue> index = new HashMap<Integer, Issue>();
-
-
-
-
- public int size() {
- return issues.size();
- }
-
- /**
- * Execute query. Care for sorting
- * @param startRow
- * @param endRow
- * @param sortOrder
- * @return
- */
- public List <Issue> executeQuery(int startRow, int endRow, SortOrder sortOrder) {
- log.trace("Channel.executeQuery()");
- List <Issue> copy = getIssues();
- if (sortOrder != null) {
- copy = new ArrayList<Issue>(getIssues());
- Comparator<Issue> comparator = createComparator(sortOrder);
- if (comparator != null) {
- Collections.sort(copy, comparator);
- }
- }
- List <Issue> issuz = new ArrayList<Issue>(endRow - startRow + 1);
- for(int i = startRow; i < endRow; i++ ) {
- issuz.add(copy.get(i));
- }
- return issuz;
- }
-
-
- /**
- * @return the language
- */
- public String getLanguage() {
- return language;
- }
- /**
- * @param language the language to set
- */
- public void setLanguage(String language) {
- this.language = language;
- }
- /**
- * @return the description
- */
- public String getDescription() {
- return description;
- }
- /**
- * @param description the description to set
- */
- public void setDescription(String description) {
- this.description = description;
- }
- /**
- * @return the link
- */
- public String getLink() {
- return link;
- }
- /**
- * @param link the link to set
- */
- public void setLink(String link) {
- this.link = link;
- }
- /**
- * @return the title
- */
- public String getTitle() {
- return title;
- }
- /**
- * @param title the title to set
- */
- public void setTitle(String title) {
- this.title = title;
- }
- /**
- * @return the issues
- */
- public List<Issue> getIssues() {
- return issues;
- }
- /**
- * @param issues the issues to set
- */
- public void setIssues(List<Issue> issues) {
- this.issues = issues;
- }
-
- public void addIssue(Issue issue) {
- if (issues.size() > 5) {
- return;
- }
- issues.add(issue);
- index.put(issue.getIndex(), issue);
- }
- /**
- * @return the index
- */
- public Map<Integer, Issue> getIndex() {
- return index;
- }
- /**
- * @param index the index to set
- */
- public void setIndex(Map<Integer, Issue> index) {
- this.index = index;
- }
-
-
- protected Comparator <Issue> createComparator(SortOrder sortOrder) {
-
- SortField [] fields = sortOrder.getFields();
- if (fields != null && fields.length > 0) {
- SortField field = fields[0];
- int prop = field.getIndex();
- boolean asc = field.getAscending().booleanValue();
-
- switch (prop) {
- case 0:
- return asc ? byIdAsc : byIdDesc;
- case 1:
- return asc ? byKeyAsc : byKeyDesc;
- case 2:
- return asc ? bySummaryAsc : bySummaryDesc;
- case 3:
- return asc ? byAssigneeAsc : byAssigneeDesc;
- case 4:
- return asc ? byStatusAsc : byStatusDesc;
- case 5:
- return asc ? byReporterAsc : byReporterDesc;
- case 6:
- return asc ? byPriAsc: byPriDesc;
- case 7:
- return asc ? byResolutionAsc : byResolutionDesc;
- }
- }
-
- return null;
- }
-
- public Issue findById(Integer id) {
- return getIndex().get(id);
- }
-
- public Issue findIssueByKey(Object id) {
-
- for (Issue issue : getIssues()) {
- if (issue.getId().equals(id)) {
- return issue;
- }
- }
-
- return null;
- }
-
- public void replace(Integer id, List<Issue> list) {
- Issue issue = issues.get(id.intValue());
- issues.removeAll(list);
- issues.addAll(issues.indexOf(issue)+1, list);
- }
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,383 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Issue.java,v
$
- * $Revision: 1.6 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-import java.io.Serializable;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Issue {
- private static int issueIndex = 0;
-
- private int index = ++issueIndex;
-
- private String title;
- private String link;
- private String description;
- private String environment;
- private Key key;
- private Type type;
- private Priority priority;
- private JiraUser assignee;
- private JiraUser reporter;
- private String summary;
- private Status status;
- private String resolution;
- private String created;
- private String updated;
- private String version;
- private String component;
- private String due;
- private String votes;
- private String customfields;
-
- //TODO: provide correct mapping
- private String comments;
- private String fixVersion;
- private String timeestimate;
- private String timespent;
-
- //TODO: provide correct mapping
- private String issuelinks;
-
- private String timeoriginalestimate;
-
- /**
- * @return the timeoriginalestimate
- */
- public String getTimeoriginalestimate() {
- return timeoriginalestimate;
- }
- /**
- * @param timeoriginalestimate the timeoriginalestimate to set
- */
- public void setTimeoriginalestimate(String timeoriginalestimate) {
- this.timeoriginalestimate = timeoriginalestimate;
- }
- /**
- * @return the timespent
- */
- public String getTimespent() {
- return timespent;
- }
- /**
- * @param timespent the timespent to set
- */
- public void setTimespent(String timespent) {
- this.timespent = timespent;
- }
- /**
- * @return the comments
- */
- public String getComments() {
- return comments;
- }
- /**
- * @param comments the comments to set
- */
- public void setComments(String comments) {
- this.comments = comments;
- }
- /**
- * @return the customfields
- */
- public String getCustomfields() {
- return customfields;
- }
- /**
- * @param customfields the customfields to set
- */
- public void setCustomfields(String customfields) {
- this.customfields = customfields;
- }
- /**
- * @return the votes
- */
- public String getVotes() {
- return votes;
- }
- /**
- * @param votes the votes to set
- */
- public void setVotes(String votes) {
- this.votes = votes;
- }
- /**
- * @return the due
- */
- public String getDue() {
- return due;
- }
- /**
- * @param due the due to set
- */
- public void setDue(String due) {
- this.due = due;
- }
- /**
- * @return the component
- */
- public String getComponent() {
- return component;
- }
- /**
- * @param component the component to set
- */
- public void setComponent(String component) {
- this.component = component;
- }
- /**
- * @return the version
- */
- public String getVersion() {
- return version;
- }
- /**
- * @param version the version to set
- */
- public void setVersion(String version) {
- this.version = version;
- }
- /**
- * @return the created
- */
- public String getCreated() {
- return created;
- }
- /**
- * @param created the created to set
- */
- public void setCreated(String created) {
- this.created = created;
- }
- /**
- * @return the updated
- */
- public String getUpdated() {
- return updated;
- }
- /**
- * @param updated the updated to set
- */
- public void setUpdated(String updated) {
- this.updated = updated;
- }
- /**
- * @return the resolution
- */
- public String getResolution() {
- return resolution;
- }
- /**
- * @param resolution the resolution to set
- */
- public void setResolution(String resolution) {
- this.resolution = resolution;
- }
- /**
- * @return the status
- */
- public Status getStatus() {
- return status;
- }
- /**
- * @param status the status to set
- */
- public void setStatus(Status status) {
- this.status = status;
- }
- /**
- * @return the summary
- */
- public String getSummary() {
- return summary;
- }
- /**
- * @param summary the summary to set
- */
- public void setSummary(String summary) {
- this.summary = summary;
- }
- /**
- * @return the assignee
- */
- public JiraUser getAssignee() {
- return assignee;
- }
- /**
- * @param assignee the assignee to set
- */
- public void setAssignee(JiraUser assignee) {
- this.assignee = assignee;
- }
- /**
- * @return the description
- */
- public String getDescription() {
- return description;
- }
- /**
- * @param description the description to set
- */
- public void setDescription(String description) {
- /*if (description != null && description.length() > 2000) {
- description = description.substring(0, 2000);
- }*/
- this.description = description;
- }
- /**
- * @return the environment
- */
- public String getEnvironment() {
- return environment;
- }
- /**
- * @param environment the environment to set
- */
- public void setEnvironment(String environment) {
- this.environment = environment;
- }
- /**
- * @return the key
- */
- public Key getKey() {
- return key;
- }
- /**
- * @param key the key to set
- */
- public void setKey(Key key) {
- this.key = key;
- }
- /**
- * @return the link
- */
- public String getLink() {
- return link;
- }
- /**
- * @param link the link to set
- */
- public void setLink(String link) {
- this.link = link;
- }
- /**
- * @return the priority
- */
- public Priority getPriority() {
- return priority;
- }
- /**
- * @param priority the priority to set
- */
- public void setPriority(Priority priority) {
- this.priority = priority;
- }
- /**
- * @return the reporter
- */
- public JiraUser getReporter() {
- return reporter;
- }
- /**
- * @param reporter the reporter to set
- */
- public void setReporter(JiraUser reporter) {
- this.reporter = reporter;
- }
- /**
- * @return the title
- */
- public String getTitle() {
- return title;
- }
- /**
- * @param title the title to set
- */
- public void setTitle(String title) {
- this.title = title;
- }
- /**
- * @return the type
- */
- public Type getType() {
- return type;
- }
- /**
- * @param type the type to set
- */
- public void setType(Type type) {
- this.type = type;
- }
- /**
- * @return the fixVersion
- */
- public String getFixVersion() {
- return fixVersion;
- }
- /**
- * @param fixVersion the fixVersion to set
- */
- public void setFixVersion(String fixVersion) {
- this.fixVersion = fixVersion;
- }
- /**
- * @return the timeestimate
- */
- public String getTimeestimate() {
- return timeestimate;
- }
- /**
- * @param timeestimate the timeestimate to set
- */
- public void setTimeestimate(String timeestimate) {
- this.timeestimate = timeestimate;
- }
- /**
- * @return the issuelinks
- */
- public String getIssuelinks() {
- return issuelinks;
- }
- /**
- * @param issuelinks the issuelinks to set
- */
- public void setIssuelinks(String issuelinks) {
- this.issuelinks = issuelinks;
- }
- /**
- * @return the index
- */
- public int getIndex() {
- return (index-1001);
- }
- /**
- * @param index the index to set
- */
- public void setIndex(int index) {
- this.index = index;
- }
- /**
- * @return
- * @see com.exadel.jsf.demo.datagrid.model.Priority#getId()
- */
- public int getPriorityId() {
- return getPriority().getId();
- }
-
- public Serializable getId() {
- // TODO Auto-generated method stub
- return getKey();
- }
-
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/JiraUser.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,45 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/JiraUser.java,v
$
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class JiraUser {
- private String username;
- private String name;
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
- /**
- * @return the username
- */
- public String getUsername() {
- return username;
- }
- /**
- * @param username the username to set
- */
- public void setUsername(String username) {
- this.username = username;
- }
-
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Key.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,71 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Key.java,v
$
- * $Revision: 1.2 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-import java.io.Serializable;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Key implements Comparable<Key>, Serializable{
- private int id;
- private String value;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Key o) {
- return id - o.id;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof Key) {
- return ((Key) obj).id == id;
- }
- return super.equals(obj);
- }
-
- @Override
- public int hashCode() {
- return id;
- }
-
- @Override
- public String toString() {
- return String.valueOf(id);
- }
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Priority.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,64 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Priority.java,v
$
- * $Revision: 1.2 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Priority {
- private int id;
- private String name;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof Priority) {
- Priority priority = (Priority) obj;
- return priority.id == id;
- }
- return false;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return id;
- }
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Rss.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,19 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Rss.java,v
$
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Rss {
-
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Status.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,64 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Status.java,v
$
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Status {
- private String name;
- private int id;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof Status) {
- Status status = (Status) obj;
- return status.id == id;
- }
- return false;
- }
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return id;
- }
-
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/model/Type.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,44 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/model/Type.java,v
$
- * $Revision: 1.1 $
- */
-
-package org.richfaces.demo.datagrid.model;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class Type {
- private int id;
- private String name;
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-}
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/java/org/richfaces/demo/datagrid/service/JiraService.java 2008-02-11
18:12:10 UTC (rev 6015)
@@ -1,175 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/service/JiraService.java,v
$
- * $Revision: 1.5 $
- */
-
-package org.richfaces.demo.datagrid.service;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.digester.Digester;
-import org.apache.commons.digester.ExtendedBaseRules;
-import org.apache.commons.digester.Rule;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.richfaces.demo.datagrid.model.Channel;
-import org.richfaces.demo.datagrid.model.Issue;
-import org.richfaces.demo.datagrid.model.JiraUser;
-import org.richfaces.demo.datagrid.model.Key;
-import org.richfaces.demo.datagrid.model.Priority;
-import org.richfaces.demo.datagrid.model.Status;
-import org.richfaces.demo.datagrid.model.Type;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class JiraService {
-
- private static final String KEY = "jiraService";
-
- private static final Log log = LogFactory.getLog(JiraService.class);
-
- private static final JiraService instance = new JiraService();
-
- /**
- *
- */
- public JiraService() {
- super();
- log.trace("---> JiraService.JiraService()");
- init();
- }
-
- private Channel channel = null;
- public Channel getChannel() {
-
- if (channel == null) {
- init();
- }
-
- return channel;
- }
- public void setChannel(Channel channel) {
- this.channel = channel;
- }
-
-
- static class JiraCursedRule extends Rule {
-
- private String propertyName;
-
- public JiraCursedRule(String propertyName) {
- super();
- this.propertyName = propertyName;
- }
-
- @Override
- public void body(String namespace, String name, String text) throws Exception {
- Object bean = digester.peek();
- PropertyUtils.setSimpleProperty(bean, propertyName, text.trim());
-
- }
-
- @Override
- public void finish() throws Exception {
- // TODO Auto-generated method stub
- super.finish();
- }
- }
-
-
- private void init() {
- System.out.println("JiraService.init()");
- channel = new Channel();
- Digester digester = new Digester();
- digester.setValidating(false);
- digester.setNamespaceAware(false);
- digester.setEntityResolver(new EntityResolver() {
- public InputSource resolveEntity(String publicId, String systemId) throws
SAXException, IOException {
- // TODO Auto-generated method stub
- return null;
- }
- });
- digester.setRules(new ExtendedBaseRules());
-
- digester.push(channel);
-
- String path = "rss/channel";
- digester.addBeanPropertySetter(path + "/?");
-
- path = path + "/item";
- String issuePath = path;
- digester.addObjectCreate(path, Issue.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetNext(path, "addIssue");
-
- path = issuePath + "/key";
- digester.addObjectCreate(path, Key.class);
- digester.addSetProperties(path);
- digester.addRule(path, new JiraCursedRule("value"));
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetNext(path, "setKey");
-
- path = issuePath + "/priority";
- digester.addObjectCreate(path, Priority.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setPriority");
-
- path = issuePath + "/status";
- digester.addObjectCreate(path, Status.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setStatus");
-
- path = issuePath + "/assignee";
- digester.addObjectCreate(path, JiraUser.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setAssignee");
-
- path = issuePath + "/reporter";
- digester.addObjectCreate(path, JiraUser.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setReporter");
-
- path = issuePath + "/type";
- digester.addObjectCreate(path, Type.class);
- digester.addSetProperties(path);
- digester.addBeanPropertySetter(path + "/?");
- digester.addRule(path, new JiraCursedRule("name"));
- digester.addSetNext(path, "setType");
- try {
- //InputStream stream; //=
Thread.currentThread().getContextClassLoader().getResourceAsStream();
- //stream =
FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/WEB-INF/xmldata/jira.xml");
- //JarInputStream stream = getXMLInputStream();
- InputStream stream =
Thread.currentThread().getContextClassLoader().getResourceAsStream("jira.xml");
- digester.parse(stream);
- stream.close();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- public static final JiraService getInstance() {
- return instance;
- }
-}
Modified: trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-11
18:07:41 UTC (rev 6014)
+++
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-11
18:12:10 UTC (rev 6015)
@@ -197,11 +197,11 @@
</managed-bean>
- <managed-bean>
+ <!--managed-bean>
<managed-bean-name>jiraService</managed-bean-name>
<managed-bean-class>org.richfaces.demo.datagrid.service.JiraService</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
+ </managed-bean-->
<managed-bean>
<managed-bean-name>dataModel2</managed-bean-name>
Deleted:
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/lib/jira-issues.jar
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples
___________________________________________________________________
Name: svn:ignore
- target
+ target
combobox-sample
Modified: trunk/sandbox/samples/sortingFilteringDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/sortingFilteringDemo/pom.xml 2008-02-11 18:07:41 UTC (rev 6014)
+++ trunk/sandbox/samples/sortingFilteringDemo/pom.xml 2008-02-11 18:12:10 UTC (rev 6015)
@@ -29,5 +29,15 @@
<artifactId>dataTable</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>skins</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>jira-data</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-02-11
18:07:41 UTC (rev 6014)
+++ trunk/sandbox/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-02-11
18:12:10 UTC (rev 6015)
@@ -8,14 +8,31 @@
</head>
<body>
<f:view>
- <dt:dataTable value="" >
- <dt:column sortable="true" sortExpression="">
+ <dt:dataTable value="#{jiraService.issues}" var="issue">
+ <dt:column>
<f:facet name="header">
- <h:outputText value=""></h:outputText>
+ <h:outputText value="Key"></h:outputText>
</f:facet>
+ <h:outputText value="#{issue.key}"></h:outputText>
</dt:column>
- <dt:column sortable="">
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="Summary"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{issue.summary}"></h:outputText>
</dt:column>
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="Assignee"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{issue.assignee.name}"></h:outputText>
+ </dt:column>
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="Reporter"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{issue.assignee.name}"></h:outputText>
+ </dt:column>
</dt:dataTable>
</f:view>
</body>
Modified: trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF 2008-02-11 18:07:41
UTC (rev 6014)
+++ trunk/ui/scrollableDataTable/src/main/java/META-INF/MANIFEST.MF 2008-02-11 18:12:10
UTC (rev 6015)
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
-Class-Path: