Friday, December 17, 2010

Enhancing ClickSchedule Silverlight Client

I installed Service Optimization 8.1.2 and spent long hours fighting with it, just to open the ClickSchedule Web client, or as I prefer to call it, ClickSchedule Silverlight client. To make it short, the web.config file in the ClickScheduleWebClient directory had a wrong configuration that prevented me from opening the client. Assume that you have a working ClickSchedule Silverlight client, here are two steps into customizing the Gantt in a very special way.

But before that, let me recommend the beta version of .NET Reflector, which integrates with Visual Studio 2010 and allow a very good debugging of the Silverlight client.

Step 1: Switch Gantt in the Settings

We will instruct the client to load the Gantt from a new assembly, which we will create in the next step, by editing the Body XML of the Administrative Settings of the client. Then we will verify that we have under the root configuration, views node with its name attribute. Under that, mainViews node and its name attribute. Under that, schedulingView node and its name attribute. We will override the default Gantt by adding type attribute with the following string: W6.Web.UI.Extra.W6SchedulingViewEx,W6.Web.UI.Extra, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

Step 2: Enhanced Gantt

Rename the file W6.Web.UI.xap to W6.Web.UI.zip and extract the files out. Keep them in a sub-folder to reference them later. In Visual Studio 2010, create new C# Silverlight Class Library project, name it W6.Web.UI.Extra and add reference to W6.Web.Controls.dll and W6.Web.UI.dll, rename the existing class to W6SchedulingViewEx, and paste the following code:

using System.Windows.Controls;
using System.Windows.Shapes;
using System.Windows.Media;
using W6.Web.UI.View;
using W6.Web.UI.GanttChart;

namespace W6.Web.UI.Extra
{
  public class W6SchedulingViewEx : W6SchedulingView
  {
    public override void Refresh()
    {
      base.Refresh();

      Rectangle r = new Rectangle();
      r.Fill = new SolidColorBrush(Colors.Green);
      r.VerticalAlignment =
        System.Windows.VerticalAlignment.Top;
      r.HorizontalAlignment =
        System.Windows.HorizontalAlignment.Left;
      r.Height = this.ResourceGantt.RowHeight;

      // from the begining of the loaded Gantt
      double minutesToStart = 720;
      // from the start of the rectangle
      double minutesToFinish = 60.0;
      // zero based index of the engineer
      double engineer = 4;

      r.Width = minutesToFinish
        * this.ResourceGantt.PixelPerMinute;
      r.Margin = new System.Windows.Thickness(
        minutesToStart
          * this.ResourceGantt.PixelPerMinute,
        engineer * this.ResourceGantt.RowHeight,
        -1.0, 0.0);

      ((Grid)((W6CalendarLayer)this.ResourceGantt
        .GanttChartLayers[0]
        ).Content).Children.Add(r);
    }
  }
}

Build the project and copy the DLL onto the W6.Web.UI.zip file. Edit the extracted file AppManifest.xaml and add new assembly part:

<AssemblyPart
  x:Name="W6.Web.UI.Extra"
  Source="W6.Web.UI.Extra.dll" />

Drag the AppManifest.xaml file onto the W6.Web.UI.zip file, Choose to replace the existing one, and rename the ZIP file back to W6.Web.UI.xap and open the client, using: http://localhost/ClickScheduleWebClient/default.aspx

In the client, select the Refresh button and a green rectangle should appear on the Gantt's lowest layer, the calendar layer. From here, you can enhance the Gantt with a lot of flexibility.

Wednesday, August 11, 2010

iPhone Client Update


ClickMobile client for the Windows platform is developed for long time already, and therefor includes many features. In this update we can see that the client's Calendar list is complete with support for coloring, icons, list of properties, etc.

When selecting task from the list, the client needs to follow the form configuration from the server. The editor is built for Windows platform, but in general we can look on it as list of Tabs that each is a list of Fields or Properties.


The iPhone client is showing the first Tab, while the other Tabs are listed as sections below.

Selecting the second Tab is natural for iPhone users, while following the separation made by the administrator, which configure the form.

Still there is more work, but it looks like it getting some shape.

Monday, July 12, 2010

Sending And Receiving SXP from iPhone

When developing client application you always need to learn the server API. In the case of ClickMobile, there is more than few Special SXP calls to learn.

The beauty of ClickMobile is in the details (as Prof. Ben-Bassat always said: the strength of Service Optimization is in the details, years of experience in this field made the solution of ClickSoftware so comprehensive).

The Windows CE mobile client is using SQL Server CE to synchronize local database with the server database (SQL Server CE? not with iPhone). But the way the client sends SXP calls and receives the response is another layer on top of that.

The server maintains two tables for requests and responses. The client pull and push records from and to these tables using synchronization of local replica. The server scans the requests table using background process (agent), which performs a scan every few seconds (configurable interval). For each processed request it's generates response record. But the server also generates response records as a result of Server Events (like Task Update, etc.).

So, to send and receive SXP, like ClickMobile, from platform that cannot use SQL Server CE, you need to: (A) Create replacement for SQL Server CE database synchronization. (B) Insert special ClickMobile SXP calls into special request records. (C) Synchronize the requests table. (D) Constantly synchronize the responses table. (E) Get the SXP results from the response records. (F) Clean used response records (or let the server do so after few days).

