The Common-Controls Tag Library

<ctrl:scheduler>

Creates a scheduler which allows to manage events and appointments.
../images/images/scheduler_small.gif

Body content: JSP
Tag class: SchedulerTag
 

[ Syntax ]

Standard Syntax
<ctrl:scheduler
[ action = "String" ]
[ addButton = "ACL" ]
[ ajax = "Boolean" ]
[ allDayArea = "Boolean" ]
[ border = "Integer" ]
[ checkboxes = "boolean" ]
[ columns = "Integer" ]
[ compressWeekEnds = "Boolean" ]
[ createButton = "ACL" ]
[ dayEndHour = "Integer" ]
[ dayStartHour = "Integer" ]
[ disabled = "boolean" ]
[ exportListButton = "ACL" ]
[ filter = "boolean" ]
[ firstDayOfWeek = "{Def | Mo | Tu | We | Th | Fr | Sa | Su}" ]
[ formElement = "boolean" ]
[ height = "String" ]
[ help = "String" ]
[ hideButtons = "String list" ]
[ id = "String" ]
[ imagemap = "String" ]
[ interval = "Integer" ]
[ locale = "String" ]
[ maxVisible = "Integer" ]
[ monthIncrement = "Integer" ]
[ name = "String" ]
[ noframe = "Boolean" ]
[ permission = "ACL" ]
[ popups = "Boolean" ]
[ printListButton = "ACL" ]
[ property = "String" ]
[ refreshButton = "ACL" ]
[ rows = "Integer" ]
[ runat = "{server | client | auto}" ]
[ scope = "{any | page | request | session | application}" ]
[ shadow = "boolean" ]
[ style = "String" ]
[ styleClass = "String" ]
[ styleId = "String" ]
[ tabindex = "Integer" ]
[ title = "" ]
[ transaction = "Boolean" ]
[ view = "{day | workweek | week | month | year}" ]
[ viewButtons = "A comma seperated list." ]
[ weekEndDays = "Boolean" ]
[ width = "String" ]
[ workEndHour = "Integer" ]
[ workingDays = "A comma seperated list" ]
[ workStartHour = "Integer" ]
>
...Body Content...

</ctrl:scheduler>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
actionString Specifies the Struts Action that is to be called in case of control element events.

This attribute need not be specified if the tag is included within a Struts <html:form> tag. In that case, the name of the action is determined using the Struts Form Bean.

Annotation: The action must be declared in one of the struts-config.xml files.

 
addButtonACL Specifies if the create-button schould be displayed within the header of the control. A Access Control List (ACL) can be used to grant access to restricted users.  
ajaxBoolean Activates the AJAX function of the column. With AJAX all control events will be sent asynchronously to the application server where the processing takes place.

The event processing on the server is the same as without AJAX enabled. However the application developer has the possibility to control the response output through some additional methods of the AjaxRequest interface (the base class for ActionContext).

The normal AJAX server processing (-> AjaxRequest.isAjaxCanceled() == false) will send back a XML stream to the Web Browser. This stream contains only the HTML code for the dirty controls, which will be merged in the Browser through a JavaScript handler into the current HTML DOM Tree. So the Server will not transmit the full HTML page!

  • (+) The transfered HTML code is much smaller.
  • (+) The HTML page stays in the Browser window while the server request is being processed. So the screen will not "flicker".
  • (-) The browser will not keep track of AJAX requests in the navigation history!
  • (-) AJAX depends on JavaScript. Without JavaScript the event will result in a normal browser - server round trip.

Most of the Controls will add themselves to the dirty list of the ActionContext. This is done through a call to AjaxRequest.markDirty(). With this method the application developer has the opportunity to add additional controls to the dirty list and send them back to the browser in the XML stream. This is necessary when an event handler changes the state of a second control that was not the originator of the request.

In some cases it is not sufficient to send back only the dirty control because the whole HTML page has to be changed. In this cases the application developer can cancel AJAX server event processing by calling the AjaxRequest.cancelAjaxRequest() method. When the AJAY request is canceled the framework will send a full HTML page back to the Browser - as if this was a normal HTTP request.

The Common-Controls AJAX XML Protocol has the following format:


<?xml version="1.0" encoding="UTF-8" ?>
<ajax-response>
	<token/>
	<controls>
		<control styleId="" class="" name="">
			<html>
				<[CDATA[...]] >
			</html>
		</control>
	</controls>
</ajax-response>

				
 
allDayAreaBoolean Sets a value specifying whether the all-day area is displayed.  
borderInteger Specifies the thickness of the border that has to be drawn around the control element.  
checkboxesboolean Specifies if a checkbox should be displayed in front of an appointment.

The appointment needs to implement the checkable interface, so that the control can render the checkboxes.

 
columnsInteger Defines the number of columns (months) with the year view.  
compressWeekEndsBoolean Specifies if the days at the weekend should be displayed compresed to save some space.  
createButtonACL Indicates whether a button for creating a new data record should be displayed. By specifying an Access Control List, the creation of new records can be restricted to certain users.  
dayEndHourInteger Sets a value indicating the end of the hour range displayed by the Schedule on DayView.

