Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

How to Scheduling Gantt chart in ADF 11g ADF 11g has many cool data visual components which

h are very useful. And I was e ploring one of them !Scheduling Gantt chart". A Gantt chart is a graphical representation of the duration of tas#s against the progression of time. In ADF we can create three types of Gantt charts$% Project Gantt chart$ % used to show the progress of a pro&ect tas# against time. Resource utilization Gantt chart$ % used to show the utili'ation of resources against time. Scheduling Gantt chart: - shows the schedule or utili'ation of resource against progression of time. (his post I am going to cover this type of Gantt chart only. )ro*lem summary+ % In my office, we have many meeting rooms. -arious pro&ect teams #eep *oo#ing the meeting rooms. .ut right now the process of *oo#ing the meeting room is manual. If we can automate the meeting room *oo#ing system where$ % )ro&ect teams can *oo# the meeting rooms /ther teams can view the e isting *oo#ings Delete an already *oo#ed meeting 0dit the meeting details Sample application is here I have created following two data*ase ta*les !1ooms2 and 34eetings" for this$% 1ooms5 1oom id is primary #ey6

4eetings 5meetings7id is primary #ey, 1oom id is reference to rooms ta*le6

Step 1) 8reate an application *ased on fusion template. Step 2) 8reate two entity o*&ects *ased on a*ove ta*les. And two view o*&ects *ased on the created entity o*&ects. In the meetings entity o*&ect, for the 4eetingId attri*ute, un%chec# the mandatory propty.

Step 3) 8reate an application module and add the a*ove two view o*&ects in application module to create the data control. 9e need to add the room view o*&ect twice in the application module, one will *e used in Gantt chart and second to show the room list in drop down in create meeting popup.

Step 4) 8reate a &sp page *ased on out of *o provided /racle (hree column layout template. Step 5) Drop the 1oom-/1 from data control palette and drop it on center facet. And select GanttScheduling from conte t menu.

Step 6) Form the create scheduling Gantt chart window, select the following+%

Step ) we will change the ma&or and minor a is of the Gantt chart. .y default the ma&or a is is !ee"s and minor a is is da#s. 9e will change the ma&or a is to days and minor a is to hours. :ou can change it *y opening the created .&sp page in !source" view.

As per your re;uirement you can change it further. )ossi*le values for the time scale in given in ADF faces we* user interface developer guide in section <=.=.>.

Step $) ?ow we will change start time and end time of the minor a is. .y default, it will show the time from <@$AA hrs to <@$AAhrs. So we will change it , so that time in minor a is start from =$AA hrs and ends at 1=$AA hrs. (o achieve the same, create a managed *ean and add two varia*les say start(ime and end(ime with type &ava.util.Date and generate the getters and setters of same. And *ind the created varia*le with the start(ime and end(ime property of the created scheduled Gantt chart.

Also set the hori'ontalGrid-isi*le property of the Gantt chart to true. :ou can run your application to chec# if every this is fine till now or not. .ut you will see,still the menu *ar and tool*ar components of the Gantt chart is not ena*led. Step %) 9e will ena*le our application so that we can create meetings. 9hen user will select (as#8reate, we will show a popup to user where he will give details a*out the meeting. %&16 Select popup component from the component palette and drop it on af$form. Set the contentDelivery property of popup to la'yuncached. Setting this property will refresh popup contents every time it"s shown. (han#s to Brithi#a on /(? to help to identify this. .y default the property is set to la'y, which means popup will show the contents only first re;uest to popup is finished. .ecause of which popup was giving weird *ehavior. And select the dialog component from component palette and drop it as a child of the a*ove popup. Set the type property of the dialog to !8ancel2. (his will add a cancel *utton on the popup. %&2) From the data control palette, select 4eeting-/1 and drop it on a*ove created dialog component and select FormADF form from conte t menu.

8lic# o# on the 0dit Form field. Set the re;uired property of the meetings id input te t to true. %&3) Select the af$convertDate(ime under *oth the af$inputDate components and set the type property of it to !*oth2. (his will allow the user to select the time from the date pic#er popup. %&4) Select the room id input te t from the a*ove created adf form and delete it. ?ow select the 1oom id from 4eeting-/1 and drop it on the af+formCayout and select Single SelectionADF Select one choice from conte t menu.

%&56 Select following from the 0dit Cist *inding popup.

%&6)

Go to the page definition of the &sp page and add the !create2 and !commit2 action *inding *ased on 4etings-/1.

1') *ind the data8hangeCistener property of the schedule Gantt chart with a method in a*ove created *ac#ing *ean. (his method will *e called when user will clic# on create (as# or 8reate resource menu options from Gantt chart tool*ar. And add the code to handle the create meeting.

(his code will create a new row in meeting view o*&ect and will open the a*ove created popup after that. 116 In the *utton *ar facet of the dialog, add a command *uttons, Save and set action and partialSu*mit property for save *utton to true.

1<6 In your *ac#ing *ean add code which will do needful action when user will clic# on the create and update edit in Gantt chart tool*ar. 1>6 Set the partial(riggers property of the schedule Gantt chart to Save command *utton. 1@6 Set the popup8anceledCistener property of the popup component, so that when user cancel the createDupdate meeting, we can undo the changes done at view level. 1E6 Setting the tooltipBeyCa*els and tooltipBeys properties at the scheduling gantt chart level will show the meeting contents when you hover over the icon on tas#.

You might also like