Author: blabno
Date: 2011-04-15 09:42:33 -0400 (Fri, 15 Apr 2011)
New Revision: 22424
Added:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java
Removed:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml
Modified:
sandbox/trunk/ui/schedule/bom/pom.xml
sandbox/trunk/ui/schedule/demo/pom.xml
sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml
sandbox/trunk/ui/schedule/parent/pom.xml
sandbox/trunk/ui/schedule/pom.xml
sandbox/trunk/ui/schedule/ui/pom.xml
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js
sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml
Log:
Updated schedule component to RF-4.1-SNAPSHOT.
Fixed most of the issues.
Modified: sandbox/trunk/ui/schedule/bom/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/bom/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/bom/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
Inc. and individual contributors by the @authors tag. See the
copyright.txt in the distribution for a full listing of
@@ -23,58 +22,35 @@
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>7</version>
- </parent>
-
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-bom</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-bom</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
<name>Richfaces UI Components: schedule bom</name>
<packaging>pom</packaging>
- <properties>
- <org.richfaces.version>4.0.0-SNAPSHOT</org.richfaces.version>
- </properties>
-
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
- <version>${org.richfaces.version}</version>
+ <version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>richfaces-ui-schedule-ui</artifactId>
+ <artifactId>schedule-ui</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>richfaces-ui-schedule-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>richfaces-ui-schedule-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>functions-ui</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui.notify</groupId>
- <artifactId>richfaces-ui-notify-ui</artifactId>
- <version>${project.version}</version>
- </dependency>
</dependencies>
</dependencyManagement>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+
<url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
</project>
Modified: sandbox/trunk/ui/schedule/demo/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/demo/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,19 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
-
xmlns="http://maven.apache.org/POM/4.0.0"
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
<artifactId>schedule-demo</artifactId>
- <version>4.0.0-SNAPSHOT</version>
<name>Richfaces UI Components: schedule demo</name>
<packaging>war</packaging>
<build>
@@ -29,45 +26,35 @@
</plugins>
</build>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-bom</artifactId>
- <version>${version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
<dependencies>
<dependency>
- <groupId>org.richfaces.ui.core</groupId>
- <artifactId>richfaces-ui-core-ui</artifactId>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-ui</artifactId>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>richfaces-ui-misc-ui</artifactId>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-ui</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.notify</groupId>
- <artifactId>richfaces-ui-notify-ui</artifactId>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>compile</scope>
</dependency>
-
<dependency>
- <groupId>${jsf2.api.groupid}</groupId>
- <artifactId>${jsf2.api.artifactid}</artifactId>
- <scope>provided</scope>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>${jsf2.impl.groupid}</groupId>
- <artifactId>${jsf2.impl.artifactid}</artifactId>
- <scope>provided</scope>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.0</version>
</dependency>
</dependencies>
</project>
Modified: sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java
===================================================================
---
sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java 2011-04-15
13:42:33 UTC (rev 22424)
@@ -34,424 +34,347 @@
import java.util.Random;
public class Bean implements Serializable {
+// ------------------------------ FIELDS ------------------------------
- private String text;
+ private CustomScheduleListener additionalListener = new CustomScheduleListener();
+
+ private boolean allDayByDefault;
+
+ private boolean allDaySlot = true;
+
+ private String allDayText = "All day";
+
+ private List<ScheduleTask> allTasks = new ArrayList<ScheduleTask>();
+
private boolean allowTaskMoving;
- private List<ScheduleTask> allTasks = new ArrayList<ScheduleTask>();
- private ExtendedDataModel lazyDataModel = new MyDataModel();
- private String selectedEventId;
- private int firstDay = Calendar.SUNDAY;
- private boolean showWeekends;
- private Date initialDate;
+
private boolean allowTaskResizing;
- private String weekMode = AbstractSchedule.WEEK_MODE_FIXED;
- private String allDayText = "All day";
- private boolean allDayByDefault;
- private boolean allDaySlot = true;
+
private Double aspectRatio = 1.;
+
private String axisFormat = "h(:mm)tt";
+
+ private String columnFormat = null;
+
+ private Integer contentHeight = 400;
+
private Integer defaultEventMinutes = 90;
- private Integer contentHeight = 400;
+
private Double dragOpacity = .2;
+
private Integer dragRevertDuration = 2000;
+
private Boolean editable = true;
- private Boolean selectable = true;
- private Boolean selectHelper = true;
- private Boolean unselectAuto = true;
- private String unselectCancel = "";
+
+ private int firstDay = Calendar.SUNDAY;
+
private Integer firstHour = 8;
+
private String headerCenter = "title";
+
private String headerLeft = "prevYear,nextYear";
+
private String headerRight = "basicDay,basicWeek agendaDay,agendaWeek month
today prev,next";
+
private Integer height = 400;
+
+ private Date initialDate;
+
private boolean isRTL;
- private Integer maxTime = 17;
- private Integer minTime = 8;
- private Integer slotMinutes = 30;
- private String columnFormat = null;
- private String titleFormat = null;
- private String timeFormat = null;
- private String view = AbstractSchedule.VIEW_MONTH;
- private String locale;
- private CustomScheduleListener additionalListener = new CustomScheduleListener();
- private int taskIdSequence = 1;
- public Bean() {
- Calendar instance = Calendar.getInstance();
- instance.setTime(getInitialDate());
- Random random = new Random();
- for (int i = -30; i < 60; i++) {
- instance.set(Calendar.HOUR, minTime + random.nextInt(maxTime - minTime));
- instance.set(Calendar.MINUTE, random.nextInt(59));
- instance.add(Calendar.DAY_OF_YEAR, 1);
- Map<String, Object> data = new HashMap<String, Object>();
- data.put("category", "category-" + (i % 3));
- int taskId = taskIdSequence++;
- allTasks.add(new ScheduleTask("" + taskId, "Title " +
taskId, instance.getTime(), instance.getTime(), data));
- }
- }
+ private ExtendedDataModel lazyDataModel = new MyDataModel();
- public Boolean taskMoved(ScheduleItemMoveEvent event) {
- System.out.println("taskMoved invoked " + event + " : " +
isAllowTaskMoving());
- if (isAllowTaskMoving()) {
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Item moved", event.toString()));
- ScheduleTask task = getTask(event.getEventId());
- selectedEventId = event.getEventId();
- if (task != null) {
- boolean endDateEqualsStartDate =
task.getStartDate().equals(task.getEndDate());
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(task.getStartDate());
- calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
- calendar.add(Calendar.MINUTE, event.getMinuteDelta());
- task.setStartDate(calendar.getTime());
- if (!event.isAllDay() && endDateEqualsStartDate) {
- calendar.setTime(task.getStartDate());
- calendar.add(Calendar.MINUTE, getDefaultEventMinutes());
- } else {
- calendar.setTime(task.getEndDate());
- calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
- calendar.add(Calendar.MINUTE, event.getMinuteDelta());
- }
- task.setEndDate(calendar.getTime());
- task.setAllDay(event.isAllDay());
- }
- } else {
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to move this item",
event.toString()));
- }
- return isAllowTaskMoving();
- }
+ private String locale;
- public Boolean taskResized(ScheduleItemResizeEvent event) {
- System.out.println("taskResized invoked " + event + " : " +
isAllowTaskResizing());
- if (isAllowTaskResizing()) {
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Item resized", event.toString()));
- ScheduleTask task = getTask(event.getEventId());
- selectedEventId = event.getEventId();
- if (task != null) {
- Calendar calendar = Calendar.getInstance();
- Date date = task.getEndDate() == null ? task.getStartDate() :
task.getEndDate();
- calendar.setTime(date);
- calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
- calendar.add(Calendar.MINUTE, event.getMinuteDelta());
- task.setEndDate(calendar.getTime());
- }
- } else {
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to resize this
item", event.toString()));
- }
- return isAllowTaskResizing();
- }
+ private Integer maxTime = 17;
- public void viewChanged(ScheduleViewChangeEvent event) {
- System.out.println("viewChanged invoked " + event);
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("View
changed", event.toString()));
- setView(event.getView());
- }
+ private Integer minTime = 8;
- public void taskSelected(ScheduleItemSelectEvent event) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Task
selected", event.toString()));
- selectedEventId = event.getEventId();
- }
+ private Boolean selectHelper = true;
- public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date
range changed", event.toString()));
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(event.getStartDate());
- if (AbstractSchedule.VIEW_MONTH.equals(getView())) {
- calendar.add(Calendar.DATE, 15);
- }
- setInitialDate(calendar.getTime());
- }
+ private Boolean selectable = true;
- public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
- if (editable) {
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Date range selected", event.toString()));
- int taskId = taskIdSequence++;
- allTasks.add(new ScheduleTask("" + taskId, "Title-" +
taskId, event.getStartDate(), event.getEndDate(), event.isAllDay()));
- } else {
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "Date range selected", "Cannot
create item. Not in edit mode."));
- }
- }
+ private String selectedEventId;
- public void dateSelected(ScheduleDateSelectEvent event) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date
selected", event.toString()));
- setInitialDate(event.getDate());
- }
+ private boolean showWeekends;
- public ScheduleTask getSelectedTask() {
- return getTask(getSelectedEventId());
- }
+ private Integer slotMinutes = 30;
- protected ScheduleTask getTask(String id) {
- if (id == null) {
- return null;
- }
- for (ScheduleTask task : allTasks) {
- if (id.equals(task.getId())) {
- return task;
- }
- }
- return null;
- }
+ private String switchType = "ajax";
- public String getText() {
- return text;
- }
+ private int taskIdSequence = 1;
- public void setText(String text) {
- this.text = text;
- }
+ private String text;
- public List<ScheduleTask> getAllEvents() {
- return allTasks;
- }
+ private String timeFormat = null;
- public ExtendedDataModel getLazyDataModel() {
- return lazyDataModel;
- }
+ private String titleFormat = null;
- public boolean isAllowTaskMoving() {
- return allowTaskMoving;
- }
+ private Boolean unselectAuto = true;
- public void setAllowTaskMoving(boolean allowTaskMoving) {
- this.allowTaskMoving = allowTaskMoving;
- }
+ private String unselectCancel = "";
- public boolean isAllowTaskResizing() {
- return allowTaskResizing;
- }
+ private String view = AbstractSchedule.VIEW_MONTH;
- public void setAllowTaskResizing(boolean allowTaskResizing) {
- this.allowTaskResizing = allowTaskResizing;
- }
+ private String weekMode = AbstractSchedule.WEEK_MODE_FIXED;
- public String getSelectedEventId() {
- return selectedEventId;
- }
+// --------------------------- CONSTRUCTORS ---------------------------
- public Date getInitialDate() {
- if (initialDate == null) {
- Calendar instance = Calendar.getInstance();
- instance.set(Calendar.YEAR, 2012);
- instance.set(Calendar.MONTH, 7);
- instance.set(Calendar.DATE, 22);
- initialDate = instance.getTime();
+ public Bean() {
+ Calendar instance = Calendar.getInstance();
+ instance.setTime(getInitialDate());
+ Random random = new Random();
+ for (int i = -30; i < 60; i++) {
+ instance.set(Calendar.HOUR, minTime + random.nextInt(maxTime - minTime));
+ instance.set(Calendar.MINUTE, random.nextInt(59));
+ instance.add(Calendar.DAY_OF_YEAR, 1);
+ Map<String, Object> data = new HashMap<String, Object>();
+ data.put("category", "category-" + (i % 3));
+ int taskId = taskIdSequence++;
+ allTasks.add(new ScheduleTask("" + taskId, "Title " +
taskId, instance.getTime(), instance.getTime(), data));
}
- return initialDate;
}
- public int getFirstDay() {
- return firstDay;
- }
+// --------------------- GETTER / SETTER METHODS ---------------------
- public void setFirstDay(int firstDay) {
- this.firstDay = firstDay;
+ public CustomScheduleListener getAdditionalListener() {
+ return additionalListener;
}
- public boolean isShowWeekends() {
- return showWeekends;
+ public boolean getAllDayByDefault() {
+ return allDayByDefault;
}
- public void setShowWeekends(boolean showWeekends) {
- this.showWeekends = showWeekends;
+ public void setAllDayByDefault(boolean allDayByDefault) {
+ this.allDayByDefault = allDayByDefault;
}
- public void setInitialDate(Date initialDate) {
- this.initialDate = initialDate;
+ public boolean getAllDaySlot() {
+ return allDaySlot;
}
- public String getWeekMode() {
- return weekMode;
+ public void setAllDaySlot(boolean allDaySlot) {
+ this.allDaySlot = allDaySlot;
}
- public void setWeekMode(String weekMode) {
- this.weekMode = weekMode;
+ public String getAllDayText() {
+ return allDayText;
}
public void setAllDayText(String allDayText) {
this.allDayText = allDayText;
}
- public String getAllDayText() {
- return allDayText;
+ public Double getAspectRatio() {
+ return aspectRatio;
}
- public void setAllDayByDefault(boolean allDayByDefault) {
- this.allDayByDefault = allDayByDefault;
- }
-
- public boolean getAllDayByDefault() {
- return allDayByDefault;
- }
-
- public void setAllDaySlot(boolean allDaySlot) {
- this.allDaySlot = allDaySlot;
- }
-
- public boolean getAllDaySlot() {
- return allDaySlot;
- }
-
public void setAspectRatio(Double aspectRatio) {
this.aspectRatio = aspectRatio;
}
- public Double getAspectRatio() {
- return aspectRatio;
+ public String getAxisFormat() {
+ return axisFormat;
}
public void setAxisFormat(String axisFormat) {
this.axisFormat = axisFormat;
}
- public String getAxisFormat() {
- return axisFormat;
+ public String getColumnFormat() {
+ return columnFormat;
}
- public void setDefaultEventMinutes(Integer defaultEventMinutes) {
- this.defaultEventMinutes = defaultEventMinutes;
+ public void setColumnFormat(String columnFormat) {
+ this.columnFormat = columnFormat;
}
- public Integer getDefaultEventMinutes() {
- return defaultEventMinutes;
+ public Integer getContentHeight() {
+ return contentHeight;
}
public void setContentHeight(Integer contentHeight) {
this.contentHeight = contentHeight;
}
- public Integer getContentHeight() {
- return contentHeight;
+ public Integer getDefaultEventMinutes() {
+ return defaultEventMinutes;
}
- public void setDragOpacity(Double dragOpacity) {
- this.dragOpacity = dragOpacity;
+ public void setDefaultEventMinutes(Integer defaultEventMinutes) {
+ this.defaultEventMinutes = defaultEventMinutes;
}
public Double getDragOpacity() {
return dragOpacity;
}
- public void setDragRevertDuration(Integer dragRevertDuration) {
- this.dragRevertDuration = dragRevertDuration;
+ public void setDragOpacity(Double dragOpacity) {
+ this.dragOpacity = dragOpacity;
}
public Integer getDragRevertDuration() {
return dragRevertDuration;
}
- public void setEditable(Boolean editable) {
- this.editable = editable;
+ public void setDragRevertDuration(Integer dragRevertDuration) {
+ this.dragRevertDuration = dragRevertDuration;
}
public Boolean getEditable() {
return editable;
}
- public void setSelectable(Boolean selectable) {
- this.selectable = selectable;
+ public void setEditable(Boolean editable) {
+ this.editable = editable;
}
- public Boolean getSelectable() {
- return selectable;
+ public int getFirstDay() {
+ return firstDay;
}
- public void setFirstHour(Integer firstHour) {
- this.firstHour = firstHour;
+ public void setFirstDay(int firstDay) {
+ this.firstDay = firstDay;
}
public Integer getFirstHour() {
return firstHour;
}
- public void setHeaderCenter(String headerCenter) {
- this.headerCenter = headerCenter;
+ public void setFirstHour(Integer firstHour) {
+ this.firstHour = firstHour;
}
public String getHeaderCenter() {
return headerCenter;
}
- public void setHeaderLeft(String headerLeft) {
- this.headerLeft = headerLeft;
+ public void setHeaderCenter(String headerCenter) {
+ this.headerCenter = headerCenter;
}
public String getHeaderLeft() {
return headerLeft;
}
- public void setHeaderRight(String headerRight) {
- this.headerRight = headerRight;
+ public void setHeaderLeft(String headerLeft) {
+ this.headerLeft = headerLeft;
}
public String getHeaderRight() {
return headerRight;
}
- public void setHeight(Integer height) {
- this.height = height;
+ public void setHeaderRight(String headerRight) {
+ this.headerRight = headerRight;
}
public Integer getHeight() {
return height;
}
- public void setIsRTL(Boolean isRTL) {
- this.isRTL = isRTL;
+ public void setHeight(Integer height) {
+ this.height = height;
}
+ public Date getInitialDate() {
+ if (initialDate == null) {
+ Calendar instance = Calendar.getInstance();
+ instance.set(Calendar.YEAR, 2012);
+ instance.set(Calendar.MONTH, 7);
+ instance.set(Calendar.DATE, 22);
+ initialDate = instance.getTime();
+ }
+ return initialDate;
+ }
+
+ public void setInitialDate(Date initialDate) {
+ this.initialDate = initialDate;
+ }
+
public Boolean getIsRTL() {
return isRTL;
}
- public void setMaxTime(Integer maxTime) {
- this.maxTime = maxTime;
+ public void setIsRTL(Boolean isRTL) {
+ this.isRTL = isRTL;
}
+ public ExtendedDataModel getLazyDataModel() {
+ return lazyDataModel;
+ }
+
+ public String getLocale() {
+ if (locale == null) {
+ locale =
FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage();
+ }
+ return locale;
+ }
+
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
public Integer getMaxTime() {
return maxTime;
}
- public void setMinTime(Integer minTime) {
- this.minTime = minTime;
+ public void setMaxTime(Integer maxTime) {
+ this.maxTime = maxTime;
}
public Integer getMinTime() {
return minTime;
}
- public void setSlotMinutes(Integer slotMinutes) {
- this.slotMinutes = slotMinutes;
+ public void setMinTime(Integer minTime) {
+ this.minTime = minTime;
}
+ public Boolean getSelectHelper() {
+ return selectHelper;
+ }
+
+ public void setSelectHelper(Boolean selectHelper) {
+ this.selectHelper = selectHelper;
+ }
+
+ public Boolean getSelectable() {
+ return selectable;
+ }
+
+ public void setSelectable(Boolean selectable) {
+ this.selectable = selectable;
+ }
+
+ public String getSelectedEventId() {
+ return selectedEventId;
+ }
+
public Integer getSlotMinutes() {
return slotMinutes;
}
- public void setView(String view) {
- this.view = view;
+ public void setSlotMinutes(Integer slotMinutes) {
+ this.slotMinutes = slotMinutes;
}
- public String getView() {
- return view;
+ public String getSwitchType() {
+ return switchType;
}
- public String getColumnFormat() {
- return columnFormat;
+ public void setSwitchType(String switchType) {
+ this.switchType = switchType;
}
- public void setColumnFormat(String columnFormat) {
- this.columnFormat = columnFormat;
+ public String getText() {
+ return text;
}
- public String getTitleFormat() {
- return titleFormat;
+ public void setText(String text) {
+ this.text = text;
}
- public void setTitleFormat(String titleFormat) {
- this.titleFormat = titleFormat;
- }
-
public String getTimeFormat() {
return timeFormat;
}
@@ -460,18 +383,14 @@
this.timeFormat = timeFormat;
}
- public CustomScheduleListener getAdditionalListener() {
- return additionalListener;
+ public String getTitleFormat() {
+ return titleFormat;
}
- public Boolean getSelectHelper() {
- return selectHelper;
+ public void setTitleFormat(String titleFormat) {
+ this.titleFormat = titleFormat;
}
- public void setSelectHelper(Boolean selectHelper) {
- this.selectHelper = selectHelper;
- }
-
public Boolean getUnselectAuto() {
return unselectAuto;
}
@@ -488,122 +407,166 @@
this.unselectCancel = unselectCancel;
}
- public String getLocale() {
- if (locale == null) {
- locale =
FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage();
- }
- return locale;
+ public String getView() {
+ return view;
}
- public void setLocale(String locale) {
- this.locale = locale;
+ public void setView(String view) {
+ this.view = view;
}
- private class MyDataModel extends ExtendedDataModel implements Serializable {
+ public String getWeekMode() {
+ return weekMode;
+ }
- Object rowKey;
- java.util.Map wrappedDataMap = new HashMap();
- java.util.Map indexToRowKey = new HashMap();
- java.util.Map rowKeyToIndex = new HashMap();
- int rowCount = -1;
- int rowIndex = -1;
+ public void setWeekMode(String weekMode) {
+ this.weekMode = weekMode;
+ }
- @Override
- public void setRowKey(Object key) {
- this.rowKey = key;
- Integer index = (Integer) rowKeyToIndex.get(key);
- if (index == null) {
- index = -1;
- }
- if (index != getRowIndex()) {
- setRowIndex(rowIndex);
- }
+ public boolean isAllowTaskMoving() {
+ return allowTaskMoving;
+ }
+
+ public void setAllowTaskMoving(boolean allowTaskMoving) {
+ this.allowTaskMoving = allowTaskMoving;
+ }
+
+ public boolean isAllowTaskResizing() {
+ return allowTaskResizing;
+ }
+
+ public void setAllowTaskResizing(boolean allowTaskResizing) {
+ this.allowTaskResizing = allowTaskResizing;
+ }
+
+ public boolean isShowWeekends() {
+ return showWeekends;
+ }
+
+ public void setShowWeekends(boolean showWeekends) {
+ this.showWeekends = showWeekends;
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
+ public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date
range changed", event.toString()));
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(event.getStartDate());
+ if (AbstractSchedule.VIEW_MONTH.equals(getView())) {
+ calendar.add(Calendar.DATE, 15);
}
+ setInitialDate(calendar.getTime());
+ }
- @Override
- public Object getRowKey() {
- return rowKey;
+ public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
+ if (editable) {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Date range selected", event.toString()));
+ int taskId = taskIdSequence++;
+ allTasks.add(new ScheduleTask("" + taskId, "Title-" +
taskId, event.getStartDate(), event.getEndDate(), event.isAllDay()));
+ } else {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "Date range selected", "Cannot
create item. Not in edit mode."));
}
+ }
- @Override
- public void walk(FacesContext context, DataVisitor visitor, Range range, Object
argument) {
- Date startDate = ((DateRange) range).getStartDate();
- Date endDate = ((DateRange) range).getEndDate();
- wrappedDataMap.clear();
- indexToRowKey.clear();
- rowKeyToIndex.clear();
- int i = 0;
- for (ScheduleTask task : allTasks) {
- if ((startDate == null || task.getStartDate().compareTo(startDate) >=
0) && (endDate == null || task.getStartDate().compareTo(endDate) < 0)) {
- wrappedDataMap.put(task.getId(), task);
- int index = i++;
- indexToRowKey.put(index, task.getId());
- rowKeyToIndex.put(task.getId(), index);
- visitor.process(context, task.getId(), argument);
+ public void dateSelected(ScheduleDateSelectEvent event) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date
selected", event.toString()));
+ setInitialDate(event.getDate());
+ }
+
+ public List<ScheduleTask> getAllEvents() {
+ return allTasks;
+ }
+
+ public ScheduleTask getSelectedTask() {
+ return getTask(getSelectedEventId());
+ }
+
+ public Boolean taskMoved(ScheduleItemMoveEvent event) {
+ System.out.println("taskMoved invoked " + event + " : " +
isAllowTaskMoving());
+ if (isAllowTaskMoving()) {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Item moved", event.toString()));
+ ScheduleTask task = getTask(event.getEventId());
+ selectedEventId = event.getEventId();
+ if (task != null) {
+ boolean endDateEqualsStartDate =
task.getStartDate().equals(task.getEndDate());
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(task.getStartDate());
+ calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
+ calendar.add(Calendar.MINUTE, event.getMinuteDelta());
+ task.setStartDate(calendar.getTime());
+ if (!event.isAllDay() && endDateEqualsStartDate) {
+ calendar.setTime(task.getStartDate());
+ calendar.add(Calendar.MINUTE, getDefaultEventMinutes());
+ } else {
+ calendar.setTime(task.getEndDate());
+ calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
+ calendar.add(Calendar.MINUTE, event.getMinuteDelta());
}
+ task.setEndDate(calendar.getTime());
+ task.setAllDay(event.isAllDay());
}
- rowCount = -1;
+ } else {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to move this item",
event.toString()));
}
+ return isAllowTaskMoving();
+ }
- @Override
- public boolean isRowAvailable() {
- if (getRowKey() == null) {
- return false;
- } else {
- return null != wrappedDataMap.get(getRowKey());
+ public Boolean taskResized(ScheduleItemResizeEvent event) {
+ System.out.println("taskResized invoked " + event + " : " +
isAllowTaskResizing());
+ if (isAllowTaskResizing()) {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Item resized", event.toString()));
+ ScheduleTask task = getTask(event.getEventId());
+ selectedEventId = event.getEventId();
+ if (task != null) {
+ Calendar calendar = Calendar.getInstance();
+ Date date = task.getEndDate() == null ? task.getStartDate() :
task.getEndDate();
+ calendar.setTime(date);
+ calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
+ calendar.add(Calendar.MINUTE, event.getMinuteDelta());
+ task.setEndDate(calendar.getTime());
}
+ } else {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to resize this
item", event.toString()));
}
+ return isAllowTaskResizing();
+ }
- @Override
- public int getRowCount() {
- if (rowCount == -1) {
- rowCount = wrappedDataMap.size();
- }
- return rowCount;
- }
+ public void taskSelected(ScheduleItemSelectEvent event) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Task
selected", event.toString()));
+ selectedEventId = event.getEventId();
+ }
- @Override
- public Object getRowData() {
- if (getRowKey() == null) {
- return null;
- } else {
- return wrappedDataMap.get(getRowKey());
- }
- }
+ public void viewChanged(ScheduleViewChangeEvent event) {
+ System.out.println("viewChanged invoked " + event);
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("View
changed", event.toString()));
+ setView(event.getView());
+ }
- @Override
- public int getRowIndex() {
- return rowIndex;
+ protected ScheduleTask getTask(String id) {
+ if (id == null) {
+ return null;
}
-
- @Override
- public void setRowIndex(int rowIndex) {
- this.rowIndex = rowIndex;
- Object key = indexToRowKey.get(rowIndex);
- if ((key != null && !key.equals(getRowKey())) || (key == null
&& getRowKey() != null)) {
- setRowKey(key);
+ for (ScheduleTask task : allTasks) {
+ if (id.equals(task.getId())) {
+ return task;
}
}
+ return null;
+ }
- @Override
- public Object getWrappedData() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
+// -------------------------- INNER CLASSES --------------------------
- @Override
- public void setWrappedData(Object data) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- }
-
public static class CustomScheduleListener implements
ScheduleDateRangeChangeListener, ScheduleDateSelectListener, ScheduleItemMoveListener,
ScheduleItemResizeListener, ScheduleItemSelectListener, ScheduleViewChangeListener,
ScheduleDateRangeSelectListener, Serializable {
+// ------------------------------ FIELDS ------------------------------
private static FacesEvent recentlyProcessedEvent;
- private void addMessage(String text, Severity severity) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(severity,
"Additional listener", text));
- }
+// ------------------------ INTERFACE METHODS ------------------------
+
+// --------------------- Interface ScheduleDateRangeChangeListener ---------------------
+
public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -611,6 +574,17 @@
}
}
+// --------------------- Interface ScheduleDateRangeSelectListener ---------------------
+
+ public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
+ if (event != recentlyProcessedEvent) {
+ recentlyProcessedEvent = event;
+ addMessage(event.toString(), FacesMessage.SEVERITY_INFO);
+ }
+ }
+
+// --------------------- Interface ScheduleDateSelectListener ---------------------
+
public void dateSelected(ScheduleDateSelectEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -618,6 +592,8 @@
}
}
+// --------------------- Interface ScheduleItemMoveListener ---------------------
+
public void itemMove(ScheduleItemMoveEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -625,6 +601,8 @@
}
}
+// --------------------- Interface ScheduleItemResizeListener ---------------------
+
public void itemResize(ScheduleItemResizeEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -632,6 +610,8 @@
}
}
+// --------------------- Interface ScheduleItemSelectListener ---------------------
+
public void itemSelected(ScheduleItemSelectEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -639,6 +619,8 @@
}
}
+// --------------------- Interface ScheduleViewChangeListener ---------------------
+
public void viewChanged(ScheduleViewChangeEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -646,11 +628,115 @@
}
}
- public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
- if (event != recentlyProcessedEvent) {
- recentlyProcessedEvent = event;
- addMessage(event.toString(), FacesMessage.SEVERITY_INFO);
+ private void addMessage(String text, Severity severity) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(severity,
"Additional listener", text));
+ }
+ }
+
+ private class MyDataModel extends ExtendedDataModel implements Serializable {
+// ------------------------------ FIELDS ------------------------------
+
+ java.util.Map indexToRowKey = new HashMap();
+
+ int rowCount = -1;
+
+ int rowIndex = -1;
+
+ Object rowKey;
+
+ java.util.Map rowKeyToIndex = new HashMap();
+
+ java.util.Map wrappedDataMap = new HashMap();
+
+// --------------------- GETTER / SETTER METHODS ---------------------
+
+ @Override
+ public int getRowCount() {
+ if (rowCount == -1) {
+ rowCount = wrappedDataMap.size();
}
+ return rowCount;
}
+
+ @Override
+ public int getRowIndex() {
+ return rowIndex;
+ }
+
+ @Override
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
+ @Override
+ public Object getRowData() {
+ if (getRowKey() == null) {
+ return null;
+ } else {
+ return wrappedDataMap.get(getRowKey());
+ }
+ }
+
+ @Override
+ public Object getWrappedData() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isRowAvailable() {
+ if (getRowKey() == null) {
+ return false;
+ } else {
+ return null != wrappedDataMap.get(getRowKey());
+ }
+ }
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ this.rowIndex = rowIndex;
+ Object key = indexToRowKey.get(rowIndex);
+ if ((key != null && !key.equals(getRowKey())) || (key == null
&& getRowKey() != null)) {
+ setRowKey(key);
+ }
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ this.rowKey = key;
+ Integer index = (Integer) rowKeyToIndex.get(key);
+ if (index == null) {
+ index = -1;
+ }
+ if (index != getRowIndex()) {
+ setRowIndex(rowIndex);
+ }
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object
argument) {
+ Date startDate = ((DateRange) range).getStartDate();
+ Date endDate = ((DateRange) range).getEndDate();
+ wrappedDataMap.clear();
+ indexToRowKey.clear();
+ rowKeyToIndex.clear();
+ int i = 0;
+ for (ScheduleTask task : allTasks) {
+ if ((startDate == null || task.getStartDate().compareTo(startDate) >=
0) && (endDate == null || task.getStartDate().compareTo(endDate) < 0)) {
+ wrappedDataMap.put(task.getId(), task);
+ int index = i++;
+ indexToRowKey.put(index, task.getId());
+ rowKeyToIndex.put(task.getId(), index);
+ visitor.process(context, task.getId(), argument);
+ }
+ }
+ rowCount = -1;
+ }
}
}
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml 2011-04-15 12:37:03
UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml 2011-04-15 13:42:33
UTC (rev 22424)
@@ -1,11 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<ui:include src="settingsPanel.xhtml"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml 2011-04-15 12:37:03
UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml 2011-04-15 13:42:33
UTC (rev 22424)
@@ -1,40 +1,26 @@
-<ui:component
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:notify="http://richfaces.org/notify">
+<ui:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
xmlns:notify="http://richfaces.org/sandbox/notify">
<div>
<h:panelGrid columns="10" style="width:100%;">
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/index.jsf">Ajax
mode
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/index.jsf">Ajax
mode
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_1.jsf">Server
mode
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_1.jsf">Server
mode
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_2.jsf">Client
mode
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_2.jsf">Client
mode
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_3.jsf">Customization
per view
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_3.jsf">Customization
per view
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_4.jsf">Client
side callbacks
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_4.jsf">Client
side callbacks
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_5.jsf">Fetch
additional data
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_5.jsf">Fetch
additional data
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_6.jsf">With
modal panel
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_6.jsf">With
modal panel
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_7.jsf">Internationalization
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_7.jsf">Internationalization
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_8.jsf">JavaScript
API
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_8.jsf">JavaScript
API
</h:outputLink>
- <h:outputLink
-
value="#{facesContext.externalContext.requestContextPath}/pages/sample_9.jsf">3
in 1
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/pages/sample_9.jsf">3
in 1
</h:outputLink>
</h:panelGrid>
</div>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:schedule="http://richfaces.org/schedule"
-
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<style type="text/css">
@@ -17,8 +12,7 @@
<p>
Notice that in this mode, we will have entire shedule re rendered on date
navigation,
so "date" attribute should be updated on DateRangeChangeEvent.
- This can be achieved by binding following listener method to
"dateRangeChangeListener" attribtue:
- </p>
+ This can be achieved by binding following listener method to
"dateRangeChangeListener" attribtue: </p>
<pre>
public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date range
changed", event.toString()));
@@ -32,22 +26,15 @@
</pre>
<p>
Right schedule does not have "dateRangeChangeListener" attribute
bound, so after
- re render it stays on the initial date.
- </p>
+ re render it stays on the initial date. </p>
<ui:include src="settingsPanel.xhtml"/>
<ui:include src="schedule.xhtml">
<ui:param name="mode" value="server"/>
</ui:include>
<h:form>
- <schedule:schedule switchType="server"
- value="#{myBean.lazyDataModel}"
- var="event"
- date="#{myBean.initialDate}"
- styleClass="slim"
- >
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first'
: null}" data="#{event.data}"/>
+ <schedule:schedule switchType="server"
value="#{myBean.lazyDataModel}" var="event"
date="#{myBean.initialDate}" styleClass="slim">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
</schedule:schedule>
</h:form>
</ui:define>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,13 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
-
xmlns:schedule="http://labs.jboss.com/jbossrichfaces/ui/ui/schedule&...
- >
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<ui:include src="settingsPanel.xhtml"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,48 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
-
xmlns:rich="http://richfaces.org/rich"
-
xmlns:schedule="http://richfaces.org/schedule">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<p>Different views can have different display options.
- This can be achieved by inserting appropriate tags within schedule tag.
- </p>
+ This can be achieved by inserting appropriate tags within schedule tag.
</p>
<h:form>
- <schedule:schedule switchType="client"
- value="#{myBean.lazyDataModel}"
var="event"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek agendaDay,agendaWeek
month today prev,next"
- date="#{myBean.initialDate}"
- editable="true"
+ <schedule:schedule switchType="client"
value="#{myBean.lazyDataModel}" var="event"
headerCenter="title" headerLeft="prevYear,nextYear"
+ headerRight="basicDay,basicWeek agendaDay,agendaWeek
month today prev,next" date="#{myBean.initialDate}"
editable="true"
- dragOpacity="#{myBean.dragOpacity}"
- columnFormat="#{myBean.columnFormat}"
- titleFormat="#{myBean.titleFormat}"
- timeFormat="#{myBean.timeFormat}"
- >
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first'
: null}" data="#{event.data}"/>
- <schedule:scheduleMonthView weekMode="#{myBean.weekMode}"
titleFormat="MMM/yyyy" timeFormat="h:mt"
- columnFormat="ddd"
dragOpacity=".1"/>
- <schedule:scheduleAgendaDayView titleFormat="dd/MM/yyyy"
timeFormat="hh:m:s{ - hh:m:s}"
- columnFormat="dd/MMM"
dragOpacity=".3"/>
- <schedule:scheduleBasicDayView titleFormat="d/M/yy"
timeFormat="h:mm:ss" columnFormat="d/MM"
- dragOpacity=".5"/>
- <schedule:scheduleAgendaWeekView titleFormat="MMM d[ yyyy]{
'—'[ MMM] d[ yyyy]}"
- timeFormat="HH:mm{ - HH:mm}"
columnFormat="dd/MM" dragOpacity=".7"/>
- <schedule:scheduleBasicWeekView titleFormat="d/M/yy{
'—'d/M/yy}" timeFormat="h(:mm)tt"
- columnFormat="d/M"
dragOpacity=".9"/>
+ dragOpacity="#{myBean.dragOpacity}"
columnFormat="#{myBean.columnFormat}"
titleFormat="#{myBean.titleFormat}"
+ timeFormat="#{myBean.timeFormat}">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
+ <schedule:scheduleMonthView weekMode="#{myBean.weekMode}"
titleFormat="MMM/yyyy" timeFormat="h:mt" columnFormat="ddd"
dragOpacity=".1"/>
+ <schedule:scheduleAgendaDayView titleFormat="dd/MM/yyyy"
timeFormat="hh:m:s{ - hh:m:s}" columnFormat="dd/MMM"
dragOpacity=".3"/>
+ <schedule:scheduleBasicDayView titleFormat="d/M/yy"
timeFormat="h:mm:ss" columnFormat="d/MM"
dragOpacity=".5"/>
+ <schedule:scheduleAgendaWeekView titleFormat="MMM d[ yyyy]{
'—'[ MMM] d[ yyyy]}" timeFormat="HH:mm{ - HH:mm}"
columnFormat="dd/MM"
+ dragOpacity=".7"/>
+ <schedule:scheduleBasicWeekView titleFormat="d/M/yy{
'—'d/M/yy}" timeFormat="h(:mm)tt"
columnFormat="d/M" dragOpacity=".9"/>
</schedule:schedule>
</h:form>
- <rich:insert src="/pages/sample_3.xhtml"
highlight="xhtml"/>
+ <!--<rich:insert src="/pages/sample_3.xhtml"
highlight="xhtml"/>-->
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
-
xmlns:schedule="http://richfaces.org/schedule">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<style type="text/css">
@@ -23,69 +18,85 @@
font-size: 12px;
}
+ #log {
+ float: left;
+ width: 400px;
+ }
+
+ #log div {
+ border-bottom: 1px solid #000;
+ }
</style>
<script type="text/javascript">
+ function clearLog() {
+ jQuery("#log").html("");
+ }
function notify(action, text, timeToStay) {
-
RichFaces.Notify({title:action,text:text,sticky:false,styleClass:'rf-ny-info',stayTime:timeToStay});
+ jQuery("#log").append("<div>" + action +
": " + text + "</div>");
+ //
RichFaces.Notify({title:action,text:text,sticky:false,styleClass:'rf-ny-info',stayTime:timeToStay});
}
function blockEvent(item, event, action) {
-
RichFaces.Notify({title:action,text:item.title,sticky:false,styleClass:'rf-ny-error'});
+ notify(action, item.title + " - blocked");
+ //
RichFaces.Notify({title:action,text:item.title,sticky:false,styleClass:'rf-ny-error'});
}
- function viewChanged(view) {
+ function onviewchange(view) {
notify('View changed', view.name);
}
- function daySelected(date, allDay, event, view) {
+ function onbeforedateselect(date, allDay, event, view) {
notify('Day select', toString(date) + ' ' + (allDay ?
'with all day slot' : ''));
}
- function daySelectedComplete(date, allDay, event, view, data) {
+ function ondateselect(date, allDay, event, view, data) {
notify('Day select complete', toString(date) + ' ' +
(allDay ? 'with all day slot' : '') + ";data=" +
toString(data));
}
- function itemSelected(item, event, view) {
- notify("Item selected", "item:" + item.title +
";event=" + event.type + ";view:" + view.name);
+ function onbeforeitemselect(item, event, view) {
+ notify("onbeforeitemselect", "item:" + item.title +
";event=" + event.type + ";view:" + view.name);
}
- function itemSelectedComplete(item, event, view, data) {
- notify("Item selected complete", "item:" + item.title
+ ";event=" + event.type + ";view:" + view.name + ";data=" +
toString(data));
+ function onitemselect(item, event, view, data) {
+ notify("onitemselect", "item:" + item.title +
";event=" + event.type + ";view:" + view.name + ";data=" +
toString(data));
}
- function itemResized(item, dayDelta, minuteDelta, event, ui, view) {
- notify("Item resized", "item:" + item.title +
";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
+ function onbeforeitemresize(item, dayDelta, minuteDelta, event, ui, view) {
+ notify("onbeforeitemresize", "item:" + item.title +
";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
}
- function itemResizedComplete(item, dayDelta, minuteDelta, vetoed, event, ui,
view, data) {
- notify("Item resized complete", "item:" + item.title
+ ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";vetoed=" + vetoed + ";event=" + event.type + ";ui=" + ui +
";view:" + view.name + ";data=" + toString(data));
+ function onitemresize(item, dayDelta, minuteDelta, vetoed, event, ui, view,
data) {
+ notify("onitemresize", "item:" + item.title +
";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";vetoed=" + vetoed + ";event=" + event.type + ";ui=" + ui +
";view:" + view.name + ";data=" + toString(data));
}
- function itemDrop(item, dayDelta, minuteDelta, allDay, event, ui, view) {
- notify("Item drop", "item:" + item.title +
";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";allDay=" + allDay + ";event=" + event.type + ";ui=" + ui +
";view:" + view.name);
+ function onbeforeitemdrop(item, dayDelta, minuteDelta, allDay, event, ui,
view) {
+ notify("onbeforeitemdrop", "item:" + item.title +
";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";allDay=" + allDay + ";event=" + event.type + ";ui=" + ui +
";view:" + view.name);
}
- function itemDropComplete(item, dayDelta, minuteDelta, allDay, vetoed, event,
ui, view, data) {
- notify("Item drop complete", "item:" + item.title +
";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";allDay=" + allDay + ";vetoed=" + vetoed + ";event=" +
event.type + ";ui=" + ui + ";view:" + view.name + ";data=" +
toString(data));
+ function onitemdrop(item, dayDelta, minuteDelta, allDay, vetoed, event, ui,
view, data) {
+ notify("onitemdrop", "item:" + item.title +
";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta +
";allDay=" + allDay + ";vetoed=" + vetoed + ";event=" +
event.type + ";ui=" + ui + ";view:" + view.name + ";data=" +
toString(data));
}
- function dragStart(item, event, ui, view) {
- notify("Item drag start", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
+ function onitemdragstart(item, event, ui, view) {
+ notify("onitemdragstart", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
}
- function dragStop(item, event, ui, view) {
- notify("Item drag stop", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
+ function onitemdragstop(item, event, ui, view) {
+ notify("onitemdragstop", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
}
- function itemResizeStart(item, event, ui, view) {
- notify("Item resize start", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
+ function onitemresizestart(item, event, ui, view) {
+ notify("onitemresizestart", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
}
- function itemResizeStop(item, event, ui, view) {
- notify("Item resize stop", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
+ function onitemresizestop(item, event, ui, view) {
+ notify("onitemresizestop", "item:" + item.title +
";event=" + event.type + ";ui=" + ui + ";view:" +
view.name);
}
- function itemMouseover(item) {
- notify('Mouseover', item.title, 1000);
+ function onitemmouseover(item) {
+ notify("onitemmouseover", item.title, 1000);
}
- function itemMouseout(item) {
- notify('Mouseout', item.title, 1000);
+ function onitemmouseout(item) {
+ notify("onitemmouseout", item.title, 1000);
}
- function dateRangeSelected(startDate, endDate, allDay, view) {
- notify('Date range selected', toString(startDate) + " -
" + toString(endDate) + "; " + (allDay ? "all day" : "not
all day") + ";view:" + view.name);
+ function ondaterangeselect(startDate, endDate, allDay, view, data) {
+ notify("ondaterangeselect", toString(startDate) + " -
" + toString(endDate) + "; " + (allDay ? "all day" : "not
all day") + ";view:" + view.name + ";data=" + toString(data));
}
- function dateRangeSelectedComplete(startDate, endDate, allDay, view, data) {
- notify('Date range selected complete', toString(startDate) +
" - " + toString(endDate) + "; " + (allDay ? "all day" :
"not all day") + ";view:" + view.name + ";data=" +
toString(data));
+ function onbeforedaterangeselect(startDate, endDate, allDay, view) {
+ notify('onbeforedaterangeselect', toString(startDate) + " -
" + toString(endDate) + "; " + (allDay ? "all day" : "not
all day") + ";view:" + view.name);
}
- function dateRangeChanged(startDate, endDate) {
- notify('Date range changed', toString(startDate) + " -
" + toString(endDate));
+ function ondaterangechange(startDate, endDate) {
+ notify('ondaterangechange', toString(startDate) + " - "
+ toString(endDate));
}
+ function onviewdisplay(view) {
+ notify('onviewdisplay', view);
+ }
function toString(object) {
if (object instanceof Date) {
return object.getFullYear() + "/" + object.getMonth() +
"/" + object.getDate() + " " + object.getHours() + ":" +
object.getMinutes();
@@ -102,82 +113,65 @@
</script>
<p>
Furst schedule's JavaScript callbacks do not veto
- any event and just notify user (veto may be raised by server side listener).
- </p>
+ any event and just notify user (veto may be raised by server side listener).
</p>
<p>
Second schedule's JavaScript callbacks <b>veto</b>
- all events.
- </p>
-
+ all events. </p>
+ <input type="button" value="Clear log"
onclick="clearLog()"/>
<h:form>
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}"
var="event"
- date="#{myBean.initialDate}"
- editable="true"
- selectable="true"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek agendaDay,agendaWeek
month today prev,next"
- itemResizeListener="#{myBean.taskResized}"
- itemMoveListener="#{myBean.taskMoved}"
- data="#{myBean.allDayText}"
- eventsQueue="schedule1"
-
onbeforeitemselect="itemSelected(item,event,view)"
-
onitemselect="itemSelectedComplete(item,event,view,data)"
-
onbeforeitemresize="itemResized(item,dayDelta,minuteDelta,event,ui,view)"
-
onitemresize="itemResizedComplete(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
-
onbeforeitemdrop="itemDrop(item,dayDelta,minuteDelta,allDay,event,ui,view)"
-
onitemdrop="itemDropComplete(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
- onitemdragstart="dragStart(item,event,ui,view)"
- onitemdragstop="dragStop(item,event,ui,view)"
-
onitemresizestart="itemResizeStart(item,event,ui,view)"
-
onitemresizestop="itemResizeStop(item,event,ui,view)"
- onviewchange="viewChanged(view)"
-
onbeforedateselect="daySelected(date,allDay,event,view)"
-
ondateselect="daySelectedComplete(date,allDay,event,view,data)"
-
ondaterangeselect="dateRangeSelected(startDate,endDate,allDay,view)"
-
ondaterangechange="dateRangeChanged(startDate,endDate)"
- onitemmouseover="itemMouseover(item)"
- onitemmouseout="itemMouseout(item)"
- styleClass="customFC"
- >
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first'
: null}" data="#{event.data}"/>
+ <h:selectOneRadio value="#{myBean.switchType}">
+ <f:selectItem itemValue="ajax"
itemLabel="Ajax"/>
+ <f:selectItem itemValue="server"
itemLabel="Server"/>
+ <f:selectItem itemValue="client"
itemLabel="Client"/>
+ <f:ajax render=":schedules"/>
+ </h:selectOneRadio>
+ </h:form>
+ <h:form id="schedules">
+ <schedule:schedule switchType="#{myBean.switchType}"
value="#{myBean.lazyDataModel}" var="event"
date="#{myBean.initialDate}" editable="true"
+ selectable="true" headerCenter="title"
headerLeft="prevYear,nextYear"
+ headerRight="basicDay,basicWeek agendaDay,agendaWeek
month today prev,next" itemResizeListener="#{myBean.taskResized}"
+ itemMoveListener="#{myBean.taskMoved}"
data="#{myBean.allDayText}" eventsQueue="schedule1"
+
onbeforeitemselect="onbeforeitemselect(item,event,view)"
onitemselect="onitemselect(item,event,view,data)"
+
onbeforeitemresize="onbeforeitemresize(item,dayDelta,minuteDelta,event,ui,view)"
+
onitemresize="onitemresize(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
+
onbeforeitemdrop="onbeforeitemdrop(item,dayDelta,minuteDelta,allDay,event,ui,view)"
+
onitemdrop="onitemdrop(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
+
onitemdragstart="onitemdragstart(item,event,ui,view)"
onitemdragstop="onitemdragstop(item,event,ui,view)"
+
onitemresizestart="onitemresizestart(item,event,ui,view)"
onitemresizestop="onitemresizestop(item,event,ui,view)"
+ onviewchange="onviewchange(view)"
onbeforedateselect="onbeforedateselect(date,allDay,event,view)"
+
ondateselect="ondateselect(date,allDay,event,view,data)"
+
onbeforedaterangeselect="onbeforedaterangeselect(startDate,endDate,allDay,view)"
+
ondaterangeselect="ondaterangeselect(startDate,endDate,allDay,view)"
ondaterangechange="ondaterangechange(startDate,endDate)"
+ onitemmouseover="onitemmouseover(item)"
onitemmouseout="onitemmouseout(item)"
onviewdisplay="onviewdisplay(view)"
+ styleClass="customFC">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
</schedule:schedule>
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}"
var="event"
- date="#{myBean.initialDate}"
- editable="true"
- selectable="true"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek agendaDay,agendaWeek
month today prev,next"
- eventsQueue="schedule2"
-
onbeforeitemselect="blockEvent(item,event,'select'); return false;"
-
onitemselect="itemSelectedComplete(item,event,view,data)"
-
onbeforeitemresize="blockEvent(item,event,'resized'); return false;"
-
onitemresize="itemResizedComplete(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
-
onbeforeitemdrop="blockEvent(item,event,'drop'); return false;"
-
onitemdrop="itemDropComplete(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
-
onitemdragstart="blockEvent(item,event,'dragStart'); return false;"
-
onitemdragstop="blockEvent(item,event,'dragStop'); return false;"
-
onitemresizestart="blockEvent(item,event,'resizeStart'); return false;"
-
onitemresizestop="blockEvent(item,event,'resizeStop'); return false;"
- onviewchange="viewChanged(view); return false;"
- onbeforedateselect="daySelected(date,allDay);return
false;"
-
ondateselect="daySelectedComplete(date,allDay,event,view,data)"
-
onbeforedaterangeselect="blockEvent(startDate,endDate,'dateRangeSelected');
return false;"
-
ondaterangeselect="dateRangeSelected(startDate,endDate,allDay,view,data)"
-
ondaterangechange="dateRangeChanged(startDate,endDate);return false;"
- >
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first'
: null}" data="#{event.data}"/>
+ <schedule:schedule switchType="#{myBean.switchType}"
value="#{myBean.lazyDataModel}" var="event"
date="#{myBean.initialDate}" editable="true"
+ selectable="true" headerCenter="title"
headerLeft="prevYear,nextYear"
+ headerRight="basicDay,basicWeek agendaDay,agendaWeek
month today prev,next" eventsQueue="schedule2"
+
onbeforeitemselect="blockEvent(item,event,'onbeforeitemselect'); return
false;" onitemselect="onitemselect(item,event,view,data)"
+
onbeforeitemresize="blockEvent(item,event,'onbeforeitemresize'); return
false;"
+
onitemresize="onitemresize(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
+
onbeforeitemdrop="blockEvent(item,event,'onbeforeitemdrop'); return
false;"
+
onitemdrop="onitemdrop(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
+ onitemdragstart="onitemdragstart(item,event,ui,view);
return false;"
+ onitemdragstop="onitemdragstop(item,event,ui,view);
return false;"
+
onitemresizestart="onitemresizestart(item,event,ui,view); return false;"
+
onitemresizestop="onitemresizestop(item,event,ui,view); return false;"
onviewchange="onviewchange(view); return false;"
+
onbeforedateselect="blockEvent(date,event,'onbeforedateselect');return
false;"
+
ondateselect="ondateselect(date,allDay,event,view,data)"
+
onbeforedaterangeselect="blockEvent(startDate,endDate,'onbeforedaterangeselect');
return false;"
+
ondaterangeselect="ondaterangeselect(startDate,endDate,allDay,view,data)"
+
ondaterangechange="ondaterangechange(startDate,endDate);return false;"
onviewdisplay="onviewdisplay(view)">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
</schedule:schedule>
</h:form>
+
+ <div id="log"></div>
<!--
TODO Uncomment this once rich:insert is ready
<rich:insert src="/pages/sample_4.xhtml"
highlight="xhtml"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,48 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
- >
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
- This section will be available once it is decided how to transfer additional
data
- in RF4
- <!--
- TODO uncomment this once it is decided how to transfer additional data
- <script type="text/javascript">
- function notify(item, event, request, data) {
-
RichFaces.Notify({title:'Data',text:data,sticky:false,styleClass:'rf-ny-info'})
- }
+ <p>Click on item to fetch additional data</p>
+ <script type="text/javascript">
+ function notify(item, event, request, data) {
+ alert(item + " " + event + " " + request + "
" + data)
+ //
RichFaces.Notify({title:'Data',text:data,sticky:false,styleClass:'rf-ny-info'})
+ }
- </script>
- <h:form>
+ </script>
+ <h:form>
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}"
var="event"
- date="#{myBean.initialDate}"
- editable="true"
- selectable="true"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek
agendaDay,agendaWeek month today prev,next"
- styleClass="customFC"
- data="#{myBean.selectable}"
- ajaxSingle="true"
- reRender="editPanelContent"
-
itemSelectedListener="#{myBean.taskSelected}"
-
onItemSelectedComplete="notify(item,event,request,data)"
- >
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ?
'first' : null}" data="#{event.data}"/>
- </schedule:schedule>
- </h:form>
- <rich:insert src="/pages/sample_5.xhtml"
highlight="xhtml"/>
- -->
+ <schedule:schedule switchType="ajax"
value="#{myBean.lazyDataModel}" var="event"
date="#{myBean.initialDate}" editable="true"
selectable="true"
+ headerCenter="title"
headerLeft="prevYear,nextYear" headerRight="basicDay,basicWeek
agendaDay,agendaWeek month today prev,next"
+ styleClass="customFC"
data="#{myBean.selectable}" ajaxSingle="true"
reRender="editPanelContent"
+ itemSelectedListener="#{myBean.taskSelected}"
onitemselect="notify(item,event,view,data)">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
+ </schedule:schedule>
+ </h:form>
+ <!--<rich:insert src="/pages/sample_5.xhtml"
highlight="xhtml"/>-->
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,15 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://richfaces.org/rich"
-
xmlns:misc="http://richfaces.org/misc"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
-
xmlns:schedule="http://richfaces.org/schedule"
- >
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
This section will be available once modal panel gets implemented.
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
-
xmlns:schedule="http://richfaces.org/schedule">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
@@ -14,8 +9,7 @@
Schedule has support for internationalization.
You need to provide messages in bundle registered with JSF
as message-bundle (not resource-bundle!).
- List of available messages can be found in
- </p>
+ List of available messages can be found in </p>
<pre>
org.richfaces.component.UIScheduleMessages_en.properties
</pre>
@@ -24,8 +18,7 @@
This demo web app has additional myMessages_fr.properties with french
translation
to show how you can add custom translation.
It should be packaged in WEB-INF/classes. (Maven apps can store it in
src/main/resources)
- You also need to configure faces-config.xml like this:
- </p>
+ You also need to configure faces-config.xml like this: </p>
<pre>
<application>
<message-bundle>
@@ -43,21 +36,8 @@
<p>
Note that if you want your component work in WebKit based browsers
(i.e.:chrome,safari) you cannot use html entities in your
- messages. User numeric entities instead. i.e.: &#160; instead of
&nbsp;
- </p>
+ messages. User numeric entities instead. i.e.: &#160; instead of
&nbsp; </p>
- <p>
- Unfortunately, in JSF 2.0.2 the locale changes are visible on next request,
so
- you must refresh screen or force two ajax requests.
- </p>
-
- <p>
- Unfortunately, dynamicly generated javascript resource is not automatically
- included by JSF, so if you want to use internationalization you must add this
to your facelet:
- </p>
- <pre>
- <h:outputScript
name="org.richfaces.renderkit.html.scripts.ScheduleMessages"
target="head"/>
- </pre>
<h:form>
<h:selectOneListbox size="1"
value="#{myBean.locale}">
<f:selectItem itemValue="en" itemLabel="en"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,19 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
- >
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/pages/template.xhtml">
<!--TODO write where are messages for each language located-->
<ui:define name="body">
<p>
Try out JavaScript API. For documentation see
- <h:outputLink
-
value="http://arshaw.com/fullcalendar/docs/">http://arshaw.c...
+ <h:outputLink
value="http://arshaw.com/fullcalendar/docs/">http://arshaw.c...
</h:outputLink>
</p>
<ui:include src="schedule.xhtml">
@@ -23,14 +17,13 @@
<div>
<i>CTRL+ENTER while in textarea to execute</i>
- <textarea id="code" onkeypress="if(event.keyCode==13
&& event.ctrlKey) eval(this.value)" cols="50"
- rows="10">
+ <textarea id="code" onkeypress="if(event.keyCode==13
&& event.ctrlKey) eval(this.value)" cols="50"
rows="10">
schedule.today();
var today=new Date();
var tommorow=new
Date(today.getFullYear(),today.getMonth(),today.getDate()+1);
schedule.select(today,tommorow);
schedule.unselect();
- schedule.render();
+ schedule.refetchItems();
RichFaces.Notify({title:schedule.getView().name});
schedule.changeView("agendaWeek");
var items = schedule.getItems();
@@ -38,7 +31,7 @@
var item = items[0];
item.title = window.prompt(item.title);
schedule.updateItem(item);
- schedule.render();
+ schedule.reRender();
}
schedule.next();
</textarea>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:schedule="http://richfaces.org/schedule"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
- >
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<style type="text/css">
@@ -20,41 +15,27 @@
</style>
<h:form>
Ajax schedule
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}"
- var="event"
- styleClass="slim">
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first'
: null}" data="#{event.data}"/>
+ <schedule:schedule switchType="ajax"
value="#{myBean.lazyDataModel}" var="event"
styleClass="slim">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
</schedule:schedule>
<div class="slim right">
Server schedule
- <schedule:schedule switchType="server"
- date="#{myBean.initialDate}"
- value="#{myBean.lazyDataModel}"
- var="event"
- height="400"
- styleClass="slim right"
-
dateRangeChangeListener="#{myBean.dateRangeChanged}">
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ?
'first' : null}" data="#{event.data}"/>
+ <schedule:schedule switchType="server"
date="#{myBean.initialDate}" value="#{myBean.lazyDataModel}"
var="event" height="400"
+ styleClass="slim right"
dateRangeChangeListener="#{myBean.dateRangeChanged}">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
</schedule:schedule>
</div>
- <div style="clear:both"/>
+ <div style="clear:both"></div>
<h:commandButton value="Re render client schedule">
<f:ajax event="click"
render="clientSchedule"/>
</h:commandButton>
Client schedule
- <schedule:schedule id="clientSchedule"
- switchType="client"
- value="#{myBean.allEvents}"
- var="event">
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first'
: null}" data="#{event.data}"/>
+ <schedule:schedule id="clientSchedule"
switchType="client" value="#{myBean.allEvents}"
var="event">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
</schedule:schedule>
</h:form>
</ui:define>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,11 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:rich="http://richfaces.org/misc"
-
xmlns:schedule="http://richfaces.org/schedule">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:schedule="http://richfaces.org/sandbox/schedule">
<head>
<title></title>
</head>
@@ -13,68 +9,32 @@
<!-- mode should passed to this template as param -->
<ui:composition>
<h:form id="f">
- <schedule:schedule id="schedule"
- widgetVar="schedule"
- switchType="#{mode}"
- value="#{myBean.lazyDataModel}"
- var="event"
- weekMode="#{myBean.weekMode}"
- height="#{myBean.height}"
- date="#{myBean.initialDate}"
- firstDay="#{myBean.firstDay}"
- showWeekends="#{myBean.showWeekends}"
+ <schedule:schedule id="schedule" widgetVar="schedule"
switchType="#{mode}" value="#{myBean.lazyDataModel}"
var="event" weekMode="#{myBean.weekMode}"
+ height="#{myBean.height}"
date="#{myBean.initialDate}" firstDay="#{myBean.firstDay}"
showWeekends="#{myBean.showWeekends}"
- allDayText="#{myBean.allDayText}"
- allDayByDefault="#{myBean.allDayByDefault}"
- allDaySlot="#{myBean.allDaySlot}"
- aspectRatio="#{myBean.aspectRatio}"
- axisFormat="#{myBean.axisFormat}"
- contentHeight="#{myBean.contentHeight}"
- defaultEventMinutes="#{myBean.defaultEventMinutes}"
- dragOpacity="#{myBean.dragOpacity}"
- dragRevertDuration="#{myBean.dragRevertDuration}"
- editable="#{myBean.editable}"
- selectable="#{myBean.selectable}"
- selectHelper="#{myBean.selectHelper}"
- unselectAuto="#{myBean.unselectAuto}"
- unselectCancel="#{myBean.unselectCancel}"
- firstHour="#{myBean.firstHour}"
- headerCenter="#{myBean.headerCenter}"
- headerLeft="#{myBean.headerLeft}"
- headerRight="#{myBean.headerRight}"
- isRTL="#{myBean.isRTL}"
- maxTime="#{myBean.maxTime}"
- minTime="#{myBean.minTime}"
- slotMinutes="#{myBean.slotMinutes}"
- view="#{myBean.view}"
+ allDayText="#{myBean.allDayText}"
allDayByDefault="#{myBean.allDayByDefault}"
allDaySlot="#{myBean.allDaySlot}"
+ aspectRatio="#{myBean.aspectRatio}"
axisFormat="#{myBean.axisFormat}"
contentHeight="#{myBean.contentHeight}"
+ defaultEventMinutes="#{myBean.defaultEventMinutes}"
dragOpacity="#{myBean.dragOpacity}"
+ dragRevertDuration="#{myBean.dragRevertDuration}"
editable="#{myBean.editable}" selectable="#{myBean.selectable}"
+ selectHelper="#{myBean.selectHelper}"
unselectAuto="#{myBean.unselectAuto}"
unselectCancel="#{myBean.unselectCancel}"
+ firstHour="#{myBean.firstHour}"
headerCenter="#{myBean.headerCenter}"
headerLeft="#{myBean.headerLeft}"
+ headerRight="#{myBean.headerRight}"
isRTL="#{myBean.isRTL}" maxTime="#{myBean.maxTime}"
minTime="#{myBean.minTime}"
+ slotMinutes="#{myBean.slotMinutes}"
view="#{myBean.view}"
- columnFormat="#{myBean.columnFormat}"
- titleFormat="#{myBean.titleFormat}"
- timeFormat="#{myBean.timeFormat}"
+ columnFormat="#{myBean.columnFormat}"
titleFormat="#{myBean.titleFormat}" timeFormat="#{myBean.timeFormat}"
- itemResizeListener="#{myBean.taskResized}"
- itemMoveListener="#{myBean.taskMoved}"
- itemSelectListener="#{myBean.taskSelected}"
- viewChangeListener="#{myBean.viewChanged}"
-
dateRangeChangeListener="#{myBean.dateRangeChanged}"
-
dateRangeSelectListener="#{myBean.dateRangeSelected}"
- dateSelectListener="#{myBean.dateSelected}"
+ itemResizeListener="#{myBean.taskResized}"
itemMoveListener="#{myBean.taskMoved}"
itemSelectListener="#{myBean.taskSelected}"
+ viewChangeListener="#{myBean.viewChanged}"
dateRangeChangeListener="#{myBean.dateRangeChanged}"
+
dateRangeSelectListener="#{myBean.dateRangeSelected}"
dateSelectListener="#{myBean.dateSelected}"
-
ondaterangeselect="#{rich:component('schedule')}.unselect()"
- >
- <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}"
allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' :
null}" data="#{event.data}"/>
- <schedule:scheduleMonthView weekMode="#{myBean.weekMode}"
titleFormat="MM yy" timeFormat="h:m"
- columnFormat="dddd"
dragOpacity=".1"/>
- <schedule:scheduleAgendaDayView titleFormat="d MMM yy"
timeFormat="hh:m" columnFormat="ddd"
- dragOpacity=".3"/>
- <schedule:scheduleBasicDayView titleFormat="dd MMM yy"
timeFormat="hh:mm" columnFormat="aaa ddd"
- dragOpacity=".5"/>
- <schedule:scheduleAgendaWeekView titleFormat="dd MMM yy"
timeFormat="hh:mm" columnFormat="aaa ddd"
- dragOpacity=".7"/>
- <schedule:scheduleBasicWeekView titleFormat="bw dd MMM yy"
timeFormat="bw hh:mm" columnFormat="bw ddd"
- dragOpacity=".9"/>
+
ondaterangeselect="#{rich:component('schedule')}.unselect()">
+ <schedule:scheduleItem eventId="#{event.id}"
startDate="#{event.startDate}" title="#{event.title}"
endDate="#{event.endDate}"
+ allDay="#{event.allDay}"
styleClass="#{event.id == 1 ? 'first' : null}"
data="#{event.data}"/>
+ <schedule:scheduleMonthView weekMode="#{myBean.weekMode}"
titleFormat="MM yy" timeFormat="h:m" columnFormat="dddd"
dragOpacity=".1"/>
+ <schedule:scheduleAgendaDayView titleFormat="d MMM yy"
timeFormat="hh:m" columnFormat="ddd" dragOpacity=".3"/>
+ <schedule:scheduleBasicDayView titleFormat="dd MMM yy"
timeFormat="hh:mm" columnFormat="aaa ddd"
dragOpacity=".5"/>
+ <schedule:scheduleAgendaWeekView titleFormat="dd MMM yy"
timeFormat="hh:mm" columnFormat="aaa ddd"
dragOpacity=".7"/>
+ <schedule:scheduleBasicWeekView titleFormat="bw dd MMM yy"
timeFormat="bw hh:mm" columnFormat="bw ddd"
dragOpacity=".9"/>
<!--
TODO uncomment this
<schedule:itemSelectedListener
binding="#{myBean.additionalListener}"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,8 +1,5 @@
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:a4j="http://richfaces.org/a4j">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
<h:form styleClass="settingsPanel">
<h:panelGrid columns="2">
<h:outputLabel value="Allow task moving"
for="allowTaskMoving"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml 2011-04-15
12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,11 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
<f:view locale="#{myBean.locale}">
<h:head>
<style type="text/css">
@@ -34,9 +30,9 @@
</style>
</h:head>
<h:body styleClass="rich-container">
+ <!--<script type="text/javascript"
src="#{request.contextPath}/schedule.js"></script>-->
<ui:include src="menu.xhtml"/>
<ui:insert name="body">Body</ui:insert>
- <h:outputScript
name="org.richfaces.renderkit.html.scripts.ScheduleMessages"
target="head"/>
</h:body>
</f:view>
</html>
\ No newline at end of file
Modified: sandbox/trunk/ui/schedule/parent/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/parent/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/parent/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
Inc. and individual contributors by the @authors tag. See the
copyright.txt in the distribution for a full listing of
@@ -25,31 +24,29 @@
<parent>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>7</version>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
<name>Richfaces UI Components: schedule parent</name>
<packaging>pom</packaging>
<properties>
<richfaces.checkstyle.version>1</richfaces.checkstyle.version>
-
<org.richfaces.cdk.version>4.0.0-SNAPSHOT</org.richfaces.cdk.version>
+
<org.richfaces.cdk.version>4.1.0-SNAPSHOT</org.richfaces.cdk.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-bom</artifactId>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>schedule-bom</artifactId>
<version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
-
<dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
@@ -83,98 +80,24 @@
<version>2.0-alpha-4</version>
<extensions>true</extensions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-build-checkstyle</artifactId>
- <version>${richfaces.checkstyle.version}</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- <configuration>
- <library>
- <prefix>org.richfaces</prefix>
- <taglib>
- <
uri>http://richfaces.org/schedule</uri>
- <shortName>schedule</shortName>
- <displayName>schedule component
tags</displayName>
- </taglib>
- </library>
- </configuration>
- <executions>
- <execution>
- <id>cdk-generate-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
</build>
- <profiles>
- <profile>
- <id>release</id>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+
<url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <javadocVersion>1.5</javadocVersion>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-javadoc</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <configuration>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
Modified: sandbox/trunk/ui/schedule/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
+<?xml version="1.0" encoding="UTF-8"?><!--
JBoss, Home of Professional Open Source
Copyright , Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -27,16 +26,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>9</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>parent/pom.xml</relativePath>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-aggregator</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <artifactId>schedule-aggregator</artifactId>
<packaging>pom</packaging>
- <name>Richfaces UI Components: Schedule Aggregator</name>
+ <name>Richfaces UI Components: schedule Aggregator</name>
<modules>
<module>bom</module>
@@ -45,54 +43,30 @@
<module>demo</module>
</modules>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!--
- The dist requires clean install for prepare
- -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
+ <profiles>
+ <profile>
+ <id>cli</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>1.0.6-SNAPSHOT</version>
+ <configuration>
+ <userAliases>
+ <ui>schedule clean install</ui>
+ <demo>schedule-demo clean package</demo>
+ </userAliases>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!-- The dist requires clean install for
prepare -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui-sa...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root...
- </developerConnection>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/sandbox/tr...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/sand...
<
url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
Modified: sandbox/trunk/ui/schedule/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/ui/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,176 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
-
xmlns="http://maven.apache.org/POM/4.0.0"
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-ui</artifactId>
+ <artifactId>schedule-ui</artifactId>
<name>Richfaces UI Components: schedule ui</name>
- <dependencyManagement>
- <!--
- <dependencies>
- <dependency>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>richfaces-ui-misc-bom</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.richfaces.ui.core</groupId>
- <artifactId>richfaces-ui-core-ui</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- -->
- </dependencyManagement>
-
<dependencies>
-
<dependency>
<groupId>org.richfaces.ui.core</groupId>
<artifactId>richfaces-ui-core-ui</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
<scope>provided</scope>
</dependency>
-
- <!-- JSF with dependencies -->
<dependency>
- <groupId>${jsf2.api.groupid}</groupId>
- <artifactId>${jsf2.api.artifactid}</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
+ <artifactId>jstl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>${jsf2.impl.groupid}</groupId>
- <artifactId>${jsf2.impl.artifactid}</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- <version>${org.richfaces.cdk.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.1</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xml-maven-plugin</artifactId>
- <version>1.0-beta-2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </pluginManagement>
-
<plugins>
<plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-build-checkstyle</artifactId>
- <version>${richfaces.checkstyle.version}</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
-
- <plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
- <configuration>
- <library>
- <prefix>org.richfaces</prefix>
- <taglib>
- <
uri>http://richfaces.org/schedule</uri>
- <shortName>schedule</shortName>
- <displayName>schedule component
tags</displayName>
- </taglib>
- </library>
- </configuration>
<executions>
<execution>
<id>cdk-generate-sources</id>
@@ -206,48 +86,4 @@
</plugins>
</build>
- <profiles>
- <profile>
- <id>release</id>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <javadocVersion>1.5</javadocVersion>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-javadoc</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <configuration>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
Modified:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java 2011-04-15
13:42:33 UTC (rev 22424)
@@ -21,42 +21,12 @@
*/
package org.richfaces.component;
-import java.io.IOException;
-import java.sql.ResultSet;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesEvent;
-import javax.faces.model.ArrayDataModel;
-import javax.faces.model.DataModel;
-import javax.faces.model.ListDataModel;
-import javax.faces.model.ResultDataModel;
-import javax.faces.model.ResultSetDataModel;
-import javax.faces.model.ScalarDataModel;
-import javax.servlet.jsp.jstl.sql.Result;
-
-import org.ajax4jsf.component.AjaxComponent;
-import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.model.DataVisitResult;
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Description;
+import org.richfaces.cdk.annotations.Event;
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
@@ -75,274 +45,326 @@
import org.richfaces.component.event.ScheduleItemResizeListener;
import org.richfaces.component.event.ScheduleItemSelectEvent;
import org.richfaces.component.event.ScheduleItemSelectListener;
-import org.richfaces.component.event.ScheduleListenerEventsProducer;
import org.richfaces.component.event.ScheduleViewChangeEvent;
import org.richfaces.component.event.ScheduleViewChangeListener;
import org.richfaces.component.model.DateRange;
+import org.richfaces.context.ExtendedPartialViewContext;
+import org.richfaces.renderkit.ScheduleRendererBase;
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+import javax.faces.model.ArrayDataModel;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+import javax.faces.model.ResultDataModel;
+import javax.faces.model.ResultSetDataModel;
+import javax.faces.model.ScalarDataModel;
+import javax.servlet.jsp.jstl.sql.Result;
+import java.sql.ResultSet;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
/**
* Base class for generation of UISchedule component.
*
* @author Bernard Labno
*/
@JsfComponent(tag = @Tag(name = "schedule",
- handler = "org.richfaces.view.facelets.html.ScheduleHandler",
- generate = true,
- type = TagType.Facelets),
- renderer = @JsfRenderer(family = AbstractSchedule.COMPONENT_FAMILY, type =
"org.richfaces.ScheduleRenderer"))
-public abstract class AbstractSchedule extends UIComponentBase
- implements ScheduleCommonViewAttributes, ScheduleListenerEventsProducer,
AjaxComponent {
+ handler = "org.richfaces.view.facelets.html.ScheduleTagHandler",
+ generate = true,
+ type = TagType.Facelets),
+ renderer = @JsfRenderer(family = AbstractSchedule.COMPONENT_FAMILY, type =
ScheduleRendererBase.RENDERER_TYPE),
+ fires = {
+ @Event(value = ScheduleDateRangeChangeEvent.class, listener =
ScheduleDateRangeChangeListener.class),
+ @Event(value = ScheduleDateRangeSelectEvent.class, listener =
ScheduleDateRangeSelectListener.class),
+ @Event(value = ScheduleDateSelectEvent.class, listener =
ScheduleDateSelectListener.class),
+ @Event(value = ScheduleItemMoveEvent.class, listener =
ScheduleItemMoveListener.class),
+ @Event(value = ScheduleItemResizeEvent.class, listener =
ScheduleItemResizeListener.class),
+ @Event(value = ScheduleItemSelectEvent.class, listener =
ScheduleItemSelectListener.class),
+ @Event(value = ScheduleViewChangeEvent.class, listener =
ScheduleViewChangeListener.class)
+ }
+)
+public abstract class AbstractSchedule extends UIComponentBase implements
ScheduleCommonViewAttributes {
+// ------------------------------ FIELDS ------------------------------
- public static final String COMPONENT_TYPE = "org.richfaces.Schedule";
public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Schedule";
+
/**
- * Values of view attribute.
+ * Values of switchType attribute
*/
- public static final String VIEW_MONTH = "month";
- public static final String VIEW_BASIC_WEEK = "basicWeek";
+ public static final String SWITCH_TYPE_AJAX = "ajax";
+
+ public static final String SWITCH_TYPE_CLIENT = "client";
+
+ public static final String SWITCH_TYPE_SERVER = "server";
+
+ public static final String VIEW_AGENDA_DAY = "agendaDay";
+
public static final String VIEW_AGENDA_WEEK = "agendaWeek";
+
public static final String VIEW_BASIC_DAY = "basicDay";
- public static final String VIEW_AGENDA_DAY = "agendaDay";
- public static final String DEFAULT_VIEW = VIEW_MONTH;
+
+ public static final String VIEW_BASIC_WEEK = "basicWeek";
+
/**
- * Values of switchType attribute
+ * Values of view attribute.
*/
- public static final String SWITCH_TYPE_AJAX = "ajax";
- public static final String SWITCH_TYPE_SERVER = "server";
- public static final String SWITCH_TYPE_CLIENT = "client";
- public static final String DEFAULT_SWITCH_TYPE = SWITCH_TYPE_AJAX;
+ public static final String VIEW_MONTH = "month";
+
/**
* Values of weekMode attribute.
*/
public static final String WEEK_MODE_FIXED = "fixed";
+
public static final String WEEK_MODE_LIQUID = "liquid";
+
public static final String WEEK_MODE_VARIABLE = "variable";
- public static final String DEFAULT_WEEK_MODE = WEEK_MODE_FIXED;
- public static final boolean DEFAULT_SHOW_WEEKENDS = true;
- public static final boolean DEFAULT_RTL = false;
- public static final int DEFAULT_FIRST_DAY = Calendar.SUNDAY;
- public static final double DEFAULT_ASPECT_RATIO = 1.35;
- public static final boolean DEFAULT_ALL_DAY_SLOT = true;
- public static final String DEFAULT_AXIS_FORMAT = "h(:mm)tt";
- public static final int DEFAULT_SLOT_MINUTES = 30;
- public static final int DEFAULT_EVENT_MINUTES = 120;
- public static final int DEFAULT_FIRST_HOUR = 6;
- public static final String DEFAULT_MIN_TIME = "0";
- public static final String DEFAULT_MAX_TIME = "24";
- public static final boolean DEFAULT_EDITABLE = false;
- public static final boolean DEFAULT_SELECTABLE = false;
- public static final boolean DEFAULT_SELECT_HELPER = false;
- public static final boolean DEFAULT_UNSELECT_AUTO = true;
- public static final String DEFAULT_UNSELECT_CANCEL = "";
- public static final boolean DEFAULT_DISABLE_DRAGGING = false;
- public static final boolean DEFAULT_DISABLE_RESIZING = false;
- public static final int DEFAULT_DRAG_REVERT_DURATION = 500;
- public static final double DEFAULT_DRAG_OPACITY = .3;
+
public static final boolean DEFAULT_ALL_DAY_DEFAULT = true;
- private DataModel model;
- @Attribute
- public abstract Object getValue();
+ public static final boolean DEFAULT_ALL_DAY_SLOT = true;
- @Attribute
- public abstract String getVar();
+ public static final double DEFAULT_ASPECT_RATIO = 1.35;
- @Attribute
- public abstract Date getDate();
+ public static final boolean DEFAULT_AUTO_REFRESH_ON_DATE_RANGE_SELECT = true;
- public abstract void setDate(Date date);
+ public static final String DEFAULT_AXIS_FORMAT = "h(:mm)tt";
- @Attribute(defaultValue = "SwitchType." + DEFAULT_SWITCH_TYPE,
- suggestedValue = SWITCH_TYPE_AJAX + "," + SWITCH_TYPE_SERVER +
"," + SWITCH_TYPE_CLIENT)
- public abstract SwitchType getSwitchType();
+ public static final boolean DEFAULT_DISABLE_DRAGGING = false;
- @Attribute(defaultValue = DEFAULT_VIEW,
- suggestedValue = VIEW_MONTH
- + "," + VIEW_AGENDA_DAY
- + "," + VIEW_AGENDA_WEEK
- + "," + VIEW_BASIC_DAY + "," + VIEW_BASIC_WEEK)
- public abstract String getView();
+ public static final boolean DEFAULT_DISABLE_RESIZING = false;
- public abstract void setView(String view);
+ public static final double DEFAULT_DRAG_OPACITY = .3;
- @Attribute
- public abstract String getHeaderLeft();
+ public static final int DEFAULT_DRAG_REVERT_DURATION = 500;
- @Attribute
- public abstract String getHeaderCenter();
+ public static final boolean DEFAULT_EDITABLE = false;
- @Attribute
- public abstract String getHeaderRight();
+ public static final int DEFAULT_EVENT_MINUTES = 120;
- @Attribute(defaultValue = "" + DEFAULT_FIRST_DAY,
- description = @Description("First day of week. 1 - sunday, 2 - monday,..,7 -
saturday."))
- public abstract Integer getFirstDay();
+ public static final int DEFAULT_FIRST_DAY = Calendar.SUNDAY;
- public abstract void setFirstDay(Integer firstDay);
+ public static final int DEFAULT_FIRST_HOUR = 6;
- @Attribute(defaultValue = "" + DEFAULT_RTL)
- public abstract Boolean isRTL();
+ public static final String DEFAULT_MAX_TIME = "24";
- @Attribute(defaultValue = "" + DEFAULT_SHOW_WEEKENDS)
- public abstract Boolean isShowWeekends();
+ public static final String DEFAULT_MIN_TIME = "0";
- public abstract void setShowWeekends(Boolean showWeekends);
+ public static final boolean DEFAULT_RTL = false;
- @Attribute(defaultValue = DEFAULT_WEEK_MODE,
- suggestedValue = WEEK_MODE_FIXED + "," + WEEK_MODE_LIQUID +
"," + WEEK_MODE_VARIABLE)
- public abstract String getWeekMode();
+ public static final boolean DEFAULT_SELECTABLE = false;
- @Attribute
- public abstract Integer getHeight();
+ public static final boolean DEFAULT_SELECT_HELPER = false;
- @Attribute
- public abstract Integer getContentHeight();
+ public static final boolean DEFAULT_SHOW_WEEKENDS = true;
- @Attribute(defaultValue = "" + DEFAULT_ASPECT_RATIO)
- public abstract Double getAspectRatio();
+ public static final int DEFAULT_SLOT_MINUTES = 30;
- @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_DEFAULT)
- public abstract Boolean isAllDayByDefault();
+ public static final String DEFAULT_SWITCH_TYPE = SWITCH_TYPE_AJAX;
- @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_SLOT)
- public abstract Boolean isAllDaySlot();
+ public static final boolean DEFAULT_UNSELECT_AUTO = true;
- @Attribute
- public abstract String getAllDayText();
+ public static final String DEFAULT_UNSELECT_CANCEL = "";
- @Attribute(defaultValue = DEFAULT_AXIS_FORMAT)
- public abstract String getAxisFormat();
+ public static final String DEFAULT_VIEW = VIEW_MONTH;
- @Attribute(defaultValue = "" + DEFAULT_SLOT_MINUTES)
- public abstract Integer getSlotMinutes();
+ public static final String DEFAULT_WEEK_MODE = WEEK_MODE_FIXED;
- @Attribute(defaultValue = "" + DEFAULT_EVENT_MINUTES)
- public abstract Integer getDefaultEventMinutes();
+ private DataModel model;
- @Attribute(defaultValue = "" + DEFAULT_FIRST_HOUR)
- public abstract Integer getFirstHour();
+// -------------------------- STATIC METHODS --------------------------
- @Attribute(defaultValue = DEFAULT_MIN_TIME)
- public abstract String getMinTime();
+ /**
+ * Tells value of firstDay. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of firstDay
+ */
+ public static int getFirstDay(AbstractSchedule schedule) {
+ Integer firstDay = schedule.getFirstDay();
+ return firstDay == null ? AbstractSchedule.DEFAULT_FIRST_DAY : firstDay;
+ }
- @Attribute(defaultValue = DEFAULT_MAX_TIME)
- public abstract String getMaxTime();
+ /**
+ * Gets first displayed day on schedule. This is used mainly when schedule
+ * is in ajax or server mode to calculate initial events daterange.
+ * Initial events are sent during first render in order to avoid extra
+ * ajax request right after first render.
+ *
+ * @param schedule schedule configuration for which date is calculated
+ * @return first day displayed on schedule
+ */
+ public static Date getFirstDisplayedDay(AbstractSchedule schedule) {
+ Calendar calendar = Calendar.getInstance();
+ Date date = schedule.getDate();
+ if (date != null) {
+ calendar.setTime(date);
+ }
+ int firstDayOfWeek = getFirstDay(schedule);
+ calendar.setFirstDayOfWeek(firstDayOfWeek);
+ String view = getView(schedule);
+ boolean showWeekends = isShowWeekends(schedule);
+ if (VIEW_MONTH.equals(view)) {
+ calendar.set(Calendar.DATE, 1);
+ if (!showWeekends) {
+ int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if (dayOfWeek == Calendar.SUNDAY) {
+ calendar.add(Calendar.DATE, 1);
+ } else if (dayOfWeek == Calendar.SATURDAY) {
+ calendar.add(Calendar.DATE, 2);
+ }
+ }
+ if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
+ firstDayOfWeek++;
+ }
+ /**
+ * Following 1 line is a fix to what i believe is a bug of
java.util.Calendar
+ */
+ calendar.get(Calendar.DAY_OF_WEEK);
+ calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
+ calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
+ if (!showWeekends) {
+ int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if (dayOfWeek == Calendar.SUNDAY) {
+ calendar.add(Calendar.DATE, 1);
+ } else if (dayOfWeek == Calendar.SATURDAY) {
+ calendar.add(Calendar.DATE, 2);
+ }
+ }
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
+ return calendar.getTime();
+ } else {
+ throw new IllegalStateException("Invalid view attribute: " +
view);
+ }
+ }
- @Attribute(defaultValue = "" + DEFAULT_EDITABLE)
- public abstract Boolean isEditable();
+ /**
+ * Gets last displayed day on schedule.
+ *
+ * @param schedule schedule configuration for which date is calculated
+ * @return last day displayed on schedule
+ * @see
AbstractSchedule#getFirstDisplayedDay(org.richfaces.component.AbstractSchedule)
+ */
+ public static Date getLastDisplayedDate(AbstractSchedule schedule) {
+ Calendar calendar = Calendar.getInstance();
+ int firstDayOfWeek = getFirstDay(schedule);
+ String view = getView(schedule);
+ boolean showWeekends = isShowWeekends(schedule);
+ if (VIEW_MONTH.equals(view)) {
+ if (WEEK_MODE_FIXED.equals(getWeekMode(schedule))) {
+ calendar.setTime(getFirstDisplayedDay(schedule));
+ calendar.add(Calendar.DAY_OF_YEAR, 42);
+ } else {
+ Date date = schedule.getDate();
+ if (date != null) {
+ calendar.setTime(date);
+ }
- @Attribute(defaultValue = "" + DEFAULT_SELECTABLE)
- public abstract Boolean isSelectable();
+ if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
+ firstDayOfWeek++;
+ }
+ calendar.setFirstDayOfWeek(firstDayOfWeek);
+ calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
+ int dayOfWeek = firstDayOfWeek + 6;
+ if (dayOfWeek > Calendar.SATURDAY) {
+ dayOfWeek -= 7;
+ }
+ /**
+ * Following 1 line is a fix to what i believe is a bug of
java.util.Calendar
+ */
+ calendar.get(Calendar.DAY_OF_WEEK);
+ calendar.set(Calendar.DAY_OF_WEEK, dayOfWeek);
+ calendar.add(Calendar.DATE, 1);
+ }
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
+ calendar.setFirstDayOfWeek(firstDayOfWeek);
+ calendar.setTime(getFirstDisplayedDay(schedule));
+ calendar.add(Calendar.DATE, 7);
+ if (!showWeekends) {
+ int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if (dayOfWeek - 1 == Calendar.SUNDAY) {
+ calendar.add(Calendar.DATE, -2);
+ } else if (dayOfWeek - 1 == Calendar.SATURDAY) {
+ calendar.add(Calendar.DATE, -1);
+ }
+ }
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
+ calendar.setTime(getFirstDisplayedDay(schedule));
+ calendar.add(Calendar.DATE, 1);
+ return calendar.getTime();
+ } else {
+ throw new IllegalStateException("Invalid view attribute: " +
view);
+ }
+ }
- @Attribute(defaultValue = "" + DEFAULT_SELECT_HELPER)
- public abstract Boolean isSelectHelper();
+ /**
+ * Tells value of view. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of view
+ */
+ public static String getView(AbstractSchedule schedule) {
+ String view = schedule.getView();
+ return view == null ? AbstractSchedule.DEFAULT_VIEW : view;
+ }
- @Attribute(defaultValue = "" + DEFAULT_UNSELECT_AUTO)
- public abstract Boolean isUnselectAuto();
+ /**
+ * Tells value of weekMode. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of weekMode
+ */
+ public static String getWeekMode(AbstractSchedule schedule) {
+ String weekMode = schedule.getWeekMode();
+ return weekMode == null ? AbstractSchedule.DEFAULT_WEEK_MODE : weekMode;
+ }
- @Attribute(defaultValue = DEFAULT_UNSELECT_CANCEL)
- public abstract String getUnselectCancel();
+ /**
+ * Tells if showWeekends is true or false. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of showWeekends
+ */
+ public static boolean isShowWeekends(AbstractSchedule schedule) {
+ Boolean showWeekends = schedule.isShowWeekends();
+ return showWeekends == null ? AbstractSchedule.DEFAULT_SHOW_WEEKENDS :
schedule.isShowWeekends();
+ }
- @Attribute(defaultValue = "" + DEFAULT_DISABLE_DRAGGING)
- public abstract Boolean isDisableDragging();
+// ------------------------ INTERFACE METHODS ------------------------
- @Attribute(defaultValue = "" + DEFAULT_DISABLE_RESIZING)
- public abstract Boolean isDisableResizing();
- @Attribute(defaultValue = "" + DEFAULT_DRAG_REVERT_DURATION)
- public abstract Integer getDragRevertDuration();
+// --------------------- Interface ScheduleCommonViewAttributes ---------------------
@Attribute(defaultValue = "" + DEFAULT_DRAG_OPACITY)
public abstract Double getDragOpacity();
- @Attribute
- public abstract String getStyleClass();
+// -------------------------- OTHER METHODS --------------------------
- @Attribute(events = @EventName("beforeitemselect"))
- public abstract String getOnbeforeitemselect();
-
- @Attribute(events = @EventName("itemselect"))
- public abstract String getOnitemselect();
-
- @Attribute(events = @EventName("itemdragstart"))
- public abstract String getOnitemdragstart();
-
- @Attribute(events = @EventName("itemdragstop"))
- public abstract String getOnitemdragstop();
-
- @Attribute(events = @EventName("beforeitemdrop"))
- public abstract String getOnbeforeitemdrop();
-
- @Attribute(events = @EventName("itemdrop"))
- public abstract String getOnitemdrop();
-
- @Attribute(events = @EventName("itemresizestart"))
- public abstract String getOnitemresizestart();
-
- @Attribute(events = @EventName("itemresizestop"))
- public abstract String getOnitemresizestop();
-
- @Attribute(events = @EventName("beforeitemresize"))
- public abstract String getOnbeforeitemresize();
-
- @Attribute(events = @EventName("itemresize"))
- public abstract String getOnitemresize();
-
- @Attribute(events = @EventName("itemmouseover"))
- public abstract String getOnitemmouseover();
-
- @Attribute(events = @EventName("itemmouseout"))
- public abstract String getOnitemmouseout();
-
- @Attribute(events = @EventName("viewchange"))
- public abstract String getOnviewchange();
-
- @Attribute(events = @EventName("beforedateselect"))
- public abstract String getOnbeforedateselect();
-
- @Attribute(events = @EventName("dateselect"))
- public abstract String getOndateselect();
-
- @Attribute(events = @EventName("beforedaterangeselect"))
- public abstract String getOnbeforedaterangeselect();
-
- @Attribute(events = @EventName("daterangeselect"))
- public abstract String getOndaterangeselect();
-
- @Attribute(events = @EventName("daterangechange"))
- public abstract String getOndaterangechange();
-
- @Attribute(signature = @Signature(parameters = ScheduleItemMoveEvent.class,
returnType = Boolean.class))
- public abstract MethodExpression getItemMoveListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleItemSelectEvent.class))
- public abstract MethodExpression getItemSelectListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleItemResizeEvent.class,
returnType = Boolean.class))
- public abstract MethodExpression getItemResizeListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleViewChangeEvent.class))
- public abstract MethodExpression getViewChangeListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleDateRangeChangeEvent.class))
- public abstract MethodExpression getDateRangeChangeListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleDateRangeSelectEvent.class))
- public abstract MethodExpression getDateRangeSelectListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleDateSelectEvent.class))
- public abstract MethodExpression getDateSelectListener();
-
- @Attribute
- public abstract String getWidgetVar();
-
- private void setResponseData(Object data) {
- FacesContext facesContext = getFacesContext();
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
-
- ajaxContext.getResponseComponentDataMap().put(getClientId(facesContext), data);
- }
-
/**
* React on various events.
* Vetoable events are first broadcasted to listeners bound via EL to
@@ -373,11 +395,7 @@
if (expression != null) {
expression.invoke(facesContext.getELContext(), new Object[]{event});
}
- try {
- setResponseData(getScheduleData(calendarAjaxEvent.getStartDate(),
calendarAjaxEvent.getEndDate()));
- } catch (IOException ex) {
- getFacesContext().getExternalContext().log("Cannot get schedule
data", ex);
- }
+ setResponseData(getScheduleData(calendarAjaxEvent.getStartDate(),
calendarAjaxEvent.getEndDate()));
} else if (event instanceof ScheduleItemMoveEvent) {
FacesContext facesContext = getFacesContext();
MethodExpression expression = getItemMoveListener();
@@ -426,48 +444,143 @@
if (expression != null) {
expression.invoke(facesContext.getELContext(), new Object[]{event});
}
-// } else if (event instanceof AjaxEvent) {
-// FacesContext context = getFacesContext();
-// // complete re-Render fields. AjaxEvent deliver before render
-// // response.
-// AjaxContext.getCurrentInstance(context).addRegionsFromComponent(this);
-// // Put data for send in response
-// Object data = getData();
-// AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
-// if (null != data) {
-// ajaxContext.setResponseData(data);
-// }
-// String focus = getFocus();
-// if (null != focus) {
-// // search for component in tree.
-// // XXX - use more pourful search, as in h:outputLabel
-// // component.
-//// UIComponent focusComponent = RendererUtils.getInstance().
-//// findComponentFor(this, focus);
-//// if (null != focusComponent) {
-//// focus = focusComponent.getClientId(context);
-//// }
-//// TODO put focus data here
-////
ajaxContext.getResponseDataMap().put(AjaxActionComponent.FOCUS_DATA_ID, focus);
-// }
-// ajaxContext.setOncomplete(getOncomplete());
} else {
super.broadcast(event);
}
}
+ @Attribute
+ public abstract String getAllDayText();
+
+ @Attribute(defaultValue = "" + DEFAULT_ASPECT_RATIO)
+ public abstract Double getAspectRatio();
+
+ @Attribute(defaultValue = DEFAULT_AXIS_FORMAT)
+ public abstract String getAxisFormat();
+
+ @Attribute
+ public abstract Integer getContentHeight();
+
+ @Attribute
+ public abstract Date getDate();
+
+ @Attribute(signature = @Signature(parameters = ScheduleDateRangeChangeEvent.class))
+ public abstract MethodExpression getDateRangeChangeListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleDateRangeSelectEvent.class))
+ public abstract MethodExpression getDateRangeSelectListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleDateSelectEvent.class))
+ public abstract MethodExpression getDateSelectListener();
+
+ @Attribute(defaultValue = "" + DEFAULT_EVENT_MINUTES)
+ public abstract Integer getDefaultEventMinutes();
+
+ @Attribute(defaultValue = "" + DEFAULT_DRAG_REVERT_DURATION)
+ public abstract Integer getDragRevertDuration();
+
+ @Attribute(defaultValue = "" + DEFAULT_FIRST_DAY,
+ description = @Description("First day of week. 1 - sunday, 2 - monday,..,7 -
saturday."))
+ public abstract Integer getFirstDay();
+
+ @Attribute(defaultValue = "" + DEFAULT_FIRST_HOUR)
+ public abstract Integer getFirstHour();
+
+ @Attribute
+ public abstract String getHeaderCenter();
+
+ @Attribute
+ public abstract String getHeaderLeft();
+
+ @Attribute
+ public abstract String getHeaderRight();
+
+ @Attribute
+ public abstract Integer getHeight();
+
+ @Attribute(signature = @Signature(parameters = ScheduleItemMoveEvent.class,
returnType = Boolean.class))
+ public abstract MethodExpression getItemMoveListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleItemResizeEvent.class,
returnType = Boolean.class))
+ public abstract MethodExpression getItemResizeListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleItemSelectEvent.class))
+ public abstract MethodExpression getItemSelectListener();
+
+ @Attribute(defaultValue = DEFAULT_MAX_TIME)
+ public abstract String getMaxTime();
+
+ @Attribute(defaultValue = DEFAULT_MIN_TIME)
+ public abstract String getMinTime();
+
+ @Attribute(events = @EventName("beforedaterangeselect"))
+ public abstract String getOnbeforedaterangeselect();
+
+ @Attribute(events = @EventName("beforedateselect"))
+ public abstract String getOnbeforedateselect();
+
+ @Attribute(events = @EventName("beforeitemdrop"))
+ public abstract String getOnbeforeitemdrop();
+
+ @Attribute(events = @EventName("beforeitemresize"))
+ public abstract String getOnbeforeitemresize();
+
+ @Attribute(events = @EventName("beforeitemselect"))
+ public abstract String getOnbeforeitemselect();
+
+ @Attribute(events = @EventName("daterangechange"))
+ public abstract String getOndaterangechange();
+
+ @Attribute(events = @EventName("daterangeselect"))
+ public abstract String getOndaterangeselect();
+
+ @Attribute(events = @EventName(value = "dateselect", defaultEvent = true))
+ public abstract String getOndateselect();
+
+ @Attribute(events = @EventName("itemdragstart"))
+ public abstract String getOnitemdragstart();
+
+ @Attribute(events = @EventName("itemdragstop"))
+ public abstract String getOnitemdragstop();
+
+ @Attribute(events = @EventName("itemdrop"))
+ public abstract String getOnitemdrop();
+
+ @Attribute(events = @EventName("itemmouseout"))
+ public abstract String getOnitemmouseout();
+
+ @Attribute(events = @EventName("itemmouseover"))
+ public abstract String getOnitemmouseover();
+
+ @Attribute(events = @EventName("itemresize"))
+ public abstract String getOnitemresize();
+
+ @Attribute(events = @EventName("itemresizestart"))
+ public abstract String getOnitemresizestart();
+
+ @Attribute(events = @EventName("itemresizestop"))
+ public abstract String getOnitemresizestop();
+
+ @Attribute(events = @EventName("itemselect"))
+ public abstract String getOnitemselect();
+
+ @Attribute(events = @EventName("viewchange"))
+ public abstract String getOnviewchange();
+
+ @Attribute(events = @EventName("viewdisplay"))
+ public abstract String getOnviewdisplay();
+
/**
* Gets data from provided data model within given range.
* Range is [startDate;endDate), which means that start date is inclusive
* and end date is exclusive.
* Data are in form of list of maps, which is ready to serialize to JSON.
*
- * @param startDate
- * @param endDate
- * @return
- * @throws IOException
+ * @param startDate date of earliest item
+ * @param endDate date of lates item
+ * @return list of items as map of their properties
*/
- public List<Map<String, Object>> getScheduleData(Date startDate, Date
endDate) throws IOException {
+ public List<Map<String, Object>> getScheduleData(Date startDate, Date
endDate) {
/**
* Locale must be US because this is the format the javascript widget supports
*/
@@ -528,175 +641,93 @@
return data;
}
- /**
- * Gets first displayed day on schedule. This is used mainly when schedule
- * is in ajax or server mode to calculate initial events daterange.
- * Initial events are sent during first render in order to avoid extra
- * ajax request right after first render.
- *
- * @param schedule schedule configuration for which date is calculated
- * @return first day displayed on schedule
- */
- public static Date getFirstDisplayedDay(AbstractSchedule schedule) {
- Calendar calendar = Calendar.getInstance();
- Date date = schedule.getDate();
- if (date != null) {
- calendar.setTime(date);
- }
- int firstDayOfWeek = getFirstDay(schedule);
- calendar.setFirstDayOfWeek(firstDayOfWeek);
- String view = getView(schedule);
- boolean showWeekends = isShowWeekends(schedule);
- if (VIEW_MONTH.equals(view)) {
- calendar.set(Calendar.DATE, 1);
- if (!showWeekends) {
- int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
- if (dayOfWeek == Calendar.SUNDAY) {
- calendar.add(Calendar.DATE, 1);
- } else if (dayOfWeek == Calendar.SATURDAY) {
- calendar.add(Calendar.DATE, 2);
- }
- }
- if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
- firstDayOfWeek++;
- }
- /**
- * Following 1 line is a fix to what i believe is a bug of
java.util.Calendar
- */
- calendar.get(Calendar.DAY_OF_WEEK);
- calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
- return calendar.getTime();
- } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
- calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
- if (!showWeekends) {
- int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
- if (dayOfWeek == Calendar.SUNDAY) {
- calendar.add(Calendar.DATE, 1);
- } else if (dayOfWeek == Calendar.SATURDAY) {
- calendar.add(Calendar.DATE, 2);
- }
- }
- return calendar.getTime();
- } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
- return calendar.getTime();
- } else {
- throw new IllegalStateException("Invalid view attribute: " +
view);
- }
- }
+ @Attribute(defaultValue = "" + DEFAULT_SLOT_MINUTES)
+ public abstract Integer getSlotMinutes();
- /**
- * Gets last displayed day on schedule.
- *
- * @param schedule schedule configuration for which date is calculated
- * @return last day displayed on schedule
- * @see
AbstractSchedule#getFirstDisplayedDay(org.richfaces.component.AbstractSchedule)
- */
- public static Date getLastDisplayedDate(AbstractSchedule schedule) {
- Calendar calendar = Calendar.getInstance();
- int firstDayOfWeek = getFirstDay(schedule);
- String view = getView(schedule);
- boolean showWeekends = isShowWeekends(schedule);
- if (VIEW_MONTH.equals(view)) {
- if (WEEK_MODE_FIXED.equals(getWeekMode(schedule))) {
- calendar.setTime(getFirstDisplayedDay(schedule));
- calendar.add(Calendar.DAY_OF_YEAR, 42);
- } else {
- Date date = schedule.getDate();
- if (date != null) {
- calendar.setTime(date);
- }
+ @Attribute
+ public abstract String getStyleClass();
- if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
- firstDayOfWeek++;
- }
- calendar.setFirstDayOfWeek(firstDayOfWeek);
- calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
- int dayOfWeek = firstDayOfWeek + 6;
- if (dayOfWeek > Calendar.SATURDAY) {
- dayOfWeek -= 7;
- }
- /**
- * Following 1 line is a fix to what i believe is a bug of
java.util.Calendar
- */
- calendar.get(Calendar.DAY_OF_WEEK);
- calendar.set(Calendar.DAY_OF_WEEK, dayOfWeek);
- calendar.add(Calendar.DATE, 1);
- }
- return calendar.getTime();
- } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
- calendar.setFirstDayOfWeek(firstDayOfWeek);
- calendar.setTime(getFirstDisplayedDay(schedule));
- calendar.add(Calendar.DATE, 7);
- if (!showWeekends) {
- int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
- if (dayOfWeek - 1 == Calendar.SUNDAY) {
- calendar.add(Calendar.DATE, -2);
- } else if (dayOfWeek - 1 == Calendar.SATURDAY) {
- calendar.add(Calendar.DATE, -1);
- }
- }
- return calendar.getTime();
- } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
- calendar.setTime(getFirstDisplayedDay(schedule));
- calendar.add(Calendar.DATE, 1);
- return calendar.getTime();
- } else {
- throw new IllegalStateException("Invalid view attribute: " +
view);
- }
+ @Attribute(defaultValue = "SwitchType." + DEFAULT_SWITCH_TYPE,
+ suggestedValue = SWITCH_TYPE_AJAX + "," + SWITCH_TYPE_SERVER +
"," + SWITCH_TYPE_CLIENT)
+ public abstract SwitchType getSwitchType();
- }
+ @Attribute(defaultValue = DEFAULT_UNSELECT_CANCEL)
+ public abstract String getUnselectCancel();
- /**
- * Here go static methods for getting value or default value of attributes.
- */
- /**
- * Tells if showWeekends is true or false. If it is not set it returns
- * default value.
- *
- * @param schedule inspected schedule
- * @return value of showWeekends
- */
- public static boolean isShowWeekends(AbstractSchedule schedule) {
- Boolean showWeekends = schedule.isShowWeekends();
- return showWeekends == null ? AbstractSchedule.DEFAULT_SHOW_WEEKENDS :
schedule.isShowWeekends();
- }
+ @Attribute(required = true)
+ public abstract Object getValue();
- /**
- * Tells value of firstDay. If it is not set it returns
- * default value.
- *
- * @param schedule inspected schedule
- * @return value of firstDay
- */
- public static int getFirstDay(AbstractSchedule schedule) {
- Integer firstDay = schedule.getFirstDay();
- return firstDay == null ? AbstractSchedule.DEFAULT_FIRST_DAY : firstDay;
- }
+ @Attribute(required = true)
+ public abstract String getVar();
- /**
- * Tells value of weekMode. If it is not set it returns
- * default value.
- *
- * @param schedule inspected schedule
- * @return value of weekMode
- */
- public static String getWeekMode(AbstractSchedule schedule) {
- String weekMode = schedule.getWeekMode();
- return weekMode == null ? AbstractSchedule.DEFAULT_WEEK_MODE : weekMode;
- }
+ @Attribute(defaultValue = DEFAULT_VIEW,
+ suggestedValue = VIEW_MONTH
+ + "," + VIEW_AGENDA_DAY
+ + "," + VIEW_AGENDA_WEEK
+ + "," + VIEW_BASIC_DAY + "," + VIEW_BASIC_WEEK)
+ public abstract String getView();
+ @Attribute(signature = @Signature(parameters = ScheduleViewChangeEvent.class))
+ public abstract MethodExpression getViewChangeListener();
+
+ @Attribute(defaultValue = DEFAULT_WEEK_MODE,
+ suggestedValue = WEEK_MODE_FIXED + "," + WEEK_MODE_LIQUID +
"," + WEEK_MODE_VARIABLE)
+ public abstract String getWeekMode();
+
+ @Attribute
+ public abstract String getWidgetVar();
+
+ @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_DEFAULT)
+ public abstract Boolean isAllDayByDefault();
+
+ @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_SLOT)
+ public abstract Boolean isAllDaySlot();
+
/**
- * Tells value of view. If it is not set it returns
- * default value.
+ * Tells if schedule should be automatically refreshed when date range is selected.
*
- * @param schedule inspected schedule
- * @return value of view
+ * @return true if schedule should be refreshed automaticaly; flase otherwise.
*/
- public static String getView(AbstractSchedule schedule) {
- String view = schedule.getView();
- return view == null ? AbstractSchedule.DEFAULT_VIEW : view;
+ @Attribute(defaultValue = "true")
+ public abstract boolean isAutoRefreshOnDateRangeSelect();
+
+ @Attribute(defaultValue = "" + DEFAULT_DISABLE_DRAGGING)
+ public abstract Boolean isDisableDragging();
+
+ @Attribute(defaultValue = "" + DEFAULT_DISABLE_RESIZING)
+ public abstract Boolean isDisableResizing();
+
+ @Attribute(defaultValue = "" + DEFAULT_EDITABLE)
+ public abstract Boolean isEditable();
+
+ @Attribute(defaultValue = "" + DEFAULT_RTL)
+ public abstract Boolean isRTL();
+
+ @Attribute(defaultValue = "" + DEFAULT_SELECT_HELPER)
+ public abstract Boolean isSelectHelper();
+
+ @Attribute(defaultValue = "" + DEFAULT_SELECTABLE)
+ public abstract Boolean isSelectable();
+
+ @Attribute(defaultValue = "" + DEFAULT_SHOW_WEEKENDS)
+ public abstract Boolean isShowWeekends();
+
+ @Attribute(defaultValue = "" + DEFAULT_UNSELECT_AUTO)
+ public abstract Boolean isUnselectAuto();
+
+ public void setDataModel(DataModel model) {
+ this.model = model;
}
+ public abstract void setDate(Date date);
+
+ public abstract void setFirstDay(Integer firstDay);
+
+ public abstract void setShowWeekends(Boolean showWeekends);
+
+ public abstract void setView(String view);
+
+ @SuppressWarnings("unchecked")
protected DataModel getDataModel() {
// Return any previously cached DataModel instance
if (this.model != null) {
@@ -721,94 +752,9 @@
setDataModel(new ScalarDataModel(current));
}
return model;
-
}
- public void setDataModel(DataModel model) {
- this.model = model;
+ private void setResponseData(Object data) {
+
ExtendedPartialViewContext.getInstance(getFacesContext()).getResponseComponentDataMap().put(getClientId(getFacesContext()),
data);
}
-
- public void addItemSelectedListener(ScheduleItemSelectListener listener) {
- addFacesListener(listener);
- }
-
- public void removeItemSelectedListener(ScheduleItemSelectListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleItemSelectListener[] getItemSelectedListeners() {
- return (ScheduleItemSelectListener[])
getFacesListeners(ScheduleItemSelectListener.class);
- }
-
- public void addItemMoveListener(ScheduleItemMoveListener listener) {
- addFacesListener(listener);
- }
-
- public void removeItemMoveListener(ScheduleItemMoveListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleItemMoveListener[] getItemMoveListeners() {
- return (ScheduleItemMoveListener[])
getFacesListeners(ScheduleItemMoveListener.class);
- }
-
- public void addItemResizeListener(ScheduleItemResizeListener listener) {
- addFacesListener(listener);
- }
-
- public void removeItemResizeListener(ScheduleItemResizeListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleItemResizeListener[] getItemResizeListeners() {
- return (ScheduleItemResizeListener[])
getFacesListeners(ScheduleItemResizeListener.class);
- }
-
- public void addViewChangedListener(ScheduleViewChangeListener listener) {
- addFacesListener(listener);
- }
-
- public void removeViewChangedListener(ScheduleViewChangeListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleViewChangeListener[] getViewChangedListeners() {
- return (ScheduleViewChangeListener[])
getFacesListeners(ScheduleViewChangeListener.class);
- }
-
- public void addDateRangeChangedListener(ScheduleDateRangeChangeListener listener) {
- addFacesListener(listener);
- }
-
- public void removeDateRangeChangedListener(ScheduleDateRangeChangeListener listener)
{
- removeFacesListener(listener);
- }
-
- public ScheduleDateRangeChangeListener[] getDateRangeChangedListeners() {
- return (ScheduleDateRangeChangeListener[])
getFacesListeners(ScheduleDateRangeChangeListener.class);
- }
-
- public void addDateRangeSelectedListener(ScheduleDateRangeSelectListener listener) {
- addFacesListener(listener);
- }
-
- public void removeDateRangeSelectedListener(ScheduleDateRangeSelectListener listener)
{
- removeFacesListener(listener);
- }
-
- public ScheduleDateRangeSelectListener[] getDateRangeSelectedListeners() {
- return (ScheduleDateRangeSelectListener[])
getFacesListeners(ScheduleDateRangeSelectListener.class);
- }
-
- public void addDateSelectedListener(ScheduleDateSelectListener listener) {
- addFacesListener(listener);
- }
-
- public void removeDateSelectedListener(ScheduleDateSelectListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleDateSelectListener[] getDateSelectedListeners() {
- return (ScheduleDateSelectListener[])
getFacesListeners(ScheduleDateSelectListener.class);
- }
}
Modified:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java 2011-04-15
13:42:33 UTC (rev 22424)
@@ -21,27 +21,29 @@
*/
package org.richfaces.component;
-import java.util.Date;
-
-import javax.faces.component.UIComponentBase;
-
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
+import javax.faces.component.UIComponentBase;
+import java.util.Date;
+
@JsfComponent(tag = @Tag(name = "scheduleItem", type = TagType.Facelets))
public abstract class AbstractScheduleItem extends UIComponentBase {
public static final String COMPONENT_TYPE = "org.richfaces.ScheduleItem";
+
public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
+
public static final boolean DEFAULT_ALL_DAY = true;
+
public static final boolean DEFAULT_EDITABLE = AbstractSchedule.DEFAULT_EDITABLE;
@Attribute
public abstract String getStyleClass();
- @Attribute
+ @Attribute(required = true)
public abstract String getTitle();
@Attribute
@@ -50,17 +52,18 @@
@Attribute
public abstract Date getEndDate();
- @Attribute
+ @Attribute(required = true)
public abstract String getEventId();
- @Attribute(defaultValue = "" + DEFAULT_ALL_DAY)
+ @Attribute(defaultValue = "DEFAULT_ALL_DAY")
public abstract Boolean isAllDay();
@Attribute
public abstract String getUrl();
- @Attribute(defaultValue = "false")
+ @Attribute
public abstract Boolean isEditable();
+ @Attribute
public abstract Object getData();
}
Deleted:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,46 +0,0 @@
-package org.richfaces.component.event;
-
-public interface ScheduleListenerEventsProducer {
-
- void addItemSelectedListener(ScheduleItemSelectListener listener);
-
- void removeItemSelectedListener(ScheduleItemSelectListener listener);
-
- ScheduleItemSelectListener[] getItemSelectedListeners();
-
- void addItemMoveListener(ScheduleItemMoveListener listener);
-
- void removeItemMoveListener(ScheduleItemMoveListener listener);
-
- ScheduleItemMoveListener[] getItemMoveListeners();
-
- void addItemResizeListener(ScheduleItemResizeListener listener);
-
- void removeItemResizeListener(ScheduleItemResizeListener listener);
-
- ScheduleItemResizeListener[] getItemResizeListeners();
-
- void addViewChangedListener(ScheduleViewChangeListener listener);
-
- void removeViewChangedListener(ScheduleViewChangeListener listener);
-
- ScheduleViewChangeListener[] getViewChangedListeners();
-
- void addDateRangeChangedListener(ScheduleDateRangeChangeListener listener);
-
- void removeDateRangeChangedListener(ScheduleDateRangeChangeListener listener);
-
- ScheduleDateRangeChangeListener[] getDateRangeChangedListeners();
-
- void addDateRangeSelectedListener(ScheduleDateRangeSelectListener listener);
-
- void removeDateRangeSelectedListener(ScheduleDateRangeSelectListener listener);
-
- ScheduleDateRangeSelectListener[] getDateRangeSelectedListeners();
-
- void addDateSelectedListener(ScheduleDateSelectListener listener);
-
- void removeDateSelectedListener(ScheduleDateSelectListener listener);
-
- ScheduleDateSelectListener[] getDateSelectedListeners();
-}
Added:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java
(rev 0)
+++
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java 2011-04-15
13:42:33 UTC (rev 22424)
@@ -0,0 +1,4 @@
+@TagLibrary(uri = "http://richfaces.org/sandbox/schedule", shortName =
"schedule", prefix = "schedule", displayName = "Schedule
component tags") package org.richfaces.component;
+
+import org.richfaces.cdk.annotations.TagLibrary;
+
Modified:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,25 +1,10 @@
package org.richfaces.renderkit;
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.faces.FacesException;
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UINamingContainer;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSObject;
import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptString;
import org.richfaces.component.AbstractSchedule;
import org.richfaces.component.AbstractScheduleAgendaDayView;
import org.richfaces.component.AbstractScheduleAgendaWeekView;
@@ -38,6 +23,24 @@
import org.richfaces.renderkit.util.AjaxRendererUtils;
import org.richfaces.renderkit.util.RendererUtils;
+import javax.faces.FacesException;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UINamingContainer;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
@ResourceDependencies({
@ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "jquery.js", target = "head"),
@@ -51,27 +54,49 @@
@ResourceDependency(name = "richfaces.schedule.js", target =
"head"),
@ResourceDependency(name =
"org.richfaces.renderkit.html.scripts.ScheduleMessages", target =
"head"),
@ResourceDependency(name = "fullcalendar.css", target =
"head")})
-public abstract class ScheduleRendererBase extends AjaxComponentRendererBase {
+public abstract class ScheduleRendererBase extends RendererBase {
+// ------------------------------ FIELDS ------------------------------
- public static final String RENDERER_TYPE =
"org.richfaces.ScheduleRenderer";
+ public static final String DATE_RANGE_CHANGED_EVENT = "dateRangeChange";
+
+ public static final String DATE_RANGE_SELECTED_EVENT = "dateRangeSelect";
+
+ public static final String DATE_SELECTED_EVENT = "dateSelect";
+
public static final String ITEM_MOVE_EVENT = "itemMove";
+
public static final String ITEM_RESIZE_EVENT = "itemResize";
+
public static final String ITEM_SELECTED_EVENT = "itemSelect";
- public static final String DATE_RANGE_CHANGED_EVENT = "dateRangeChange";
+
+ public static final String RENDERER_TYPE =
"org.richfaces.ScheduleRenderer";
+
public static final String VIEW_CHANGED_EVENT = "viewChange";
- public static final String DATE_SELECTED_EVENT = "dateSelect";
- public static final String DATE_RANGE_SELECTED_EVENT = "dateRangeSelect";
+
+ private static final String ALL_DAY_PARAM = "allDay";
+
private static final String CALLBACK = "callback";
+
+ private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd
HH:mm:ss");
+
+ private static final String DAY_DELTA_PARAM = "dayDelta";
+
+ private static final Map<String, Object> DEFAULTS;
+
private static final String END_DATE_PARAM = "endDate";
- private static final String START_DATE_PARAM = "startDate";
+
+ private static final String EVENT_TYPE_PARAM = "eventType";
+
private static final String ITEM_ID_PARAM = "itemId";
- private static final String DAY_DELTA_PARAM = "dayDelta";
+
private static final String MINUTE_DELTA_PARAM = "minuteDelta";
- private static final String ALL_DAY_PARAM = "allDay";
- private static final String EVENT_TYPE_PARAM = "eventType";
+
+ private static final String START_DATE_PARAM = "startDate";
+
private static final String VIEW_PARAM = "view";
- private static final Map<String, Object> DEFAULTS;
+// -------------------------- STATIC METHODS --------------------------
+
/**
* Following defaults are be used by addOptionIfSetAndNotDefault
*/
@@ -79,7 +104,7 @@
Map<String, Object> defaults = new HashMap<String, Object>();
defaults.put("styleClass", "");
defaults.put("defaultView", AbstractSchedule.DEFAULT_VIEW);
- defaults.put("firstDay", AbstractSchedule.DEFAULT_FIRST_DAY);
+ defaults.put("firstDay", AbstractSchedule.DEFAULT_FIRST_DAY - 1);
defaults.put("isRTL", AbstractSchedule.DEFAULT_RTL);
defaults.put("weekends", AbstractSchedule.DEFAULT_SHOW_WEEKENDS);
defaults.put("weekMode", AbstractSchedule.DEFAULT_WEEK_MODE);
@@ -100,6 +125,7 @@
defaults.put("disableResizing",
AbstractSchedule.DEFAULT_DISABLE_RESIZING);
defaults.put("dragRevertDuration",
AbstractSchedule.DEFAULT_DRAG_REVERT_DURATION);
defaults.put("allDayDefault",
AbstractSchedule.DEFAULT_ALL_DAY_DEFAULT);
+ defaults.put("autoRefreshOnDateRangeSelect",
AbstractSchedule.DEFAULT_AUTO_REFRESH_ON_DATE_RANGE_SELECT);
defaults.put("onbeforeitemselect", "");
defaults.put("onitemselect", "");
defaults.put("onbeforeitemdrop", "");
@@ -113,6 +139,7 @@
defaults.put("onitemmouseover", "");
defaults.put("onitemmouseout", "");
defaults.put("onviewchange", "");
+ defaults.put("onviewdisplay", "");
defaults.put("onbeforedateselect", "");
defaults.put("ondateselect", "");
defaults.put("onbeforedaterangeselect", "");
@@ -121,6 +148,15 @@
DEFAULTS = Collections.unmodifiableMap(defaults);
}
+ private static void copyAttribute(String attribute, String suffix, UIComponent
source, UIComponent target) {
+ Object value = source.getAttributes().get(attribute);
+ if (value != null) {
+ target.getAttributes().put(attribute + suffix, value);
+ }
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
@Override
public void decode(FacesContext context, UIComponent component) {
if (!component.isRendered()) {
@@ -147,8 +183,8 @@
try {
if (DATE_RANGE_CHANGED_EVENT.equals(eventTypeParam)) {
- Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
- Date endDate = new Date(Long.parseLong(endDateParam) * 1000);
+ Date startDate = DATE_FORMAT.parse(startDateParam);
+ Date endDate = DATE_FORMAT.parse(endDateParam);
new ScheduleDateRangeChangeEvent(component, startDate,
endDate).queue();
} else if (ITEM_MOVE_EVENT.equals(eventTypeParam)) {
int dayDelta = Integer.parseInt(dayDeltaParam);
@@ -164,43 +200,76 @@
} else if (VIEW_CHANGED_EVENT.equals(eventTypeParam)) {
new ScheduleViewChangeEvent(component, viewParam).queue();
} else if (DATE_SELECTED_EVENT.equals(eventTypeParam)) {
- Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
+ Date startDate = DATE_FORMAT.parse(startDateParam);
boolean allDay = Boolean.parseBoolean(allDayParam);
new ScheduleDateSelectEvent(component, startDate, allDay).queue();
} else if (DATE_RANGE_SELECTED_EVENT.equals(eventTypeParam)) {
- Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
- Date endDate = new Date(Long.parseLong(endDateParam) * 1000);
+ Date startDate = DATE_FORMAT.parse(startDateParam);
+ Date endDate = DATE_FORMAT.parse(endDateParam);
boolean allDay = Boolean.parseBoolean(allDayParam);
new ScheduleDateRangeSelectEvent(component, startDate, endDate,
allDay).queue();
}
- } catch (NumberFormatException ex) {
+ } catch (ParseException ex) {
throw new FacesException("Cannot convert request parmeters",
ex);
}
}
}
- protected void writeInitFunction(FacesContext context, UIComponent component) throws
IOException {
- AbstractSchedule schedule = (AbstractSchedule) component;
- ResponseWriter writer = context.getResponseWriter();
- String clientId = schedule.getClientId(context);
- Locale locale = context.getViewRoot().getLocale();
- String widgetVar = schedule.getWidgetVar();
- if (widgetVar != null) {
- writer.writeText("var " + widgetVar + " = ", null);
+ private void addOptionHash(String attribute, UIComponent source, Map<String,
Object> options) {
+ Map<String, Object> hash = new HashMap<String, Object>(3);
+ Map<String, Object> attributes = source.getAttributes();
+ addOptionIfSetAndNotDefault("month", attributes.get(attribute +
"Month"), hash);
+ addOptionIfSetAndNotDefault("basicWeek", attributes.get(attribute +
"BasicWeek"), hash);
+ addOptionIfSetAndNotDefault("agendaWeek", attributes.get(attribute +
"AgendaWeek"), hash);
+ addOptionIfSetAndNotDefault("basicDay", attributes.get(attribute +
"BasicDay"), hash);
+ addOptionIfSetAndNotDefault("agendaDay", attributes.get(attribute +
"AgendaDay"), hash);
+ addOptionIfSetAndNotDefault("", attributes.get(attribute), hash);
+ if (hash.size() > 0) {
+ options.put(attribute, hash);
}
- writer.writeText(new JSObject("RichFaces.Schedule", clientId,
locale.toString(),
- getOptions(schedule),
- DATE_RANGE_CHANGED_EVENT,
- ITEM_SELECTED_EVENT,
- ITEM_MOVE_EVENT,
- ITEM_RESIZE_EVENT,
- VIEW_CHANGED_EVENT,
- DATE_SELECTED_EVENT,
- DATE_RANGE_SELECTED_EVENT,
- createSubmitEventFunction(context, schedule)).toScript(),
- null);
}
+ protected void addOptionIfSetAndNotDefault(String optionName, Object value,
Map<String, Object> options) {
+ if (value != null && !"".equals(value) &&
!value.equals(DEFAULTS.get(optionName))) {
+ options.put(optionName, value);
+ }
+ }
+
+ protected Object createSubmitEventFunction(FacesContext context, AbstractSchedule
component) {
+ ScriptString jsFunction;
+ Map<String, Object> params = new HashMap<String, Object>();
+ params.put(getFieldId(context, component, START_DATE_PARAM), new
JSReference(START_DATE_PARAM));
+ params.put(getFieldId(context, component, END_DATE_PARAM), new
JSReference(END_DATE_PARAM));
+ params.put(getFieldId(context, component, ITEM_ID_PARAM), new
JSReference(ITEM_ID_PARAM));
+ params.put(getFieldId(context, component, DAY_DELTA_PARAM), new
JSReference(DAY_DELTA_PARAM));
+ params.put(getFieldId(context, component, MINUTE_DELTA_PARAM), new
JSReference(MINUTE_DELTA_PARAM));
+ params.put(getFieldId(context, component, ALL_DAY_PARAM), new
JSReference(ALL_DAY_PARAM));
+ params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new
JSReference(EVENT_TYPE_PARAM));
+ params.put(getFieldId(context, component, VIEW_PARAM), new
JSReference(VIEW_PARAM));
+ String clientId = component.getClientId();
+ params.put(clientId, clientId);
+ if (isAjaxMode(component)) {
+ AjaxFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(context,
component);
+ ajaxFunction.getOptions().getParameters().putAll(params);
+ ajaxFunction.getOptions().set("complete", new
JSReference(CALLBACK));
+ jsFunction = ajaxFunction;
+ } else if (SwitchType.server.equals(component.getSwitchType())) {
+ jsFunction = new JSFunction("RichFaces.submitForm", "#"
+ + RendererUtils.getInstance().getNestingForm(context,
component).getClientId(context),
+ params,
+ "");
+ } else {
+ return null;
+ }
+ return new JSFunctionDefinition("event", VIEW_PARAM, EVENT_TYPE_PARAM,
ITEM_ID_PARAM, START_DATE_PARAM,
+ END_DATE_PARAM, DAY_DELTA_PARAM, MINUTE_DELTA_PARAM, ALL_DAY_PARAM,
CALLBACK).addToBody(jsFunction);
+ }
+
+ protected String getFieldId(FacesContext context, AbstractSchedule component, String
attribute) {
+ return RendererUtils.getInstance().clientId(context, component) +
UINamingContainer.getSeparatorChar(context)
+ + attribute;
+ }
+
protected Map<String, Object> getOptions(AbstractSchedule schedule) throws
IOException {
/**
* Copy attributes from child view components
@@ -237,7 +306,10 @@
/**
* firstDayOfWeek numeration in Calendar (sunday=1,monday=2,etc.) and in
widget(sunday=0,monday=1,etc.)
*/
- addOptionIfSetAndNotDefault("firstDay", schedule.getFirstDay() - 1,
options);
+ Integer firstDay = schedule.getFirstDay();
+ if (firstDay != null) {
+ addOptionIfSetAndNotDefault("firstDay", firstDay - 1, options);
+ }
addOptionIfSetAndNotDefault("isRTL", schedule.isRTL(), options);
addOptionIfSetAndNotDefault("weekends", schedule.isShowWeekends(),
options);
addOptionIfSetAndNotDefault("weekMode", schedule.getWeekMode(),
options);
@@ -272,6 +344,7 @@
options.put("header", headerOptions);
}
addOptionIfSetAndNotDefault("allDayDefault",
schedule.isAllDayByDefault(), options);
+ addOptionIfSetAndNotDefault("autoRefreshOnDateRangeSelect",
schedule.isAutoRefreshOnDateRangeSelect(), options);
addOptionIfSetAndNotDefault("onbeforeitemselect",
schedule.getOnbeforeitemselect(), options);
addOptionIfSetAndNotDefault("onitemselect", schedule.getOnitemselect(),
options);
@@ -286,6 +359,7 @@
addOptionIfSetAndNotDefault("onitemmouseover",
schedule.getOnitemmouseover(), options);
addOptionIfSetAndNotDefault("onitemmouseout",
schedule.getOnitemmouseout(), options);
addOptionIfSetAndNotDefault("onviewchange", schedule.getOnviewchange(),
options);
+ addOptionIfSetAndNotDefault("onviewdisplay",
schedule.getOnviewdisplay(), options);
addOptionIfSetAndNotDefault("onbeforedateselect",
schedule.getOnbeforedateselect(), options);
addOptionIfSetAndNotDefault("ondateselect", schedule.getOndateselect(),
options);
addOptionIfSetAndNotDefault("onbeforedaterangeselect",
schedule.getOnbeforedaterangeselect(), options);
@@ -323,48 +397,6 @@
return options;
}
- protected Object createSubmitEventFunction(FacesContext context, AbstractSchedule
component) {
- JSFunction jsFunction;
- Map<String, Object> params = new HashMap<String, Object>();
- params.put(getFieldId(context, component, START_DATE_PARAM), new
JSReference(START_DATE_PARAM));
- params.put(getFieldId(context, component, END_DATE_PARAM), new
JSReference(END_DATE_PARAM));
- params.put(getFieldId(context, component, ITEM_ID_PARAM), new
JSReference(ITEM_ID_PARAM));
- params.put(getFieldId(context, component, DAY_DELTA_PARAM), new
JSReference(DAY_DELTA_PARAM));
- params.put(getFieldId(context, component, MINUTE_DELTA_PARAM), new
JSReference(MINUTE_DELTA_PARAM));
- params.put(getFieldId(context, component, ALL_DAY_PARAM), new
JSReference(ALL_DAY_PARAM));
- params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new
JSReference(EVENT_TYPE_PARAM));
- params.put(getFieldId(context, component, VIEW_PARAM), new
JSReference(VIEW_PARAM));
- String clientId = component.getClientId();
- params.put(clientId, clientId);
- if (isAjaxMode(component)) {
- jsFunction = AjaxRendererUtils.buildAjaxFunction(context, component,
AjaxRendererUtils.AJAX_FUNCTION_NAME);
- AjaxEventOptions eventOptions = AjaxRendererUtils.buildEventOptions(context,
component);
- eventOptions.getParameters().putAll(params);
- eventOptions.set("complete", new JSReference(CALLBACK));
- jsFunction.addParameter(eventOptions);
- } else if (AbstractSchedule.SWITCH_TYPE_SERVER.equals(component.getSwitchType()))
{
- jsFunction = new JSFunction("RichFaces.submitForm",
- RendererUtils.getInstance().getNestingForm(context,
component).getClientId(context),
- params,
- "");
- } else {
- return null;
- }
- return new JSFunctionDefinition("event", VIEW_PARAM, EVENT_TYPE_PARAM,
ITEM_ID_PARAM, START_DATE_PARAM,
- END_DATE_PARAM, DAY_DELTA_PARAM, MINUTE_DELTA_PARAM, ALL_DAY_PARAM,
CALLBACK).addToBody(jsFunction);
- }
-
- protected void addOptionIfSetAndNotDefault(String optionName, Object value,
Map<String, Object> options) {
- if (value != null && !"".equals(value) &&
!value.equals(DEFAULTS.get(optionName))) {
- options.put(optionName, value);
- }
- }
-
- protected String getFieldId(FacesContext context, AbstractSchedule component, String
attribute) {
- return RendererUtils.getInstance().clientId(context, component) +
UINamingContainer.getSeparatorChar(context)
- + attribute;
- }
-
protected boolean isAjaxMode(AbstractSchedule component) {
SwitchType mode = component.getSwitchType();
return SwitchType.ajax.equals(mode) || null == mode;
@@ -375,24 +407,18 @@
return SwitchType.client.equals(mode);
}
- private void addOptionHash(String attribute, UIComponent source, Map<String,
Object> options) {
- Map<String, Object> hash = new HashMap<String, Object>(3);
- Map<String, Object> attributes = source.getAttributes();
- addOptionIfSetAndNotDefault("month", attributes.get(attribute +
"Month"), hash);
- addOptionIfSetAndNotDefault("basicWeek", attributes.get(attribute +
"BasicWeek"), hash);
- addOptionIfSetAndNotDefault("agendaWeek", attributes.get(attribute +
"AgendaWeek"), hash);
- addOptionIfSetAndNotDefault("basicDay", attributes.get(attribute +
"BasicDay"), hash);
- addOptionIfSetAndNotDefault("agendaDay", attributes.get(attribute +
"AgendaDay"), hash);
- addOptionIfSetAndNotDefault("", attributes.get(attribute), hash);
- if (hash.size() > 0) {
- options.put(attribute, hash);
+ protected void writeInitFunction(FacesContext context, UIComponent component) throws
IOException {
+ AbstractSchedule schedule = (AbstractSchedule) component;
+ ResponseWriter writer = context.getResponseWriter();
+ String clientId = schedule.getClientId(context);
+ Locale locale = context.getViewRoot().getLocale();
+ String widgetVar = schedule.getWidgetVar();
+ if (widgetVar != null) {
+ writer.writeText("var " + widgetVar + " = ", null);
}
+ final Map<String, Object> options = getOptions(schedule);
+ options.put("locale", locale.toString());
+ options.put("submitEventFunction", createSubmitEventFunction(context,
schedule));
+ writer.writeText(new JSObject("RichFaces.ui.Schedule", clientId,
options).toScript(), null);
}
-
- private static void copyAttribute(String attribute, String suffix, UIComponent
source, UIComponent target) {
- Object value = source.getAttributes().get(attribute);
- if (value != null) {
- target.getAttributes().put(attribute + suffix, value);
- }
- }
}
Modified:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,5 +1,13 @@
package org.richfaces.renderkit.html.scripts;
+import org.richfaces.log.LogFactory;
+import org.richfaces.log.Logger;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.resource.AbstractCacheableResource;
+import org.richfaces.resource.DynamicResource;
+
+import javax.faces.application.Application;
+import javax.faces.context.FacesContext;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -9,20 +17,13 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.log.LogFactory;
-import org.richfaces.log.Logger;
-import org.richfaces.renderkit.HtmlConstants;
-import org.richfaces.resource.AbstractCacheableResource;
-import org.richfaces.resource.DynamicResource;
-
@DynamicResource
public class ScheduleMessages extends AbstractCacheableResource {
public static final String BUNDLE_NAME =
"org.richfaces.component.UIScheduleMessages";
+
private static final String MESSAGE_KEY_BASE =
"org.richfaces.component.UISchedule.";
+
private static final Logger LOG = LogFactory.getLogger(ScheduleMessages.class);
public ScheduleMessages() {
@@ -35,7 +36,7 @@
FacesContext facesContext = FacesContext.getCurrentInstance();
Application application = facesContext.getApplication();
StringBuilder out = new StringBuilder();
-
out.append("RichFaces.Schedule.prototype.messages=jQuery.extend(RichFaces.Schedule.prototype.messages,{");
+
out.append("RichFaces.ui.Schedule.prototype.messages=jQuery.extend(RichFaces.ui.Schedule.prototype.messages,{");
Iterator<Locale> supportedLocales = application.getSupportedLocales();
while (supportedLocales.hasNext()) {
Locale locale = supportedLocales.next();
Modified:
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,158 +1,204 @@
-window.RichFaces = window.RichFaces || {};
-//TODO test ajax reRender
-RichFaces.Schedule = function(id, locale, options, dateRangeChangeEventName,
itemSelectEventName, itemMoveEventName, itemResizeEventName, viewChangeEventName,
dateSelectEventName, dateRangeSelectEventName, submitEventFunction) {
-
- var _this = this;
- this.scheduleNode = document.getElementById(id);
- this.scheduleNode[RichFaces.RICH_CONTAINER] = {component: this};
- if (!this.scheduleNode) {
- throw "No element with id '" + id + "' found.";
- }
-
- /**
- * Message bundle setup.
- */
- options = jQuery.extend({}, this.messages[locale], options);
-
- jQuery(document).ready(function() {
- _this.delegate = jQuery(_this.scheduleNode).fullCalendar(options);
- });
-
-
- // ---
- /**
- * Utility functions.
- */
- var getResponseData = function(event) {
- return event.componentData[id];
- }
-
- // ---
- /**
- * Converts javascript date into integer that can be used as param
- * for new Date(long) - milliseconds since epoch.
- */
- var formatDateParam = function(date) {
- return Math.round(date.getTime() / 1000);
- };
- /**
- * Compares two dates with with an accuracy of a day.
- */
- var isSameDay = function(dateA, dateB) {
- if (!dateA instanceof Date || !dateB instanceof Date) {
- throw "Both params must be Date objects";
- }
- return dateA.getYear() == dateB.getYear()
- && dateA.getMonth() == dateB.getMonth()
- && dateA.getDate() == dateB.getDate();
- };
- // ---
- /**
- * DELEGATE SETUP.
- * Delegate (fullCalendar) needs callback methods
- * for various events such as item clicking, dragging, resizing or loading
- * items.
- * Functions below can be overriden by ones declared in "options"
parameter.
- */
- // ---
- /**
- * Called by fullCalendar when it needs to load items - initial load,
- * view type change, time navigation.
- * If in ajax mode, then some initial items should be provided.
- * If so then they are used for the first invocation of this function.
- * This avoids creating additional ajax request on initial rendering.
- * Custom users code cannot raise veto so any return statements there are
- * ignored.
- */
- var dateRangeChange = function(startDate, endDate, callback) {
- var firstInvocation = options.initialItems != null;
- if (firstInvocation) {
- var startDateData = options.initialItems.startDate;
- var endDateData = options.initialItems.endDate;
- var initialStartDate = new Date(startDateData.year, startDateData.month,
startDateData.date);
- var initialEndDate = new Date(endDateData.year, endDateData.month,
endDateData.date);
- var items = options.initialItems.items;
+/**
+ * This function evaluates code in template with object in ScopeChain.
+ * This is usefull if you need to evaluate code that uses member names
+ * that colide with external names that the code refers to.
+ * There is almost exact method in utils.js called Richfaces.eval,
+ * but it swallows exception thrown during evaluation, which makes debugging
+ * hard.
+ */
+(function ($, rf) {
+ // Create (for example) ui container for our component class
+ rf.ui = rf.ui || {};
+ // Default options definition if needed for the component
+ // var defaultOptions = {};
+ var SUBMIT_EVENT_FUNCTION = 'submitEventFunction';
+ // Extending component class with new properties and methods using extendClass
+ // $super - reference to the parent prototype, will be available inside those
methods
+ rf.ui.Schedule = rf.BaseComponent.extendClass({
+ // class name
+ name:"Schedule",
+ init: function (componentId, options) {
+ if (!document.getElementById(componentId)) {
+ throw "No element with id '" + componentId + "'
found.";
+ }
+ this.options = options;
+ // call constructor of parent class if needed
+ $super.constructor.call(this, componentId);
+ // attach component object to DOM element for
+ // future cleaning and for client side API calls
+ this.attachToDom(this.id);
+ // ...
/**
- * After initial load this should be cleaned so items are not cached.
+ * Message bundle & event handlers setup.
*/
- options.initialItems = null;
- /**
- * In case the JSF component made a mistake in calculating initial
- * date range we don't use initial items and just continue.
- */
- if (isSameDay(startDate, initialStartDate) && isSameDay(endDate,
initialEndDate)) {
- callback(items);
- return;
+ options = jQuery.extend({
+ events: function(startDate, endDate, callback) {
+ _this.__dateRangeChange(startDate, endDate, callback)
+ },
+ eventDragStart: function(item, event, ui, view) {
+ _this.__itemDragStart(item, event, ui, view)
+ },
+ eventDragStop: function(item, event, ui, view) {
+ _this.__itemDragStop(item, event, ui, view)
+ },
+ eventDrop: function(item, dayDelta, minuteDelta, allDay, revertFunc,
event, ui, view) {
+ _this.__itemDrop(item, dayDelta, minuteDelta, allDay, revertFunc,
event, ui, view)
+ },
+ eventResizeStart: function(item, event, ui, view) {
+ _this.__itemResizeStart(item, event, ui, view)
+ },
+ eventResizeStop: function(item, event, ui, view) {
+ _this.__itemResizeStop(item, event, ui, view)
+ },
+ eventResize: function(item, dayDelta, minuteDelta, revertFunc, event, ui,
view) {
+ _this.__itemResized(item, dayDelta, minuteDelta, revertFunc, event,
ui, view)
+ },
+ eventClick: function(item, dayDelta, minuteDelta, revertFunc, event, ui,
view) {
+ _this.__itemClick(item, dayDelta, minuteDelta, revertFunc, event, ui,
view)
+ },
+ eventMouseover: function(item, event, view) {
+ _this.__itemMouseover(item, event, view)
+ },
+ eventMouseout: function(item, event, view) {
+ _this.__itemMouseout(item, event, view)
+ },
+ viewDisplay: function(view) {
+ _this.__viewChanged(view)
+ },
+ dayClick: function(date, allDay, event, view) {
+ _this.__dayClick(date, allDay, event, view)
+ },
+ select: function(startDate, endDate, allDay, view) {
+ _this.__dateRangeSelected(startDate, endDate, allDay, view)
+ }
+ }, this.messages[options['locale']], options);
+ var _this = this;
+ jQuery(function() {
+ jQuery(document.getElementById(_this.id)).fullCalendar(options);
+ });
+ },
+ // private functions definition
+ /**
+ * Utility functions.
+ */
+ __getResponseComponentData : function(event) {
+ return event.componentData[this.id];
+ },
+ /**
+ * Converts javascript date into integer that can be used as param
+ * for new Date(long) - milliseconds since epoch.
+ */
+ __formatDateParam : function(date) {
+ return jQuery.fullCalendar.formatDate(date, "yyyy-MM-dd
HH:mm:ss");
+ },
+ /**
+ * Compares two dates with with an accuracy of a day.
+ */
+ __isSameDay : function(dateA, dateB) {
+ if (!dateA instanceof Date || !dateB instanceof Date) {
+ throw "Both params must be Date objects";
}
- }
- if (submitEventFunction != null) {
- submitEventFunction({} /* stub event */,
- null,
- dateRangeChangeEventName,
- null,
- formatDateParam(startDate),
- formatDateParam(endDate),
- null, null, null,
- function(event) {
- var data = getResponseData(event);
- if (data != undefined) {
- callback(data);
+ return dateA.getYear() == dateB.getYear()
+ && dateA.getMonth() == dateB.getMonth()
+ && dateA.getDate() == dateB.getDate();
+ },
+ /**
+ * Executes event handler passed in options.
+ * @param eventName name of the event
+ * @param context hash of variables that should be placed in scope when during
evaluation
+ */
+ __executeInlineEventHandler : function(eventName, context) {
+ if (this.options[eventName] != null) {
+ return rf.ui.Schedule.eval("(function(){" +
this.options[eventName] + "})()", context);
+ } else {
+ return null;
+ }
+ },
+ __getDelegate : function() {
+ return jQuery(document.getElementById(this.id));
+ },
+ // ---
+ /**
+ * DELEGATE SETUP.
+ * Delegate (fullCalendar) needs callback methods
+ * for various events such as item clicking, dragging, resizing or loading
+ * items.
+ * Functions below can be overriden by ones declared in "options"
parameter.
+ */
+ // ---
+ /**
+ * Called by fullCalendar when it needs to load items - initial load,
+ * view type change, time navigation.
+ * If in ajax mode, then some initial items should be provided.
+ * If so then they are used for the first invocation of this function.
+ * This avoids creating additional ajax request on initial rendering.
+ * Custom users code cannot raise veto so any return statements there are
+ * ignored.
+ */
+ __dateRangeChange : function(startDate, endDate, callback) {
+ var firstInvocation = this.options.initialItems != null;
+ if (firstInvocation) {
+ var startDateData = this.options.initialItems.startDate;
+ var endDateData = this.options.initialItems.endDate;
+ var initialStartDate = new Date(startDateData['year'],
startDateData.month, startDateData.date);
+ var initialEndDate = new Date(endDateData['year'],
endDateData.month, endDateData.date);
+ var items = this.options.initialItems.items;
+ /**
+ * After initial load this should be cleaned so items are not cached.
+ */
+ this.options.initialItems = null;
+ /**
+ * In case the JSF component made a mistake in calculating initial
+ * date range we don't use initial items and just continue.
+ */
+ if (this.__isSameDay(startDate, initialStartDate) &&
this.__isSameDay(endDate, initialEndDate)) {
+ callback(items);
+ return;
+ }
+ }
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION]({} /* stub event */,
+ null,
+ 'dateRangeChange',
+ null,
+ this.__formatDateParam(startDate),
+ this.__formatDateParam(endDate),
+ null, null, null,
+ function(event) {
+ var data = _this.__getResponseComponentData(event);
+ if (data != undefined) {
+ callback(data);
+ }
+
_this.__executeInlineEventHandler('ondaterangechange', {
'startDate':startDate, 'endDate':endDate, 'event':event,
'items':data });
}
- if (options.ondaterangechange != null) {
- RichFaces.Schedule.eval("(function(){" +
options.ondaterangechange + "})()", {
- 'startDate':startDate,
- 'endDate':endDate,
- 'data':data,
- 'items':data
- });
- }
- }
- );
- } else if (!firstInvocation && options.ondaterangechange != null) {
- RichFaces.Schedule.eval("(function(){" + options.ondaterangechange
+ "})()", {
- 'startDate':startDate,
- 'endDate':endDate
- });
- }
- };
- /**
- * Called by fullCalendar when item has started to be dragged.
- */
- var itemDragStart = function(item, event, ui, view) {
- if (options.onitemdragstart != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemdragstart +
"})()", {
+ );
+ } else if (!firstInvocation) {
+ this.__executeInlineEventHandler('ondaterangechange', {
'startDate':startDate, 'endDate':endDate, 'event':null,
'items':null });
+ }
+ },
+ /**
+ * Called by fullCalendar when item has started to be dragged.
+ */
+ __itemDragStart: function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemdragstart', {
'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item has stopped to be dragged.
+ * This is invoked between itemDragStart and itemDrop.
+ */
+ __itemDragStop : function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemdragstop', {
'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item was dropped (dragging finished).
+ * This is invoked after itemDragStop.
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ */
+ __itemDrop : function(item, dayDelta, minuteDelta, allDay, revertFunc, event, ui,
view) {
+ var result = this.__executeInlineEventHandler('onbeforeitemdrop', {
'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item has stopped to be dragged.
- * This is invoked between itemDragStart and itemDrop.
- */
- var itemDragStop = function(item, event, ui, view) {
- if (options.onitemdragstop != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemdragstop +
"})()", {
- 'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item was dropped (dragging finished).
- * This is invoked after itemDragStop.
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- */
- var itemDrop = function(item, dayDelta, minuteDelta, allDay, revertFunc, event, ui,
view) {
- var result;
- if (options.onbeforeitemdrop != null) {
- result = RichFaces.Schedule.eval("(function(){" +
options.onbeforeitemdrop + "})()", {
- 'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
'allDay':allDay,
@@ -164,25 +210,24 @@
revertFunc();
return;
}
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- itemMoveEventName,
- item.id,
- null,
- null,
- dayDelta, minuteDelta, allDay,
- function(event) {
- var decision = getResponseData(event);
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'itemMove',
+ item.id,
+ null,
+ null,
+ dayDelta, minuteDelta, allDay,
+ function(event) {
+ var decision = _this.__getResponseComponentData(event);
- var vetoed = false;
- if (decision != undefined && decision !== true) {
- revertFunc();
- vetoed = true;
- }
- if (options.onitemdrop != null) {
- RichFaces.Schedule.eval("(function(){" +
options.onitemdrop + "})()", {
+ var vetoed = false;
+ if (decision != undefined && decision !== true) {
+ revertFunc();
+ vetoed = true;
+ }
+ _this.__executeInlineEventHandler('onitemdrop', {
'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
@@ -193,49 +238,43 @@
'data':decision,
'vetoed':vetoed
});
- }
- }
- );
- }
- };
- /**
- * Called by fullCalendar when item has started to be resized.
- */
- var itemResizeStart = function(item, event, ui, view) {
- if (options.onitemresizestart != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemresizestart
+ "})()", {
+ });
+ } else {
+ this.__executeInlineEventHandler('onitemdrop', {
+ 'item':item,
+ 'dayDelta':dayDelta,
+ 'minuteDelta':minuteDelta,
+ 'allDay':allDay,
+ 'event':event,
+ 'ui':ui,
+ 'view':view,
+ 'data':null,
+ 'vetoed':null
+ });
+ }
+ },
+ /**
+ * Called by fullCalendar when item has started to be resized.
+ */
+ __itemResizeStart : function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemresizestart', {
'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item has stopped to be resized.
+ * This is invoked between itemResizeStart and itemResized.
+ */
+ __itemResizeStop : function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemresizestop', {
'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item was resized.
+ * This is invoked after itemResizeStop.
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ */
+ __itemResized : function(item, dayDelta, minuteDelta, revertFunc, event, ui,
view) {
+ var result = this.__executeInlineEventHandler('onbeforeitemresize',
{
'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item has stopped to be resized.
- * This is invoked between itemResizeStart and itemResized.
- */
- var itemResizeStop = function(item, event, ui, view) {
- if (options.onitemresizestop != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemresizestop +
"})()", {
- 'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item was resized.
- * This is invoked after itemResizeStop.
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- */
- var itemResized = function(item, dayDelta, minuteDelta, revertFunc, event, ui, view)
{
- var result;
- if (options.onbeforeitemresize != null) {
- result = RichFaces.Schedule.eval("(function(){" +
options.onbeforeitemresize + "})()", {
- 'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
'event':event,
@@ -246,24 +285,23 @@
revertFunc();
return;
}
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- itemResizeEventName,
- item.id,
- null,
- null,
- dayDelta, minuteDelta, null,
- function(event) {
- var decision = getResponseData(event);
- var vetoed = false;
- if (decision != undefined && decision !== true) {
- revertFunc();
- vetoed = true;
- }
- if (options.onitemresize != null) {
- RichFaces.Schedule.eval("(function(){" +
options.onitemresize + "})()", {
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'itemResize',
+ item.id,
+ null,
+ null,
+ dayDelta, minuteDelta, null,
+ function(event) {
+ var decision = _this.__getResponseComponentData(event);
+ var vetoed = false;
+ if (decision != undefined && decision !== true) {
+ revertFunc();
+ vetoed = true;
+ }
+ _this.__executeInlineEventHandler('onitemresize', {
'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
@@ -274,285 +312,241 @@
'vetoed':vetoed
});
}
- }
- );
- }
- };
- /**
- * Called by fullCalendar when mouse moves over item.
- */
- var itemMouseover = function(item, event, view) {
- if (options.onitemmouseover != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemmouseover +
"})()", {
- 'item':item,
- 'event':event,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when mouse leaves item.
- */
- var itemMouseout = function(item, event, view) {
- if (options.onitemmouseout != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemmouseout +
"})()", {
- 'item':item,
- 'event':event,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item is clicked.
- * Custom users code may return "false". In such case
- * changes no event will be sent to server and false will be returned
- * to fullCalendar, which will prevent redirecting to URL associated
- * with item (if such url was defined for the item).
- */
- var itemClick = function(item, event, view) {
- var result;
- if (options.onbeforeitemselect != null) {
- result = RichFaces.Schedule.eval("(function(){" +
options.onbeforeitemselect + "})()", {
- 'item':item,
- 'event':event,
- 'view':view
- });
- }
- if (result === false) {
- return false;
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- itemSelectEventName,
- item.id,
- null, null, null, null, null, function(event) {
- var data = getResponseData(event);
-
- if (options.onitemselect != null) {
- RichFaces.Schedule.eval("(function(){" +
options.onitemselect + "})()", {
- 'item':item,
- 'event':event,
- 'view':view,
- 'data':data
- });
+ );
+ } else {
+ this.__executeInlineEventHandler('onitemresize', {
+ 'item':item,
+ 'dayDelta':dayDelta,
+ 'minuteDelta':minuteDelta,
+ 'event':event,
+ 'ui':ui,
+ 'view':view,
+ 'data':null,
+ 'vetoed':null
+ });
+ }
+ },
+ /**
+ * Called by fullCalendar when mouse moves over item.
+ */
+ __itemMouseover : function(item, event, view) {
+ this.__executeInlineEventHandler('onitemmouseover', {
'item':item, 'event':event, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when mouse leaves item.
+ */
+ __itemMouseout : function(item, event, view) {
+ this.__executeInlineEventHandler('onitemmouseout', {
'item':item, 'event':event, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item is clicked.
+ * Custom users code may return "false". In such case
+ * changes no event will be sent to server and false will be returned
+ * to fullCalendar, which will prevent redirecting to URL associated
+ * with item (if such url was defined for the item).
+ */
+ __itemClick : function(item, event, view) {
+ var result = this.__executeInlineEventHandler('onbeforeitemselect', {
'item':item, 'event':event, 'view':view });
+ if (result === false) {
+ return false;
+ }
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'itemSelect',
+ item.id,
+ null, null, null, null, null, function(event) {
+ var data = _this.__getResponseComponentData(event);
+ _this.__executeInlineEventHandler('onitemselect', {
'item':item, 'event':event, 'view':view, 'data':data });
}
+ );
+ } else {
+ this.__executeInlineEventHandler('onitemselect', {
'item':item, 'event':event, 'view':view, 'data':null });
}
- );
- }
- return result;
- };
- /**
- * Called by fullCalendar when day is clicked.
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- */
- var dayClick = function(date, allDay, event, view) {
- if (options.onbeforedateselect != null) {
- var result = RichFaces.Schedule.eval("(function(){" +
options.onbeforedateselect + "})()", {
- 'date':date,
- 'allDay':allDay,
- 'event':event,
- 'view':view
- });
+ return result;
+ },
+ /**
+ * Called by fullCalendar when day is clicked.
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ */
+ __dayClick : function(date, allDay, event, view) {
+ var result = this.__executeInlineEventHandler('onbeforedateselect', {
'date':date, 'allDay':allDay, 'event':event, 'view':view
});
if (result === false) {
return;
}
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- dateSelectEventName,
- null, formatDateParam(date), null, null, null, allDay,
function(event) {
- var data = getResponseData(event);
- if (options.ondateselect != null) {
- RichFaces.Schedule.eval("(function(){" +
options.ondateselect + "})()", {
- 'date':date,
- 'allDay':allDay,
- 'event':event,
- 'view':view,
- 'data':data
- });
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'dateSelect',
+ null, this.__formatDateParam(date), null, null, null, allDay,
function(event) {
+ var data = _this.__getResponseComponentData(event);
+ _this.__executeInlineEventHandler('ondateselect', {
'date':date, 'allDay':allDay, 'event':event, 'view':view,
'data':data });
}
+ );
+ } else {
+ this.__executeInlineEventHandler('ondateselect', {
'date':date, 'allDay':allDay, 'event':event, 'view':view,
'data':null });
}
- );
- }
- };
- var selectedView;
- /**
- * Called by fullCalendar when view or dates change.
- * We want to notify user only about view change, so we cache current view
- * on private variable "selectedView" and compare it with value passed
- * in parameter.
- * Custom users code may not raise veto so any "return" statements are
- * ignored.
- */
- var viewChanged = function(view) {
- if (selectedView != view && selectedView != undefined) {
- if (submitEventFunction != null) {
- submitEventFunction({},
- view.name,
- viewChangeEventName,
- null, null, null, null, null, null, function(event) {
- var data = getResponseData(event);
- if (options.onviewchange != null) {
- RichFaces.Schedule.eval("(function(){" +
options.onviewchange + "})()", {
- 'view':view,
- 'data':data
- });
+ },
+ /**
+ * Called by fullCalendar when view or dates change.
+ * We want to notify user only about view change, so we cache current view
+ * on private variable "selectedView" and compare it with value passed
+ * in parameter.
+ * Custom users code may not raise veto so any "return" statements are
+ * ignored.
+ */
+ __viewChanged : function(view) {
+ this.__executeInlineEventHandler('onviewdisplay', {
'view':view });
+ if (this.selectedView != view && this.selectedView != undefined) {
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION]({},
+ view.name,
+ 'viewChange',
+ null, null, null, null, null, null, function(event) {
+ var data = _this.__getResponseComponentData(event);
+ _this.__executeInlineEventHandler('onviewchange', {
'view':view, 'event':event, 'data':data });
}
+ );
+ } else {
+ this.__executeInlineEventHandler('onviewchange',
{'view':view, 'event':null, 'data':null});
}
- );
- } else if (options.onviewchange != null) {
- RichFaces.Schedule.eval("(function(){" + options.onviewchange +
"})()", {
- 'view':view
- });
}
- }
- selectedView = view;
- };
- /**
- * Called by fullCalendar when some date range is selected (user clicks
- * and drags over empty time cells).
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- * What is more, selection will be cleared at the end of this function.
- * (This is bad, i guess, but for now i don't see other way to
- * hide selection marker after selection was made, event sent to server,
- * and server side listeners have created new event for that selection.
- * If no unselect would happen then we selection helper would still be there
- * and mess the looks)
- */
- var dateRangeSelected = function(startDate, endDate, allDay, view) {
- if (!_this.delegate.fullCalendar('option', 'selectable')) {
- return;
- }
- var result;
- if (options.onbeforedaterangeselect != null) {
- result = RichFaces.Schedule.eval("(function(){" +
options.onbeforedaterangeselect + "})()", {
- 'startDate':startDate,
- 'endDate':endDate,
- 'allDay':allDay,
- 'view':view
- });
- }
- if (result === false) {
- return;
- }
- if (submitEventFunction != null) {
- submitEventFunction({},
- null,
- dateRangeSelectEventName,
- null, formatDateParam(startDate), formatDateParam(endDate), null,
null, allDay,
- function(event) {
- var data = getResponseData(event);
- _this.refetchItems();
- if (options.ondaterangeselect != null) {
- RichFaces.Schedule.eval("(function(){" +
options.ondaterangeselect + "})()", {
+ this.selectedView = view;
+ },
+ /**
+ * Called by fullCalendar when some date range is selected (user clicks
+ * and drags over empty time cells).
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ * What is more, selection will be cleared at the end of this function.
+ * (This is bad, i guess, but for now i don't see other way to
+ * hide selection marker after selection was made, event sent to server,
+ * and server side listeners have created new event for that selection.
+ * If no unselect would happen then we selection helper would still be there
+ * and mess the looks)
+ */
+ __dateRangeSelected : function(startDate, endDate, allDay, view) {
+ if (!this.__getDelegate().fullCalendar('option',
'selectable')) {
+ return;
+ }
+ var result =
this.__executeInlineEventHandler('onbeforedaterangeselect', {
'startDate':startDate, 'endDate':endDate, 'allDay':allDay,
'view':view });
+ if (result === false) {
+ return;
+ }
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION]({},
+ null,
+ 'dateRangeSelect',
+ null, this.__formatDateParam(startDate),
this.__formatDateParam(endDate), null, null, allDay,
+ function(event) {
+ if (_this.options['autoRefreshOnDateRangeSelect'] !==
false) {
+ _this.refetchItems();
+ }
+ var data = _this.__getResponseComponentData(event);
+
_this.__executeInlineEventHandler('ondaterangeselect', {
'startDate':startDate,
'endDate':endDate,
'allDay':allDay,
'view':view,
+ 'event':event,
'data':data
});
}
- }
- );
+ );
+ } else {
+ this.__executeInlineEventHandler('ondaterangeselect', {
+ 'startDate':startDate,
+ 'endDate':endDate,
+ 'allDay':allDay,
+ 'view':view,
+ 'event':null,
+ 'data':null
+ });
+ }
+ },
+ // public API
+ select : function(startDate, endDate, allDay) {
+ this.__getDelegate().fullCalendar('select', startDate, endDate,
allDay);
+ },
+ unselect: function() {
+ this.__getDelegate().fullCalendar('unselect');
+ },
+ render: function() {
+ this.__getDelegate().fullCalendar('render');
+ },
+ getView: function() {
+ return this.__getDelegate().fullCalendar('getView');
+ },
+ changeView: function(viewName) {
+ this.__getDelegate().fullCalendar('changeView', viewName);
+ },
+ prev: function() {
+ this.__getDelegate().fullCalendar('prev');
+ },
+ next: function() {
+ this.__getDelegate().fullCalendar('next');
+ },
+ prevYear: function() {
+ this.__getDelegate().fullCalendar('prevYear');
+ },
+ nextYear: function() {
+ this.__getDelegate().fullCalendar('nextYear');
+ },
+ today: function() {
+ this.__getDelegate().fullCalendar('today');
+ },
+ gotoDate: function(year, month, date) {
+ this.__getDelegate().fullCalendar('gotoDate', year, month, date);
+ },
+ incrementDate: function(years, months, days) {
+ this.__getDelegate().fullCalendar('incrementDate', years, months,
days);
+ },
+ updateItem: function(item) {
+ this.__getDelegate().fullCalendar('updateItem', item);
+ },
+ getItems: function(idOrFilter) {
+ return this.__getDelegate().fullCalendar('clientEvents',
idOrFilter);
+ },
+ removeItems: function(idOrFilter) {
+ this.__getDelegate().fullCalendar('removeEvents', idOrFilter);
+ },
+ refetchItems: function() {
+ this.__getDelegate().fullCalendar('refetchEvents');
+ },
+ addItemsSource: function(source) {
+ this.__getDelegate().fullCalendar('addEventSource', source);
+ },
+ removeItemsSource: function(source) {
+ this.__getDelegate().fullCalendar('removeEventSource', source);
+ },
+ addItem: function(event, stick) {
+ this.__getDelegate().fullCalendar('renderEvent', event, stick);
+ },
+ reRender: function() {
+ this.__getDelegate().fullCalendar('rerenderEvents');
+ },
+ // destructor definition
+ destroy: function () {
+ // define destructor if additional cleaning is needed but
+ // in most cases its not nessesary.
+ // call parent’s destructor
+ $super.destroy.call(this);
+ this.__getDelegate().fullCalendar('destroy');
}
- };
- options = jQuery.extend({
- events: dateRangeChange,
- eventDragStart: itemDragStart,
- eventDragStop: itemDragStop,
- eventDrop: itemDrop,
- eventResizeStart: itemResizeStart,
- eventResizeStop: itemResizeStop,
- eventResize: itemResized,
- eventClick: itemClick,
- eventMouseover: itemMouseover,
- eventMouseout: itemMouseout,
- viewDisplay: viewChanged,
- dayClick: dayClick,
- select: dateRangeSelected
- }, options);
-
-};
-RichFaces.Schedule.prototype.messages = {};
-/**
- * This function evaluates code in template with object in ScopeChain.
- * This is usefull if you need to evaluate code that uses member names
- * that colide with external names that the code refers to.
- * There is almost exact method in utils.js called Richfaces.eval,
- * but it swallows exception thrown during evaluation, which makes debugging
- * hard.
- */
-RichFaces.Schedule.eval = function(template, object) {
+ });
+ rf.ui.Schedule.prototype.messages = [];
+ // define super class reference - reference to the parent prototype
+ var $super = rf.ui.Schedule.$super;
+})(jQuery, RichFaces);
+RichFaces.ui.Schedule.eval = function(template, object) {
var value;
with (object) {
value = eval(template);
}
return value;
-};
-RichFaces.Schedule.prototype.select = function(startDate, endDate, allDay) {
- this.delegate.fullCalendar('select', startDate, endDate, allDay);
-};
-RichFaces.Schedule.prototype.unselect = function() {
- this.delegate.fullCalendar('unselect');
-};
-RichFaces.Schedule.prototype.render = function() {
- this.delegate.fullCalendar('render');
-};
-RichFaces.Schedule.prototype.destroy = function() {
- this.delegate.fullCalendar('destroy');
-};
-RichFaces.Schedule.prototype.getView = function() {
- return this.delegate.fullCalendar('getView');
-};
-RichFaces.Schedule.prototype.changeView = function(viewName) {
- this.delegate.fullCalendar('changeView', viewName);
-};
-RichFaces.Schedule.prototype.prev = function() {
- this.delegate.fullCalendar('prev');
-};
-RichFaces.Schedule.prototype.next = function() {
- this.delegate.fullCalendar('next');
-};
-RichFaces.Schedule.prototype.prevYear = function() {
- this.delegate.fullCalendar('prevYear');
-};
-RichFaces.Schedule.prototype.nextYear = function() {
- this.delegate.fullCalendar('nextYear');
-};
-RichFaces.Schedule.prototype.today = function() {
- this.delegate.fullCalendar('today');
-};
-RichFaces.Schedule.prototype.gotoDate = function(year, month, date) {
- this.delegate.fullCalendar('gotoDate', year, month, date);
-};
-RichFaces.Schedule.prototype.incrementDate = function(years, months, days) {
- this.delegate.fullCalendar('incrementDate', years, months, days);
-};
-RichFaces.Schedule.prototype.updateItem = function(item) {
- this.delegate.fullCalendar('updateItem', item);
-};
-RichFaces.Schedule.prototype.getItems = function(idOrFilter) {
- return this.delegate.fullCalendar('clientEvents', idOrFilter);
-};
-RichFaces.Schedule.prototype.removeItems = function(idOrFilter) {
- this.delegate.fullCalendar('removeEvents', idOrFilter);
-};
-RichFaces.Schedule.prototype.refetchItems = function() {
- this.delegate.fullCalendar('refetchEvents');
-};
-RichFaces.Schedule.prototype.addItemsSource = function(source) {
- this.delegate.fullCalendar('addEventSource', source);
-};
-RichFaces.Schedule.prototype.removeItemsSource = function(source) {
- this.delegate.fullCalendar('removeEventSource', source);
-};
-RichFaces.Schedule.prototype.addItem = function(event, stick) {
- this.delegate.fullCalendar('renderEvent', event, stick);
-};
-RichFaces.Schedule.prototype.reRender = function() {
- this.delegate.fullCalendar('rerenderEvents');
};
\ No newline at end of file
Deleted: sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,573 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
- version="2.0" id="schedule">
- <
namespace>http://richfaces.org/schedule</namespace>
- <tag>
- <tag-name>scheduleMonthView</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleMonthView</component-type>
-
<renderer-type>org.richfaces.ScheduleMonthViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this
component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value
must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be
rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for
this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>weekMode</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>schedule</tag-name>
- <component>
- <component-type>org.richfaces.Schedule</component-type>
- <renderer-type>org.richfaces.ScheduleRenderer</renderer-type>
-
<handler-class>org.richfaces.view.facelets.html.ScheduleHandler</handler-class>
- </component>
- <attribute>
- <name>allDayByDefault</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>allDaySlot</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>allDayText</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>aspectRatio</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <name>axisFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>The value binding expression used to wire up this
component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>contentHeight</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>date</name>
- <type>java.util.Date</type>
- </attribute>
- <attribute>
- <name>dateRangeChangeListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>dateRangeSelectListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>dateSelectListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>defaultEventMinutes</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>disableDragging</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>disableResizing</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <name>dragRevertDuration</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>editable</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <description>First day of week. 1 - sunday, 2 - monday,..,7 -
saturday.</description>
- <name>firstDay</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>firstHour</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>headerCenter</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>headerLeft</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>headerRight</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>height</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value
must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>itemMoveListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>itemResizeListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>itemSelectListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>maxTime</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>minTime</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforedaterangeselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforedateselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforeitemdrop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforeitemresize</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforeitemselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>ondaterangechange</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>ondaterangeselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>ondateselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemdragstart</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemdragstop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemdrop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemmouseout</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemmouseover</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemresize</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemresizestart</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemresizestop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onviewchange</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>rTL</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be
rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for
this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>selectHelper</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>selectable</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>showWeekends</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>slotMinutes</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>switchType</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>unselectAuto</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>unselectCancel</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>value</name>
- <type>java.lang.Object</type>
- </attribute>
- <attribute>
- <name>var</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>view</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>viewChangeListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>weekMode</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>widgetVar</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleAgendaWeekView</tag-name>
- <component>
-
<component-type>org.richfaces.ScheduleAgendaWeekView</component-type>
-
<renderer-type>org.richfaces.ScheduleAgendaWeekViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this
component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value
must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be
rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for
this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleBasicWeekView</tag-name>
- <component>
-
<component-type>org.richfaces.ScheduleBasicWeekView</component-type>
-
<renderer-type>org.richfaces.ScheduleBasicWeekViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this
component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value
must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be
rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for
this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleItem</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleItem</component-type>
-
<renderer-type>org.richfaces.ScheduleItemRenderer</renderer-type>
- </component>
- <attribute>
- <name>allDay</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <description>The value binding expression used to wire up this
component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>editable</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>endDate</name>
- <type>java.util.Date</type>
- </attribute>
- <attribute>
- <name>eventId</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value
must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be
rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for
this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>startDate</name>
- <type>java.util.Date</type>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>title</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>url</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleAgendaDayView</tag-name>
- <component>
-
<component-type>org.richfaces.ScheduleAgendaDayView</component-type>
-
<renderer-type>org.richfaces.ScheduleAgendaDayViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this
component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value
must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be
rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for
this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleBasicDayView</tag-name>
- <component>
-
<component-type>org.richfaces.ScheduleBasicDayView</component-type>
-
<renderer-type>org.richfaces.ScheduleBasicDayViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this
component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value
must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be
rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for
this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
-</facelet-taglib>
\ No newline at end of file
Modified:
sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml
===================================================================
---
sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml 2011-04-15
12:37:03 UTC (rev 22423)
+++
sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml 2011-04-15
13:42:33 UTC (rev 22424)
@@ -1,13 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite">
-<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
-
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
-
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
-
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
-
<cc:interface>
<cdk:class>org.richfaces.renderkit.ScheduleRenderer</cdk:class>
<cdk:superclass>org.richfaces.renderkit.ScheduleRendererBase</cdk:superclass>
@@ -16,12 +11,12 @@
</cc:interface>
<cc:implementation>
- <cdk:call
-
expression="org.richfaces.renderkit.util.FormUtil.throwEnclFormReqExceptionIfNeed(facesContext,
component);"/>
- <div id="#{clientId}" class="rich-schedule
#{component.attributes['styleClass']}"/>
- <script type="text/javascript">
- <cdk:call
expression="writeInitFunction(facesContext,component);"/>
- </script>
+ <cdk:call
expression="org.richfaces.renderkit.util.FormUtil.throwEnclFormReqExceptionIfNeed(facesContext,
component);"/>
+ <div id="#{clientId}" class="rich-schedule
#{component.attributes['styleClass']}">
+ <script type="text/javascript">
+ <cdk:call
expression="writeInitFunction(facesContext,component);"/>
+ </script>
+ </div>
</cc:implementation>
</cdk:root>
\ No newline at end of file