Annotation: valid values range from 0 to 23

 
dayStartHourInteger Sets a value indicating the start of the hour range displayed by the Schedule on DayView.

Annotation: valid values range from 0 to 23

 
disabledboolean This attribute can be used to disable the control element. It then does not accept any user inputs and does not generate any control element events.  
exportListButtonACL Shows the exportlist button within the list header. An Access Control List (ACL) can be specified to grant access the button to restricted users.  
filterboolean The automatic HTML coding of the column contents can be activated or disabled with the filter-attribute.  
firstDayOfWeekString Sets the first day of the week
  • Def = Uses the first day of the week defined by the active locale
  • Mo = Monday
  • Tu = Tuesday
  • We = Wednesday
  • Th = Thursday
  • Fr = Friday
  • Sa = Saturday
  • Su = Sunday
 
formElementboolean This attribute is used to control how the control element should behave in case of a user action.
As form element
A submit of the surrounding form is carried out. All the information about the control element event is transported to the server in hidden fields.
As an independent control element
Control element events are directly triggered in the form of hyperlinks. All the data input in the HTML page is then lost.
Internally, this attribute is used to control how the control element should generate Painter links - as HTML-A tags or HTML-Input tags.

Annotation: The value true may only be used when the control element is situated in a form.

 
heightString Sets the height of the control element. The height may be specified in absolute or percent terms.

See the HTML documentation

 
helpString Allows to assign a help id for the element. If set, a help symbol will be displayed beside the element, which will generate an onHelp event if the icon is clicked. The id can be used to display a special page of the help system. The help system is not part of the Common-Controls Framework.

To generate the hyperlink some default framework resources where used:
Resource KeyDescriptionDefault
fw.help.onclickAn optional onclick script handler. The handler can include a {0} placeholder for the help id-
fw.help.targetSpecifies the target where to open the hyperlink_blank
fw.help.tooltipA tooltip for the hyperlinkcontext help

Annotation: A jump screen of the Help system must be specified.

 
hideButtonsString list This attribute can be used to hide some of the buttons. The buttons needs to be specified within a semicolon separated list.

Annotation: A semicolon separated list. The button names must match values of ControlButton.getName()

 
idString The name of a page scope JSP bean that will contain the current element. Using the given Id, the variable can be accessed in scripting expressions in the tag Body. The id mus be a string lteral because the JSP compiler generates a variable withthis name at compile time

Annotation: A valid Java identifier must be given.

 
imagemapString Specifies the name of an Imagemap which must be saved in the request. The values that the property-attribute returns are mapped to the entries of this Imagemap. The mapping is done with the help of the regular expression, which is assigned to every entry of the Imagemap.

Annotation: Under the name, there must be an Imagemap saved in the request.

 
intervalInteger Sets a value specifying the interval in which the hour is divided.

Annotation: valid values are 5, 6 , 10, 15, 30, 60

 
localeString enables localization for the control element. String literals will be interpreted as keys in the Application.properties file.

Annotation: boolean value true oder false oder the name of a locale.

 
maxVisibleInteger Sets the maximal number of displayed appointments for one day.  
monthIncrementInteger Sets the number of month to increment in year view when the user clicks on one of the navigation buttons. A value of 0 resets the the control to the default increment which is the number of visible months (= rows * columns)  
nameString Specifies the name of the Java-Bean. The Java-Bean must be stored in the given scope.

When the tag is surrounded by a Struts <html:form> tag, no Bean Name need be specified. In this case, the Java-Bean is drawn via a property of the Struts Form Bean.

