<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2013/2014, Intel Performance Learning Solutions Ltd, Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
**/
/**
* Main view.
*
* created by Perumal Kuppuudaiyar (pk.udaiyar@gmail.com)
* modified by Sridhar Voorakkara (vsridhar420@gmail.com)
*/
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="100%" verticalAlign="top" horizontalAlign="center"
borderColor="#020D14" xmlns:components="components.*" layout="vertical" width="100%" color="#D3ECF1"
backgroundGradientAlphas="[1.0, 0.0]" backgroundGradientColors="[#0A0101, #A41E1E]">
<mx:Script>
<![CDATA[
import components.open_project;
import mx.effects.easing.Bounce;
import components.user_login;
import flash.utils.Dictionary;
import mx.collections.*;
import mx.controls.Alert;
import mx.events.MenuEvent;
import net.timbusproject.AppUtility;
import net.timbusproject.ProjectDataHolder;
import net.timbusproject.ProjectHolder;
import net.timbusproject.SocketServerClient;
[Embed(source="../resources/images/timbus-main-logo.png")] [Bindable] public var timbuslogoCls:Class;
[Embed(source="../resources/images/F7_and_EUFlag.PNG")] [Bindable] public var euFlagsCls:Class;
[Bindable] public var menuBarCollection:XMLListCollection;
[Bindable] public static var userLogins:Boolean=false;
public static var _inProgressProjects:ProjectHolder;
public static var _completedprojects:Dictionary;
public static var _networkScandata:Object;
public static var _files:Object;
public static var _installedAppdata:Object;
//public static var _userLogin:Boolean;
public var ui_states:Object;
private function initCollections():void {
menuBarCollection = new XMLListCollection(AppUtility.getMenuItems());
ui_states=AppUtility.getAppStates();
_inProgressProjects=new ProjectHolder();
this.currentState="login";
}
public static function setStatus(status:Boolean):void{
userLogins=status;
}
// Event handler for the MenuBar control's change event.
private function changeHandler(event:MenuEvent):void {
var selMenuData:String=event.item.@data as String;
//enforce project selection
if(ProjectDataHolder.projectID=="" && ((selMenuData=="AA") || (selMenuData=="AB"))){
Alert.show("No Project Selected or Created");
return;
}
if (event.menu != null) {
this.currentState=this.ui_states[event.item.@data];
}
}
// Event handler for the MenuBar control's itemRollOver event.
private function rollOverHandler(event:MenuEvent):void {
}
// Event handler for the MenuBar control's itemClick event.
private function itemClickHandler(event:MenuEvent):void {
// itemClickTextArea.text = "type: " + event.type + "\n";
// itemClickTextArea.text += "target menuBarIndex: " +
// event.index + "\n";
}
]]>
</mx:Script>
<mx:Style source="../css/style.css"/>
<mx:Canvas backgroundColor="#FFFFFF" width="98%" height="20%" borderColor="#033B62" borderStyle="solid" borderThickness="6">
<mx:Image source="{timbuslogoCls}" width="25%" height="95%" left="5"/>
<!-- <mx:Image y="41" source="{intellogoCls}" width="159" height="103" horizontalCenter="-244"/> -->
<mx:Image source="{euFlagsCls}" width="25%" height="95%" right="5" verticalCenter="0"/>
<mx:Label text="Digital Preservation Expert Suite" color="#030E10" width="40%" height="45" fontSize="25" horizontalCenter="0" verticalCenter="0" textAlign="center" fontWeight="bold" styleName="title1"/>
</mx:Canvas>
<mx:Canvas width="98%" height="8%" backgroundColor="#5DC9EC" borderColor="#033B62" borderStyle="solid">
<mx:MenuBar id="dpesMenu" enabled="{userLogins}" labelField="@label" creationComplete="initCollections()"
dataProvider="{menuBarCollection}"
change="changeHandler(event);"
itemClick="itemClickHandler(event);"
itemRollOver="rollOverHandler(event);" textAlign="left" fontSize="20" width="80%" height="90%"
fontWeight="bold" fontFamily="Arial" color="#0F1111" themeColor="#9E2DC8" horizontalCenter="0" verticalCenter="0"/>
</mx:Canvas>
<mx:states >
<!--Project Menu States -->
<mx:State name="create_project" >
<mx:SetProperty target="{pnl_main}" name="title" value="Project->Create new preservation" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:create_project />
</mx:AddChild>
</mx:State>
<mx:State name="open_project" >
<mx:SetProperty target="{pnl_main}" name="title" value="Project->Review existing preservation" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:open_project />
</mx:AddChild>
</mx:State>
<!-- End of Project Menu States -->
<!--Analyse Menu States -->
<mx:State name="model_imports" >
<mx:SetProperty target="{pnl_main}" name="title" value="Analysis->Import business process models" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:import_models />
</mx:AddChild>
</mx:State>
<mx:State name="estimate_costs" >
<mx:SetProperty target="{pnl_main}" name="title" value="Analysis->Estimate preservation costs" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:estimate_costs />
</mx:AddChild>
</mx:State>
<!-- End of Analyse Menu States Preserve Menu States -->
<mx:State name="context_model" >
<mx:SetProperty target="{pnl_main}" name="title" value="Context Model->Artefacts Sources" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:bp_model_analyser />
</mx:AddChild>
</mx:State>
<mx:State name="review_metadata" >
<mx:SetProperty target="{pnl_main}" name="title" value="Preserve->Source artefacts and generate metadata" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:preservation />
</mx:AddChild>
</mx:State>
<mx:State name="vvframe_data" >
<mx:SetProperty target="{pnl_main}" name="title" value="Preserve->Submit verification and validation data" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:verification_validation />
</mx:AddChild>
</mx:State>
<mx:State name="create_package" >
<mx:SetProperty target="{pnl_main}" name="title" value="Preserve->Create preservation package" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:create_package />
</mx:AddChild>
</mx:State>
<mx:State name="create_container" >
<mx:SetProperty target="{pnl_main}" name="title" value="Preserve->Select storage and complete preservation" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:create_container />
</mx:AddChild>
</mx:State>
<mx:State name="send_to_repo" >
<mx:SetProperty target="{pnl_main}" name="title" value="Preserve->Preserve Package" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:send_to_repo />
</mx:AddChild>
</mx:State>
<mx:State name="manage" >
<mx:SetProperty target="{pnl_main}" name="title" value="Manage preservation projects" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:manage_environment />
</mx:AddChild>
</mx:State>
<mx:State name="login" >
<mx:SetProperty target="{pnl_main}" name="title" value="Welcome to Timbus - Please login" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:user_login />
</mx:AddChild>
</mx:State>
<mx:State name="start" >
<mx:SetProperty target="{pnl_main}" name="title" value="Welcome to Timbus - Introduction" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:Start_Page />
</mx:AddChild>
</mx:State>
<mx:State name="redeploy" >
<mx:SetProperty target="{pnl_main}" name="title" value="Redeploy preserved business process" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:redeploy />
</mx:AddChild>
</mx:State>
<mx:State name="ManageVM" >
<mx:SetProperty target="{pnl_main}" name="title" value="Manage Redeployed Environment" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:VM_Mgmt_Console />
</mx:AddChild>
</mx:State>
<mx:State name="Verification" >
<mx:SetProperty target="{pnl_main}" name="title" value="Verify Redeployed Environment" />
<mx:AddChild relativeTo="{pnl_main}" >
<components:v_data_capture />
</mx:AddChild>
</mx:State>
<!-- End of Preserve Menu States -->
</mx:states>
<!-- Button controls to open the menus. -->
<mx:Panel width="98%" height="90%" layout="vertical" verticalAlign="top"
horizontalAlign="center" id="pnl_main" fontSize="15" color="#000709">
</mx:Panel>
</mx:Application>