Author: sebawagner Date: Tue Mar 13 17:45:06 2012 New Revision: 1300257 URL: http://svn.apache.org/viewvc?rev=1300257&view=rev Log: OPENMEETINGS-7 - Add Day view
Added:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/one_day_hours.png
(with props)
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/functions.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/library.lzx
incubator/openmeetings/trunk/singlewebapp/docs/CalendarService.html
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml?rev=1300257&r1=1300256&r2=1300257&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
Tue Mar 13 17:45:06 2012
@@ -58,6 +58,7 @@
<!-- Services -->
<import resource="red5-services/meetingmemberservice.service.xml"/>
+ <import resource="red5-services/calendarservice.service.xml"/>
<import resource="red5-services/fileservice.service.xml"/>
<import resource="red5-services/conferenceservice.service.xml"/>
<import resource="red5-services/userservice.service.xml"/>
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/functions.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/functions.lzx?rev=1300257&r1=1300256&r2=1300257&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/functions.lzx
(original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/functions.lzx
Tue Mar 13 17:45:06 2012
@@ -382,7 +382,7 @@ function parseDateOnlyFromXmlString(str)
var tYear = str.substr(0,4);
var tMonth = str.substr(5,2);
var tDay = str.substr(8,2);
- return new Date(tYear,tMonth,tDay);
+ return new Date(tYear,Number(tMonth)-1,tDay);
}
@@ -399,7 +399,7 @@ function parseDateTimeFromXmlString(str)
var tDay = str.substr(8,2);
var tHour = str.substr(11,2);
var tMin = str.substr(14,2);
- return new Date(tYear,tMonth,tDay,tHour,tMin,0);
+ return new Date(tYear,Number(tMonth)-1,tDay,tHour,tMin,0);
}
]]>
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx?rev=1300257&r1=1300256&r2=1300257&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
Tue Mar 13 17:45:06 2012
@@ -20,6 +20,7 @@
-->
<library>
+ <resource name="calendar_one_day_hours_index_bg_rsc"
src="resources/one_day_hours.png" />
<resource name="calendar_day_hours_index_bg_rsc"
src="resources/day_hours_index_only.png" />
<resource name="calendar_day_bg_rsc" src="resources/day_hours.png" />
<resource name="calendar_add_user_rsc" src="resources/user_add.png" />
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx?rev=1300257&r1=1300256&r2=1300257&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
Tue Mar 13 17:45:06 2012
@@ -25,6 +25,8 @@
<attribute name="currentDate" value="null" />
<attribute name="currentWeek" value="0" type="number" />
+ <attribute name="currentDay" value="0" type="number" />
+
<attribute name="rowfactor" value="6" type="number" />
<attribute name="columnfactor" value="6" type="number" />
@@ -33,7 +35,9 @@
<attribute name="reRenderLock" value="false" type="boolean" />
<method name="setCurrentDate" args="tDate">
- this.currentDate = tDate;
+ if (this.currentDate != tDate) {
+ this.currentDate = tDate;
+ }
</method>
<method name="isCurrentMonth" args="tMonth">
@@ -44,14 +48,24 @@
return (tMonth == this.currentDate.getMonth());
</method>
- <method name="showDay" args="weekNo,dayNo">
- this.reRenderLock = true;
- this.setAttribute("viewType","day");
- this.reRenderLock = false;
-
//rootCalenderNode.days.setAttribute('datapath','days[4]');
-
//rootCalenderNode.setAttribute('datapath','getAppointmentsByWeekCalendarResponse/return[2]');
- this.setAttribute("rowfactor",1);
- this.setAttribute("columnfactor",1);
+ <method name="showDay" args="weekNo">
+ <![CDATA[
+ this.reRenderLock = false;
+ var tColumnRelativeToFirstDay =
this.currentDate.getDay() - canvas.firstdayinweek;
+ if (tColumnRelativeToFirstDay < 0) {
+ tColumnRelativeToFirstDay = 7 +
tColumnRelativeToFirstDay;
+ }
+
+ if ($debug) Debug.write("Column Day
",tColumnRelativeToFirstDay);
+
+ this.currentDay =
(tColumnRelativeToFirstDay+1); //Column count starts with 1 not with zero
+ this.currentWeek = 2;
+ this.setAttribute("viewType","day");
+
//rootCalenderNode.days.setAttribute('datapath','days[4]');
+
//rootCalenderNode.setAttribute('datapath','getAppointmentsByWeekCalendarResponse/return[2]');
+ this.setAttribute("rowfactor",1);
+ this.setAttribute("columnfactor",1);
+ ]]>
</method>
<method name="showWeek" args="weekNo">
@@ -73,86 +87,141 @@
this.setAttribute("columnfactor",7);
</method>
- <state name="month" applied="${ classroot.viewType == 'month'
}">
+ <state name="day" applied="${ classroot.viewType == 'day' }">
<view width="${ parent.width }" height="${
parent.height }">
- <view
datapath="getAppointmentsByWeekCalendarResponse/return"
- width="${ parent.width }"
height="${ Math.round( parent.height/6 ) }" >
+ <handler name="oninit">
+
this.setAttribute("datapath","getAppointmentsByWeekCalendarResponse/return["+classroot.currentWeek+"]");
+ </handler>
- <!-- The months -->
-
- <!-- The days -->
- <view name="days" datapath="days"
width="${ Math.round( parent.width/7 ) }" clip="true"
- height="${
parent.height }" bgcolor="0xDDDDDD" >
-
- <attribute name="dayDate"
value="null" />
+ <view x="41" width="${ parent.width-10 }"
height="20" bgcolor="0xDDDDDD">
+ <view name="days" width="${
(parent.width-41) }" clip="true"
+
bgcolor="0xDDDDDD" height="19">
- <attribute name="viewType"
value="${ classroot.viewType }" type="string" />
-
- <handler name="ondata" args="d">
- if(d is
lz.DataNodeMixin){
- var
lzDataPointer = new lz.datapointer();
-
lzDataPointer.setPointer(d);
- var xmlDate =
lzDataPointer.xpathQuery('tDate/text()');
- var splitDate =
xmlDate.split("-");
- this.dayDate =
new Date(splitDate[0], Number(splitDate[1])-1, splitDate[2]);
-
this.renderView();
- }
+ <handler name="oninit">
+
this.setAttribute("datapath","days["+classroot.currentDay+"]");
</handler>
+
+ <text name="_title" width="${
parent.width -1 }" fgcolor="0x666666"
+
datapath="tDate" bgcolor="0xFFFFFF" height="19" >
+ <handler name="ondata"
args="d">
+ var tDate =
parseDateOnlyFromXmlString(d.childNodes[0].data);
+
this.setAttribute("text",canvas.dayShortNames[tDate.getDay()]+"
"+tDate.getDate()+"."+tDate.getMonth());
+ </handler>
+ </text>
- <method name="renderView">
- var tDay =
this.dayDate.getDate();
- var tMonth =
this.dayDate.getMonth();
- if
(parent.parent.parent.isCurrentMonth(tMonth)) {
-
this._content._title.setAttribute("fgcolor",0x000000);
- if (tDay == 1) {
- tDay =
tDay + "." + canvas.monthnames[this.dayDate.getMonth()];
- }
- } else {
-
this._content._title.setAttribute("fgcolor",0xBBBBBB);
- }
-
this._content._title.setAttribute("text",tDay);
- </method>
+ </view>
+ <simplelayout axis="x" spacing="0" />
+ </view>
+
+ <view y="20" width="${ parent.width }"
height="${ parent.height-20 }">
+
+ <view width="${ parent.width }"
height="${ parent.height }" clip="true" bgcolor="0xDDDDDD">
+
+ <view width="${ parent.width-10
}" height="721" >
- <view name="_content" width="${
parent.width -1 }" bgcolor="0xFFFFFF"
-
height="${ parent.height -1 }">
-
- <text name="_title" />
+ <view name="hours"
width="40" height="720" >
+
+ <view
name="dayBg2" resource="calendar_day_hours_index_bg_rsc" />
+
+ <view>
+
<handler name="oninit">
+
<![CDATA[
+
for (var i=0;i<24;i++) {
+
if (i<10) {
+
new lz.textHourHelper(this,{text:"0"+i+":00"});
+
} else {
+
new lz.textHourHelper(this,{text:i+":00"});
+
}
+
}
+
]]>
+
</handler>
+
<simplelayout axis="y" />
+ </view>
+
+ </view>
-
- <view width="$once{
parent.width }" y="18">
- <view
datapath="appointments" bgcolor="0xA59CFC" width="$once{ parent.width }">
- <text
name="_time" datapath="start" >
+ <view width="1" />
+
+ <!-- The days -->
+ <view name="days"
width="${ (parent.width-41) }"
+
height="720" bgcolor="0xDDDDDD" >
+
+ <handler
name="oninit">
+
this.setAttribute("datapath","days["+classroot.currentDay+"]");
+ </handler>
+ <attribute
name="dayDate" value="null" />
+
+ <attribute
name="viewType" value="${ classroot.viewType }" type="string" />
+
+ <handler
name="ondata" args="d">
+ if(d is
lz.DataNodeMixin){
+
var lzDataPointer = new lz.datapointer();
+
lzDataPointer.setPointer(d);
+
var xmlDate = lzDataPointer.xpathQuery('tDate/text()');
+
var splitDate = xmlDate.split("-");
+
this.dayDate = new Date(splitDate[0], Number(splitDate[1])-1, splitDate[2]);
+ }
+ </handler>
+
+ <view
name="_content" width="${ parent.width -1 }" bgcolor="0xFFFFFF"
+
height="720">
+
+ <view
name="dayBg2" resource="calendar_one_day_hours_index_bg_rsc" stretches="width"
+
width="$once{ parent.width }" ></view>
+
+ <view
datapath="appointments" bgcolor="0xA59CFC" width="$once{ parent.width }"
height="60">
<handler name="ondata" args="d">
-
this.setAttribute("text",parseTimeStringFromXmlString(d.childNodes[0].data));
+
<![CDATA[
+
if (classroot.reRenderLock) {
+
return;
+
}
+
var dataPointer = new lz.datapointer();
+
dataPointer.setPointer(d);
+
var startDate =
parseDateTimeFromXmlString(dataPointer.xpathQuery('start/text()'));
+
var endDate =
parseDateTimeFromXmlString(dataPointer.xpathQuery('end/text()'));
+
+
if ($debug) Debug.write("COMPARE -- ",startDate,endDate);
+
+
var heightInMinutes = parent.height/1440;
+
var startMin = (startDate.getHours() * 60 ) +
startDate.getMinutes();
+
var endMin = (endDate.getHours() * 60 ) + endDate.getMinutes();
+
+
this.setAttribute("y",Math.round(heightInMinutes*startMin));
+
this.setAttribute("height",Math.round((endMin -
startMin)*heightInMinutes));
+
+
if ($debug) Debug.write("y,height -- ",this.y,this.height);
+
]]>
</handler>
- </text>
- <text
name="_title" x="36" datapath="title" text="$path{ 'text()' }" />
+
+
<text name="_title" x="2" datapath="title" text="$path{ 'text()' }" />
+ </view>
</view>
- <simplelayout
axis="y" spacing="1" />
- </view>
-
+
+ </view>
+
+ <simplelayout axis="x"
spacing="0" />
+
</view>
-
+
+ <om_vscrollbar />
+
</view>
- <simplelayout axis="x" spacing="0" />
</view>
- <simplelayout axis="y" spacing="0" />
-
</view>
- </state>
+ </state>
+
<state name="week" applied="${ classroot.viewType == 'week' }">
<view width="${ parent.width }" height="${
parent.height }">
<handler name="oninit">
this.setAttribute("datapath","getAppointmentsByWeekCalendarResponse/return["+classroot.currentWeek+"]");
- //this.updateData();
</handler>
<view x="41" width="${ parent.width-10 }"
height="20" bgcolor="0xDDDDDD">
@@ -163,7 +232,11 @@
datapath="tDate" bgcolor="0xFFFFFF" height="19" >
<handler name="ondata"
args="d">
var tDate =
parseDateOnlyFromXmlString(d.childNodes[0].data);
-
this.setAttribute("text",canvas.dayShortNames[tDate.getDay()]+"
"+tDate.getDate()+"."+tDate.getMonth());
+
+ var
tStringWeekDay = canvas.dayShortNames[tDate.getDay()];
+ if ($debug)
Debug.write("Calc Week day ",tStringWeekDay,tDate.getDay(),tDate);
+
+
this.setAttribute("text",canvas.dayShortNames[tDate.getDay()]+"
"+tDate.getDate()+"."+tDate.getMonth()+".");
</handler>
</text>
@@ -268,6 +341,79 @@
</state>
+ <state name="month" applied="${ classroot.viewType == 'month'
}">
+
+ <view width="${ parent.width }" height="${
parent.height }">
+
+ <view
datapath="getAppointmentsByWeekCalendarResponse/return"
+ width="${ parent.width }"
height="${ Math.round( parent.height/6 ) }" >
+
+ <!-- The months -->
+
+ <!-- The days -->
+ <view name="days" datapath="days"
width="${ Math.round( parent.width/7 ) }" clip="true"
+ height="${
parent.height }" bgcolor="0xDDDDDD" >
+
+ <attribute name="dayDate"
value="null" />
+
+ <attribute name="viewType"
value="${ classroot.viewType }" type="string" />
+
+ <handler name="ondata" args="d">
+ if(d is
lz.DataNodeMixin){
+ var
lzDataPointer = new lz.datapointer();
+
lzDataPointer.setPointer(d);
+ var xmlDate =
lzDataPointer.xpathQuery('tDate/text()');
+ var splitDate =
xmlDate.split("-");
+ this.dayDate =
new Date(splitDate[0], Number(splitDate[1])-1, splitDate[2]);
+
this.renderView();
+ }
+ </handler>
+
+ <method name="renderView">
+ var tDay =
this.dayDate.getDate();
+ var tMonth =
this.dayDate.getMonth();
+ if
(parent.parent.parent.isCurrentMonth(tMonth)) {
+
this._content._title.setAttribute("fgcolor",0x000000);
+ if (tDay == 1) {
+ tDay =
tDay + "." + canvas.monthnames[this.dayDate.getMonth()];
+ }
+ } else {
+
this._content._title.setAttribute("fgcolor",0xBBBBBB);
+ }
+
this._content._title.setAttribute("text",tDay);
+ </method>
+
+ <view name="_content" width="${
parent.width -1 }" bgcolor="0xFFFFFF"
+
height="${ parent.height -1 }">
+
+ <text name="_title" />
+
+
+ <view width="$once{
parent.width }" y="18">
+ <view
datapath="appointments" bgcolor="0xA59CFC" width="$once{ parent.width }">
+ <text
name="_time" datapath="start" >
+
<handler name="ondata" args="d">
+
this.setAttribute("text",parseTimeStringFromXmlString(d.childNodes[0].data));
+
</handler>
+ </text>
+ <text
name="_title" x="36" datapath="title" text="$path{ 'text()' }" />
+ </view>
+ <simplelayout
axis="y" spacing="1" />
+ </view>
+
+ </view>
+
+ </view>
+
+ <simplelayout axis="x" spacing="0" />
+ </view>
+
+ <simplelayout axis="y" spacing="0" />
+
+ </view>
+
+ </state>
+
</class>
<class name="textHourHelper" extends="text" height="30"
Added:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/one_day_hours.png
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/one_day_hours.png?rev=1300257&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/one_day_hours.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/library.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/library.lzx?rev=1300257&r1=1300256&r2=1300257&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/library.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/library.lzx
Tue Mar 13 17:45:06 2012
@@ -22,7 +22,6 @@
<!--
<include href="compontents/" />
-
<include href="lzCalendar.lzx" />
-->
@@ -42,5 +41,6 @@
<include href="addExternalAttendee.lzx" />
<include href="confirmCancelPopup.lzx" />
+
</library>
Modified: incubator/openmeetings/trunk/singlewebapp/docs/CalendarService.html
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/docs/CalendarService.html?rev=1300257&r1=1300256&r2=1300257&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/docs/CalendarService.html
(original)
+++ incubator/openmeetings/trunk/singlewebapp/docs/CalendarService.html Tue Mar
13 17:45:06 2012
@@ -94,6 +94,14 @@ limitations under the License.
<a
href="#getAppointmentReminderTypList"><b>getAppointmentReminderTypList</b></a><br/>
<div class="navigation_comment"><i >Get all reminder types for
calendar events</i></div>
</div>
+ <div>
+ <a href="#main"><b>main</b></a><br/>
+ <div class="navigation_comment"><i ></i></div>
+ </div>
+ <div>
+ <a
href="#getAppointmentsByWeekCalendar"><b>getAppointmentsByWeekCalendar</b></a><br/>
+ <div class="navigation_comment"><i ></i></div>
+ </div>
</div>
<h3>Methods Details in CalendarService</h3>
@@ -1068,6 +1076,62 @@ limitations under the License.
<a
href="http://localhost:5080/openmeetings/services/CalendarService/getAppointmentReminderTypList?SID=VALUE">http://localhost:5080/openmeetings/services/CalendarService/getAppointmentReminderTypList?SID=VALUE</a>
</a>
</div>
+ <div
class="method">
+ <div class="method_header">
+ <div style="margin-left:10px">
+ <a name="main" ><b>main</b></a>
+ </div>
+ </div>
+
+ Method: <i>main (
+
String args
+ )
+ </i><br/>
+ <p>
+
+ </p>
+ <p>
+ Return Type: void
+ </p>
+ <p>Params:</p>
+ <b>Warning:</b><i>
Params in this method do not seem to be correctly documentated</i>
+ <br/><br/>
+
+ <i>No Params</i>
+ <br/>
+ REST Sample Call/URL:<br/>
+
<a
href="http://localhost:5080/openmeetings/services/CalendarService/main?args=VALUE">http://localhost:5080/openmeetings/services/CalendarService/main?args=VALUE</a>
+ </a>
+ </div>
+ <div
class="method">
+ <div class="method_header">
+ <div style="margin-left:10px">
+ <a name="getAppointmentsByWeekCalendar"
><b>getAppointmentsByWeekCalendar</b></a>
+ </div>
+ </div>
+
+ Method: <i>getAppointmentsByWeekCalendar (
+
int firstDayInWeek
+
,
+ Date startDate
+ )
+ </i><br/>
+ <p>
+
+ </p>
+ <p>
+ Return Type: java.util.List
+ </p>
+ <p>Params:</p>
+ <b>Warning:</b><i>
Params in this method do not seem to be correctly documentated</i>
+ <br/><br/>
+
+ <i>No Params</i>
+ <br/>
+ REST Sample Call/URL:<br/>
+
<a
href="http://localhost:5080/openmeetings/services/CalendarService/getAppointmentsByWeekCalendar?firstDayInWeek=VALUE&startDate=VALUE">http://localhost:5080/openmeetings/services/CalendarService/getAppointmentsByWeekCalendar?firstDayInWeek=VALUE&startDate=VALUE</a>
+ </a>
+ </div>
</body>