Annotation: A valid Java identifier must be given.

 
noframeBoolean Can be used to hide the border for the control. The buttons will still be displayed above the control (depends on the registered PainterFactory.  
permissionACL With this attribute, access to the element can be restricted.

Authorizations are checked using the com.cc.framework.security.Principal object in the user session. The principal object is registered in the session with the method com.cc.framework.security.SecurityUtil#registerPrincipal(HttpSession, Principal). It is made available by the application developer by implementing the principal interface. In this manner, any authorization system can be very easily connected within the framework.

Authorizations are always specified in the form of an Access Control List (ACL). What is involved here is a semicolon-delimited list with individual authorizations. The framweork supports the following authorization types, which, however, can be expanded at will by the application developer:

Literal
true|false -> com.cc.framework.security.StaticPermission
Role
#rolename -> com.cc.framework.security.RoleBasedPermission
Function
$functionname -> com.cc.framework.security.FunctionBasedPermission

 
popupsBoolean Specifies that existing appointments within the year view will be displayed in a popup window.  
printListButtonACL Shows the printlist button within the list header. An Access Control List (ACL) can be specified to grant access the button to restricted users.  
propertyString Specifies the name of the property using which the Java-Bean is to be accessed. This is generally only necessary when the Java-Bean is associated with a Struts Form Bean.

Annotation: A valid Java identifier must be given.

 
refreshButtonACL Specifies whether a button should be displayed for updating the elements.  
rowsInteger Specifies the number of rows (months) within the year view.  
runatRunAt This attribute specifies whether, for the control element, Clientside JavaScript should be used, or whether the control element should work purely with Server Roundtrips.
  • server = All control element actions result in a Server Roundtrip and are processed on the server.
  • client = control element actions are carried out directly in the browser of the user. It depends on the Painter Factory used and the specific control element, how far the support for Clientside Scripting goes!
  • auto = The framework selects based on the users browser settings "client" when JavaScript is enabled and "server" when JavaScript is disabled.
 
scopeHTTPScope This attribute shows the Scope in which the Java-Bean with the actual display data can be found.
  • any = The Bean is searched for in ever Scope.
  • page = The Bean exists as a local variable in the JSP Page.
  • request = The Bean is in the HTTP-Request.
  • session = The Bean is in the HTTP-Session.
  • application = The Bean is in the Servletkontext.
 
shadowboolean Specifies whether the control element should be saved with a shadow.

This function is only available in the case of specific Painterfactories.

 
styleString An HTML-style can be directly specified with this attribute.

Annotation: See HTML documentation for the attribute style.

 
styleClassString The HTML-class attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the attribute class.

 
styleIdString The HTML-id attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the Attribute id.

 
tabindexInteger Tabulator Index for this element.  
title 
transactionBoolean This flag directs the framework to append a transaction token to all generated hyperlinks. The transactio token allows the detection of form re-submissions (multiple submission of the same HTTP form).  
viewScheduleView Specifies the layout of the calendar
  • day = Shows only a single day
  • workweek = Shows the working days for one week
  • week = Shows all days for one week
  • month = Shows all days for one month
  • year = Creates a reduced month view
 
viewButtonsA comma seperated list. Specifies wich buttons should be displayed the different views. Allows to define a comma seperated list.
  • false = No buttons where shown
  • true = All buttons to switch between the different views will be displayed
  • day = Day view
  • workweek = working days view (5 days)
  • week = week view
  • month = month view
  • year = year view
 
weekEndDaysBoolean Dieses Attribut legt fest ob die Wochenende Tage angezeigt werden sollen (Samstag und Sonntag)  
widthString Sets the width of the control element. The height may be specified in absolute or percent terms.

See the HTML documentation

 
workEndHourInteger Sets a value indicating the end time of the day for the working hours.

Annotation: valid values range from 0 to 23

 
workingDaysA comma seperated list Collection with the working days for a week. A comma seperated list needs to be specified:
  • Su = Sunday
  • Mo = Monday
  • Tu = Tuesday
  • We = Wednesday
  • Th = Thursday
  • Fr = Friday
  • Sa = Saturday
 
workStartHourInteger Sets a value indicating the start time of the day for the working hours.

Annotation: valid values range from 0 to 23

 
 

[ Server Events ]

EventDescription
AddAppointment
public void control_onAddAppointment(
	ControlRequestContext ctx,
	long timeInMillis) throws Exception
AppointmentClick
public void control_onAppointmentClick(
	ControlRequestContext ctx,
	String key,
	long timeInMillis) throws Exception
ChangeDate
public void control_onChangeDate(
	ControlRequestContext ctx,
	long timeInMillis,
	String view) throws Exception
CheckAppointment
public void control_onCheckAppointment(
	ControlRequestContext ctx,
	String key,
	long timeInMillis,
	boolean check) throws Exception
CheckDate
public void control_onCheckDate(
	ControlRequestContext ctx,
	long timeInMillis,
	SchedulerScope scope,
	boolean check) throws Exception
Create
public void control_onCreate(
	ControlActionContext ctx) throws Exception
ExportList
public void control_onExportList(
	ControlActionContext ctx) throws Exception
PrintList
public void control_onPrintList(
	ControlActionContext ctx) throws Exception
Refresh
public void control_onRefresh(
	ControlActionContext ctx) throws Exception
SelectDate
public void control_onSelectDate(
	ControlRequestContext ctx,
	long timeInMillis,
	String view) throws Exception
View
public void control_onView(
	ControlRequestContext ctx,
	String view) throws Exception

[ Example ]

Usage of the schedular control


<%@ taglib uri="http://www.common-controls.com/cc/tags-ctrl"    prefix="ctrl" %>

<ctrl:scheduler
   action="/sample901/scheduler"
   name="scheduler"
   title="scheduler.title"
   imagemap="im_category"
   createButton="true"
   refreshButton="true"
   noframe="false"
   width="100%"
   view="month"
   interval="30"
   dayStartHour="6"
   dayEndHour="20"
   maxVisible="3"
   rows="3"
   columns="3"
   weekEndDays="false"
   popups="true"
   filter="false"
   checkboxes="false"
   firstDayOfWeek="mo">

</ctrl:scheduler>