Important note regarding The requests and responses tables: each user should only use records that aimed to him. Synchronizing records of all clients is costly and unnecessary.

OK, so now I can tell you that I'm already passed this stage. Now let's connect the background service with the UI...

Saturday, June 5, 2010

What iPad Can Do For ClickSchedule?

While the iPad sales are going great guns with consumers, the usage of such delicate device in the field as enterprise client is questionable. The first thing I got on my mind was to play with the device and decide if it's good as ClickSchedule client (ClickMobile client). After seeing how fragile the device is, I'm not sure if it worth the effort developing for. Maybe a ClickAnalyze client is more appropriate for the iPad.

For sure the iPhone is still a great device for ClickMobile. We just need to wait a litle bit more (for Monday's keynote) and then see what news Apple going to bring to the enterprise.

Tuesday, May 11, 2010

iPad Wi-Fi+3G glass is cracking [u]

While learning more about my new iPad, I found a scratch on the glass after less than a week. I was not sure how, but I blamed myself for the first scratch. Today, I found another three scratches. I looked carefully and found that my screen is cracking. We'll see what Apple will do with it in couple days. In the attached picture, I marked the visible scratches with pairs of arrows. The flash shows the cracks that are not visible in room light (the screen is very clean, but the flash just pop any crack and dust).
Update: Apple was very kind to replace the iPad with a new one. It took me 10 minutes at the local Apple store and I'm now posting from a new iPad.

Saturday, April 24, 2010

ClickAnalyze Insight Agent for all Nightly Reports

You have just configured new ClickSchedule report using the Service Optimization Administration console. Now you need to configure an agent to run the report once a night.

I strongly suggest to use the ClickAnalyze Insight agent for any nightly report, with the cost of the new time table needed for the agent. You can create such table using the following SQL:
create table W6RP_MY_REPORT_TIME(PK_Date date not null,
Date_Name varchar2(50) null,
constraint PK_MY_REPORT_TIME primary key (PK_Date)
using index tablespace USERS) tablespace USERS;
Populate the table with single record for two days ago:
TimeCmd "Provider=OraOLEDB.Oracle;User Id=W6ADMIN;
Password=****;Data Source=CAR_ALIAS"
W6RP_MY_REPORT_TIME en-US -2 -2
Create foreign key relation between the tables:
alter table W6RP_MY_REPORT
add constraint FK_MY_REPORT1 foreign key (Time_Start)
references W6RP_MY_REPORT_TIME;
Now just set a new ClickAnalyze Insight agent setting to process the time table and the report:
Owner:        [Application]
Category:     Agent
Sub Category: Insight
Name:         My Report
Body:
<InsightAgent>
  <Connections>
    <Connection>
      <TargetConnection
        Key="-1">(local)</TargetConnection>
      <TimeTable>W6RP_MY_REPORT_TIME</TimeTable>
      <Culture>en-US</Culture>
      <RelativeTo>-1</RelativeTo>
    </Connection>
  </Connections>
  <Reports>
    <Report>
      <Name>My Report</Name>
    </Report>
  </Reports>
  <Notifications>
    <Notification Active="true">
      <Type>Email</Type>
      <From>click@acme.com</From>
      <To>
        <Recipient>dispatcher@acme.com</Recipient>
      </To>
      <Subject>My Report Execution Result</Subject>
      <Importance>2</Importance>
    </Notification>
  </Notifications>
</InsightAgent>
What you will get is the better error handling of the agent, which rollback partial processing. You can add multiple reports to run in sequence. Just remember, one error will rollback all the reports.

After error, you can try and fix the problem and rerun the agent. If the agent run successfully, then rerun is not going to do any processing, since the time table is already with the processing date.

Thursday, April 8, 2010

Mobile iPhone Client and Multitasking

As we all know, Apple previewed today some features of the next major upgrade for the iPhone OS. Especially important for me is the multitasking implementation (we all know it was just matter of developing the correct UI and waiting for 1GHz CPU, which probably be in the next generation iPhone hardware).

While still offering the push notifications option, it is much easier to implement a thread that polls the remote server. I will have to check carefully, what is allowed under the updated platform.

I feel that I started the development at the right time, when the OS is maturing. I will probably aim to the end of 2010, so I can benefit from the iPhone OS 4 improvements.

Wednesday, March 17, 2010

Short iPhone Client Update

I have a WebService working on the server side. I have a WebServiceClient working asynchronously on the iPhone. Still need to finish the SQLite code for the client side database. I have initial UI components. Also, adding some barcode reading code, just in case ;-)

Thursday, March 4, 2010

Sample Data

Any demo is better when showing "full and real" data. Means that, all engineers are scheduled in the past, the demo system is fully functional, and all clients are showing the most complete picture of the demoed company.

However, when the demo data needs to include ClickAnalyze data, including single district is not enough. You need at least 2 regions, each with 5 districts, and history for at least 3 years. For a recent demo, I made just that.

Now I need to find some time to: (A) Make the code more generic, so it can fit other demos. (B) Add the option to see trends over time, probably I need to create new engineers over time, to show growth. and (C) Story. It would be best if the demo will include points in time that can be shown with correlation to the story.

After seeing only few demos during my years in ClickSoftware, and after this recent demo, which I helped to prepare small part of it, I can definitely say that ClickAnalyze is lagging behind in the demo-sphere.
 
HTML Hit Counter