Skip to Content
Author's profile photo Durairaj Athavan Raja

Adobe AIR: My Worflow InBox widget

 

Update!

A new version of Adobe AIR was released on 12/12/2007. The old MyWorkFlowInBox will not work with the new version (beat 3) of Adobe AIR. If you are using beta 3 of Adobe AIR download the new MyWorkFlowInBoxbeta3.air from here .  

Hope you all would have heard about Adobe Integrate Runtime (AIR) . This is a small AIR application to monitor your workflow inbox.

What is Adobe AIR?

Adobe AIR is a cross-operating system runtime that allows developers to leverage their existing web development skills (HTML, JavaScript, Flash, Flex, Ajax) to build and deploy rich Internet applications (RIAs) to the desktop.

To learn more about Adobe AIR follow the below given links.

1. Adobe Integrate Runtime (AIR)

2. Another good introduction to AIR

You can download the My Workflow Inbox.air and the Installation instruction from here .

What do you need to run this application?

    1. Install Adobe Integrate Runtime – download from here

    2. Download My Workflow InBox Adobe AIR Widget – zip file.zip.

    3. Extract the downloaded My Workflow InBox Adobe AIR Widget – zip file.zip to find the My Workflow InBox.air file and the installation instruction.

             .myappstyle

                  {

                      background-color: #ffffff;

                      border-style: solid;

                     

                      background-alpha:0.8;

                  }

             .mypanelTitle

                       

     

               DataGrid

     

     

               .mydataGridHeaderStyle

     </mx:Style>     

     <mx:Script>

             <![CDATA[

                  import mx.controls.Text;

                 import flash.net.navigateToURL;

                 import mx.controls.Alert;

                 import mx.rpc.events.FaultEvent;

                 import mx.rpc.events.ResultEvent;

                 import flash.system.Capabilities;

                 import flash.utils.Timer;

                 import mx.controls.Alert;

                 import mx.core.UIComponent;

                 import mx.events.CloseEvent;

                 import mx.rpc.events.FaultEvent;

                 import mx.rpc.events.ResultEvent;

                 import mx.charts.events.ChartItemEvent;

                 import mx.charts.chartClasses.ChartElement;

                 import mx.core.Container;   

                 import mx.events.IndexChangedEvent;

                 import mx.charts.HitData;

                 import mx.core.IUIComponent;

                 import flash.display.DisplayObject ;

                 import flash.filesystem.*;

                 public var file:File;

                

                

                

                 public function init():void {

                     file = File.applicationStorageDirectory.resolve(“Preferences/version.txt”);

                     trace(file.nativePath);

                     if(file.exists) {

                         checkVersion();

                     } else {

                         firstRun();

                     }

                 }

                 private function checkVersion():void {

                     var stream:FileStream = new FileStream();

                     stream.open(file, FileMode.READ);

                     var prevVersion:String = stream.readUTFBytes(stream.bytesAvailable);

                     stream.close();

                     if (prevVersion.length == 0) {

                          log.text += “Enter BSP page url along with client info (sap-client=001) in the below box and click save”;

                          

                         switchView(‘setBox’);

                     } else {

                          burl.text = prevVersion ;

                         wibdata.send();

                         switchView(‘chartBox’);

                     }

                     log.text += “Welcome to the application.”;

                 }

                 private function firstRun():void {

                     log.text = “Thank you for installing the application.

                         + “Enter BSP page url along with client info (sap-client=001) in the below box and click save”;

                     switchView(‘setBox’);   

                    // saveFile();

                 }

                 private function saveFile():void {

                     var stream:FileStream = new FileStream();

                     stream.open(file, FileMode.WRITE);

                     stream.writeUTFBytes(burl.text);

                     stream.close();

                 }

              

                private function saveClick():void

                  { 

                       if (burl.text.length == 0) {

                       Alert.show(“Enter BSP Page URL”);     

                       }

                       else

                       {

                       saveFile();

                       dgdata= null;

                       chardata = null;

                       wibdata.send();

                     switchView(‘chartBox’);

                     }

                  }

               private function cancClick():void

                  {

                       burl.text = “”;

                  }

               private function refreshView():void

                  {

                     dgdata= null;

                       chardata = null;

                       wibdata.send();     

                  }

                 public var len:int ;

                 public var dgdata:XMLList;

                 public var chardata:XMLList;

                

                 private var wibdataFeed:XML;

                public function switchView(viewId:String):void    

                       {    

            var container:Container = Container(pcvs.getChildByName(viewId)); 

               if (container != null)     

                          {               pcvs.selectedChild = container;

                           var vname:String;

                           vname = viewId.toString();

                           if (vname == “setBox”)

                           {

                           this.title = “My Workflow InBox – Settings”;

                           }

                           else if (vname == “chartBox”)

                           {

                           this.title = “My Workflow InBox – Chart View”;     

                           }

                           else if (vname == “gridBox”)

                           {

                           this.title = “My Workflow InBox – Grid View”;     

                           }

                          

                          }

                   }             

                 // Result handler – gets called after RSS is loaded.

                 private function wibdataResultHandler(event:ResultEvent):void

     

                 {

                     wibdataFeed = event.result as XML ;

                     dgdata= wibdataFeed.elements().OUTPUT.item;

                     chardata= wibdataFeed.elements().CHARDATA.item;

                     len = dgdata.length();

                                    

                 }

                 private function wibdataFaultHandler(event:FaultEvent):void

     

                 {

                     Alert.show(event.fault.message, “Could not load Data feed”);

                   

                 }

                

        

         

                    private function formatpcDataTip(hitData:HitData):String

                            {

                                var name:String = hitData.item.WI_STAT;

                                var totcount:Number = hitData.item.SLNO;

                                return “Status: “name

        <mx:VBox id=”setBox” width=”100%” height=”100%” hideEffect=”” showEffect=”“>
                  <mx:Text id=”log” text=”” width=”100%” height=”20%”/>
                  <mx:TextInput id=”burl” text=”” editable=”true” width=”100%”/>
                  <mx:ControlBar width=”100%” height=”29″>
                        <mx:Image height=”28″ id=”sv”  click=”saveClick()” source=”@Embed(source=’assets/save.png’)” toolTip=”Save Settings”/>
                        <mx:Image height=”28″ id=”can”  click=”cancClick()” source=”@Embed(source=’assets/cancel.png’)” toolTip=”Clear”/>
                   </mx:ControlBar>
         </mx:VBox>
         <mx:VBox id=”chartBox” width=”100%” height=”100%” hideEffect=”
” showEffect=”“>
                 <mx:PieChart id=”mypiechart”
                                  dataProvider=”
                                       showDataTips=”true”
                                       height=”100%”
                                       width=”100%”
                                       itemClick=”pieChartClick(event);”
                                       dataTipFunction=”formatpcDataTip”>
          
                         <mx:series>
                              <mx:PieSeries
                                 field=”SLNO”
                                 nameField=”WI_STAT”
                                 labelPosition=”callout”
                                 labelFunction=”getSliceLabel”
                                 showDataEffect=”“/>
                         </mx:series>
                      </mx:PieChart>
                   <mx:ControlBar width=”100%” height=”29″>
                                     <mx:Image height=”28″ id=”gr0″  click=”switchView(‘gridBox’)” source=”@Embed(source=’assets/icon_grid.png’)” toolTip=”Grid view”/>
                                     <mx:Image height=”28″ id=”ch0″  click=”switchView(‘chartBox’)” source=”@Embed(source=’assets/icon_chart.png’)” toolTip=”Chart view”/>
                                     <mx:Image height=”28″ id=”re0″  click=”refreshView()” source=”@Embed(source=’assets/refresh.png’)” toolTip=”Refresh”/>
                                   <mx:Image height=”28″ id=”st0″  click=”switchView(‘setBox’)” source=”@Embed(source=’assets/settings.png’)” toolTip=”Settings”/>
                    </mx:ControlBar>
               </mx:VBox>
                 <mx:VBox id=”gridBox” width=”100%” height=”100%” hideEffect=”” showEffect=”
“>     

                         <mx:DataGrid  width=”100%” height=”100%” id=”mydg” dataProvider=”” shadowDirection=”right” dropShadowColor=”#E8DBDB” cornerRadius=”30″ backgroundSize=”100%”>

                                        <mx:columns>

                                             <mx:DataGridColumn  headerText=”Task” dataField=”WI_TEXT” dataTipField=”WI_ID”/>

                                             <mx:DataGridColumn  headerText=”Status” dataField=”WI_STAT”/>

                                             <mx:DataGridColumn  headerText=”Creation Date” dataField=”WI_CD”/>

                                        </mx:columns>

                                   </mx:DataGrid>

                         <mx:ControlBar width=”100%” height=”29″>

                                          <mx:Image height=”28″ id=”gr”  click=”switchView(‘gridBox’)” source=”@Embed(source=’assets/icon_grid.png’)” toolTip=”Grid view”/>

                                          <mx:Image height=”28″ id=”ch”  click=”switchView(‘chartBox’)” source=”@Embed(source=’assets/icon_chart.png’)” toolTip=”Chart view”/>

                                          <mx:Image height=”28″ id=”re”  click=”refreshView()” source=”@Embed(source=’assets/refresh.png’)” toolTip=”Refresh”/>

                                          <mx:Image height=”28″ id=”st”  click=”switchView(‘setBox’)” source=”@Embed(source=’assets/settings.png’)” toolTip=”Settings”/>

                         </mx:ControlBar>

               </mx:VBox>

</mx:ViewStack>

</mx:WindowedApplication>

</textarea></p>

Assigned tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Guillaume GARCIA
      Guillaume GARCIA
      Hi Durairaj,

      Nice first application.
      Thanks for bringing this new technology into light!

      Best regards,
      Guillaume

      Author's profile photo Former Member
      Former Member
      hello Durairaj Athavan Raja,

      I tried to install you widget, but I got an error message when I made a dobble click on the
      application "My Work Flow InBox.air"

      Installation Error:
      This application requires a version of Adobe AIRwhich is no longer supported. Please contact the application author for an updated version.

      I installed the last version from adobe air.

      Could you please help me.

      Kind Regards
      Jens Guntenh

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      Which version of AIR you are using? this example is done using AIR beta 1
      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      Looks to me you have AIR beta 2 and if AIR beta 2 is installed on top op AIR beta 1 my widget works without problem.  However if the AIR beta 2 is a fresh install, my widget will have installation problems.

      I will have to migrate my AIR widget to the new AIR beta 2 which i will do and update the blog with the same.

      Regards
      Raja

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      alternatively the following page http://labs.adobe.com/downloads/air.html has both beta 1 runtime and beta 2 runtime.

      install beta 1 and then install beta 2 then, it will work.

      Regards
      Raja

      Author's profile photo Former Member
      Former Member
      Hi Raja,
         really a cool technology. Adobe Flex/Air is a killer application!
      Thanks a lot for your demo, which works perfectly
      Luca
      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      Thanks for your comments Luca.
      Author's profile photo Former Member
      Former Member
      Hello Raja,

      I really would like to try your widget, however, it is designed for AIR beta 1.
      At the web site of Adobe this version is not available any more (AIR beta 2 & AIR beta 3 are currently available for download).

      So, could you help me?
      Maybe you already ported your widget to AIR beta 3 or you could give me a link where I still can find AIR beta 1.

      Kind regards,

      Daniel

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      Hi Daniel,

      Will upgrade the widget and post in here in a couple of days time. (i am holidaying now)

      Raja

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      Hi Daniel,

      I have now upgraded it to AIR beta 3 , but would like you to test it before i post it for the public here in SDN. Would you mind dropping me a mail, so that i can send the updated air file to you. You can find my email in my
      Business Card
      .

      Raja

      Author's profile photo Former Member
      Former Member
      Hello Raja,

      sorry for the delay, I also had my holidays recently.
      I saw that you have already posted the latest version of your widget in meantime.

      I could download, install and run your widget without any problems.
      It's realy looking gorgeous.
      Thank you.

      Kind regards,

      Daniel

      Author's profile photo Former Member
      Former Member
      Hy Durairaj,
      I've installed AdobeAIR v1.5.2 and when i tried to
      install your widget, AdobeAIR return a message error, saying that an update is not available for the application.

      Is there a new version of your widget which is compatible with AdobeAir v1.5.2?

      Thank you for your help

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      Thanks for the interest. I haven't released new version for 1.5.2. I will be travelling for teched, will post the latest version once i am back.

      Raja

      Author's profile photo Former Member
      Former Member
      Durairaj,
      i succeded to rebuild the widget with Adobe Flex v1.5.2 and it works!!!

      Can i use web service instead of a BSP to interact with the widget?