Docstoc

Mobile Components - LTS-i

Document Sample
Mobile Components - LTS-i Powered By Docstoc
					MOBILE COMPONENTS
SPECIFICATION


ÍNDICE
Introduction .................................................................................................................................. 3
   Definitions ................................................................................................................................. 3
   Mobile Application Server Arquitecture ................................................................................... 3
   Mobile Application Server Configuration.................................................................................. 4
   Mobile Application Server Exceptions ...................................................................................... 5
   General Information about Mobile Components ..................................................................... 6
Mobile Components ...................................................................................................................... 7
   Get Information About Service - GetPreServiceInfo ................................................................. 7
              Component’s Objective ................................................................................................. 7
              Component’s Configurable Attributes .......................................................................... 7
              Component’s GUI .......................................................................................................... 7
              Component’s Exceptions ............................................................................................... 8
   Find Entity Information – FindEntityInfo................................................................................... 9
              Component’s Objective ................................................................................................. 9
              Component’s Configurable Attributes .......................................................................... 9
              Component’s GUI ........................................................................................................ 10
              Component’s Exceptions ............................................................................................. 10
   Schedule - Schedule ................................................................................................................ 11
              Component’s Objective ............................................................................................... 11
              Component’s Configurable Attributes ........................................................................ 11
              Component’s GUI ........................................................................................................ 12
              Component’s Exceptions ............................................................................................. 13
   Get Track Id - GetTrackId......................................................................................................... 14
              Component’s Objective ............................................................................................... 14
              Component’s Configurable Attributes ........................................................................ 14
              Component’s GUI ........................................................................................................ 14
         Component’s Exceptions ............................................................................................. 15
Find Private Information - FindPrivateInfo ............................................................................. 16
         Component’s Objective ............................................................................................... 16
         Component’s Configurable Attributes ........................................................................ 16
         Component’s GUI ........................................................................................................ 17
         Component’s Exceptions ............................................................................................. 17
Authentication - Authentication ............................................................................................. 18
         Component’s Objective ............................................................................................... 18
         Component’s Configurable Attributes ........................................................................ 18
         Component’s GUI ........................................................................................................ 19
         Component’s Exceptions ............................................................................................. 19
         Feature: Captcha! Control ........................................................................................... 20
Pay Fee Tax - PayFeeTax.......................................................................................................... 21
         Component’s Objective ............................................................................................... 21
         Component’s Configurable Attributes ........................................................................ 21
         Component’s GUI ........................................................................................................ 22
         Component’s Exceptions ............................................................................................. 23
Save As File – EmbeddedSaveAsFile and SaveAsFile............................................................... 24
         Component’s Objective ............................................................................................... 24
         Component’s Cross-Media Characteristic ................................................................... 24
         Component’s Configurable Attributes ........................................................................ 25
         How to Implement the Embedded Component.......................................................... 25
         Component’s GUI ........................................................................................................ 26
         Component’s Exceptions ............................................................................................. 26
Print Document – PrintDocument........................................................................................... 28
         Component’s Objective ............................................................................................... 28
         Component’s Cross-Media Characteristic ................................................................... 28
         Component’s Configurable Attributes ........................................................................ 29
         How to Implement the Embedded Component.......................................................... 29
         Component’s GUI ........................................................................................................ 30
         Component’s Exceptions ............................................................................................. 30
Introduction

This document specifies mobile components, including their communication with other
Framework elements, their configurable attributes and exceptions that can be thrown.

First of all, we will discuss the entire Mobile Application Server arquitecture. Then we will
discuss each of the mobile components, specifying:

          1.    Component’s objective
          2.    Component’s configurable attributes
          3.    Component’s GUI (Graphical User Interface)
          4.    Component’s Exceptions

Definitions


Transition: defines an event which user changes current medium to perform his task.

Connection: defines an event which user changes current component (same medium) to
perform his task.

Mobile Application Server Arquitecture


Figure 1 shows how components basically communicate to other Framework elements and how
user starts a new task. Our arquitecture is based on two Design Patterns: Front Controller1 and
Model-View-Controller (MVC)2.

By definition, Front Controller application receives all users’ requests and redirects him to the
correct component. Each component can use Front Controller command to redirect user to
another component, performing a connection.

Front Controller identifies which component user is requesting by the URI requested. If no URI
defined is provided, user is redirected to a home menu. If the requested URI does not exist,
then Front Controller warns user to correct it.




1
  Front Controller: padrão de projeto que define que todas as requisições devem ser direcionadas para um servidor ou aplicação
central antes de serem concluídas.
2
  MVC: padrão de projeto de desenvolvimento de softwares que separa a aplicação em 3 camadas: Model, View e Controller, de
forma a separar os códigos de tratamento, de UI e de armazenamento e requisição de dados.
                                                                        User




                                                            Front Controller
    Application Walkthrough



                                                                                                             Framework
                                  Service’s Data              Component Manager                             Configuration
                                                               XSession Manager
                                                                Content Manager
                              WebService    SQL Server                                               WebService     SQL Server




                                                                                                                                  ASP.NET MVC
                                                              Components
                                               Controller                         Controller     Controller
                               Controller                                                                           Controller
                                              Get Service       (...)            Find Public       Submit
                               Schedule                                                                            Get Track Id
                                                  Info                              Info        Personal Info




                                                                        GUI
                                                                                               Get Track            Find Public
                               Schedule            Schedule
                                                                         (...)                  Number              Information
                                View 1              View 2
                                                                                                View 1                 View 1




                                                                         Figure 1

When the Mobile Application Server (MAS) starts-up, it requests all Component information
from the XWSComponentManager (RESTful WebService) and loads all mobile components
data, caching it to future requests. If a modification on components definition is made,
XWSComponentManager warns Mobile Application Server to reload components data.

When MAS starts up, it also downloads and initialize DeviceAtlas device’s properties object. It
is used to detect device capabilities from incoming requests and redirect or create custom
content.

Dynamic content is provided by the XWSContentManager (RESTful WebService). Components
may request this web service anytime they need, accordingly to user’s task and components
definition data.

Mobile Application Server Configuration


There are some configurable parameters that are necessary to Mobile Application Server to
run. They can be found at Web.Config file, on Mobile Application Server root:

ComponentManagerUrl: This represents the url defined for the XWSComponentManager
web service – until “XWSComponentManager.svc/”.

ContentManagerUrl: This represents the url defined for the XWSContentManager web
service – until first slash “/” before an SVC file.
XGOVTransitions: This represents the url defined for the XWSTransitionManager web
service – until “transitionServices/”. This web service is used by the Media Transition
Components.

HostBaseUrl: Defines the base Url, where all mobile components are hosted.

ServiceId: Defines the service’s identification to receive its cross-media content.

CssTheme: Indicates the CSS file name to use – without extension .css.

IconMenu: Defines a default type of menu: True for Icons and False for List. If the device has
Touch Screen, it will be defined to True.

DeviceAtlasFirstJsonFileName: Defines the JSON file name – without extension .json
to load when the Mobile Application Server first starts.

DeviceAtlasLicenseId: Defines the license id parameter to connect to DeviceAtlas
server.



Mobile Application Server Exceptions


MAS exceptions definitions are specified at PortalMobileExceptions.xml file. You can translate
it to your language. Be careful to not change its “key” and “code”. Here you can find a short
description about Non-Components exceptions or Exceptions that are common to all
components.

     ComponentNotFoundException
      Could not find requested component (by its Id or URI). The component does not exist
      in MAS Components Cache. If you have just added this component, use Update
      method: http://MobileApplicationServerUrl/Update.
         UnknownException
          Indicates an unknown exception. Please, see MAS log for more information and
          contact a system administrator.
     TransitionControlInitializationException
      This indicates that the Transition Component Class does not exist. Check if you have
      the %TransitionClass%Control class created. Overwrite %TransitionClass% by the
      TransitionClass attribute from given transition object.
     ComponentManagerConnectionException
      Could not connect to XWSComponentManager. Verify its ConnectionString and your
      Internet Access. Also, check your firewall configuration.
     ContentManagerConnectionException
      Could not connect to XWSContentManager. Verify its ConnectionString and your
      Internet Access. Also, check your firewall configuration.
General Information about Mobile Components


Components are made of three (at least) files:

       A Model class, under Mobile.Components namespace, which MUST inherit from
        XMobComponent class;
       A Controller class, under Mobile.Controllers namespace;
       A Index view ASP.NET MVC View Page.

Figure 2 shows XMobComponent Class:




                                 Figura 2 - XMobComponent Class
 Mobile Components
 Now we are going to discuss each of the Mobile Components, following the topics defined in
 the Introduction section.



 Get Information About Service - GetPreServiceInfo
      Component’s Objective
 This component was designed to provide initial and relevant information to citizen about the
 e-government service desired. It may use multimedia content and custom content to each
 medium.

     Component’s Configurable Attributes




 You can configure the initial message shown to the user in the first GUI, called
 WelcomeMessage. The multimedia content related to this component and service is provided
 using the Content Manager Tool.



     Component’s GUI




WelcomeMessage
In the first picture we can see – from above to below – Service’s Title, Component’s Name,
Service’s Description, the WelcomeMessage and an Agency link (footer). In the second picture,
we see a Page object representation. In the third header, there is its Name and each
Multimedia Content is shown below Page’s Name.

    Component’s Exceptions
    Unknown File Extension Exception.
     Occurs if the multimedia content provided has a different file extension from the list
     below:
     flv, swf, aif, aiff, aac, au, gsm, mov, mid, midi, mpg, mpeg, mp4, m4a, psd, qt, qtif, qif,
     qti, snd ,tif, tiff, wav, 3g2, 3gp, mp3, ra, ram, rm, rpm, rv, smi, smil, xap, asx, asf, avi,
     wma, wmv, bmp, jpg, jpeg, gif, png, htm, html, pdf.
    Null Entity Pages Exception.
     Occurs if the service has no Pages object to show.
Find Entity Information – FindEntityInfo
     Component’s Objective
This component was designed to provide a search mechanism to the citizen. With this
component citizen is able to search for an entity information, like a car, hospital, school, etc.

This component has three types, based on its search engine: FindEntityInfoByOptionList, which
is able to show a full list of entities to citizen chose one of them, FindEntityInfoByKeyword,
which is able to search for entities which matches a given keyword and
FindEntityInfoByCategory, which provides a filtered search.



     Component’s Configurable Attributes




All types of FindEntityInfo components have an InstructionText string attribute, which is
supposed to tell to citizen what he should do. For the ones which provides search engines (by
Keyword and by Category), you can configure the SearchLabel attribute, which tells user what
data he should input; and a SearchResultsLabel attribute, which names the search results page.

FindEntityInfoByOptionList has a configurable OptionList attribute, which is provided from a
web service connection to the Content Manager WebServices. It’s not a configurable
parameter at the modeling step.
                   Component’s GUI




InstructionText



 SearchLabel




                                                                              SearchResultsLabel




            In the sequence of pictures above, we can see a search by keyword. The user provides a
            desired keyword in the input box, which has its SearchLabel attribute beside and the
            InstructionText attribute above. Then user receives the results page, which has its
            SearchResultsLabel in the second header. The next two pictures are showing the Entity
            Information, and the multimedia content related to it, like GetPreServiceInfo page objects.

                   Component’s Exceptions
                   Null Keyword Exception.
                    The user has not provided any keyword.
                   Null Entity List By Keyword Exception.
                    Could not find any entity which matches the given keyword.
                   Null Entity List Exception.
                    The OptionList from FindEntityInfoByOptionList parameter is null. Government should
                    provide the list.
                   Null Category List Exception.
                    Government has not provided any category.
Schedule - Schedule
     Component’s Objective
This component was designed to manage citizen’s schedules. It is able to create a new
Schedule, edit a Schedule or cancel a Schedule. This component’s requires a previous
Authentication task.

    Component’s Configurable Attributes




The properties shown in the diagram will be better understood in a GUI image. This
component has something new, related to other components described: It has two
components embedded on it: a Find Entity / Find Private Information component, represented
by the EntityProviderId attribute and a Get Track Id component, represented by the
GetTrackIdComponentToRedirect attribute.
                                                         CancelScheduleLabel
               Component’s GUI
                                                                      PickDateLabel
              ReScheduleLabel


CancelTitlePage                                                                      EntityProviderId


                                                                                  MySchedulesLinkLabel



                                                                                SearchTimesButtonLabel


CancelScheduleSuccesssMessage
                                                             NewScheduleLinkLabel



                              SchedulingResultsMessage

  PickTimeLabel

                                                                             ReScheduleSuccessMessage



                  GetTrackIdComponentToRedirect




                                                           CancelTitlePage
    CancelScheduleConfirmantionMessage



                                                            CancelButtonLabel
Each scheduling process step is shown above, as so all Configurable Parameters. We can see in
third picture the embedded FindPrivateInfoByOptionList component and, in the 5th and 6th
pictures, the embedded GetTrackId component.

     Component’s Exceptions
Serão listadas as possíveis exceções – previstas e tratadas para este componente – com as
quais o usuário deverá se familiarizar:
     Authentication Required Exception.
         User has not been authenticated yet. He will be redirected to the Authentication
         component defined by the CompAuthId attribute.
     No Schedules Found Exception.
         User does not have any scheduled event.
     Entity Provider Not Found Exception.
         Na Entity provider component was not found by the Id defined in the EntityProviderId
         attribute.
     Schedule Invalid Date Format Exception.
         Given date is invalid. It should be a (dd/mm/yyyy) date.
     Times Not Found Exception.
         The chosen date has no available times to schedule the event.
     Cancel Schedule Exception.
         Could not cancel the chosen schedule due to an error.
     Re-Schedule Exception.
         Could not edit the schedule due to an error.
     Schedule Not Found Exception.
         The chosen schedule object was not found.
     Make Schedule Exception.
         Could not make the new schedule due to an error.
Get Track Id - GetTrackId
      Component’s Objective
This component was designed to give a track number to citizen. This track number can be used
to track a process or a schedule in the future.

     Component’s Configurable Attributes




The attribute MessageText string tells to the user what the given track number is about.

     Component’s GUI




                                                                   MessageText
Figure above shows a GetTrackId embedded in a Schedule Component. The text from the top
in the red box is the MessageText attribute and the number below is the provided
TrackNumber.

    Component’s Exceptions
    Null User Identification Exception.
     There was no information about the user which is requesting a track number.
    Process Not Found Exception.
     No track id was provided by the web service.
Find Private Information - FindPrivateInfo
      Component’s Objective
This component was designed to provided same functionality as FindEntityInfo components.
The difference between them is that this one requires a previous Authentication task because
it provides private information. There are the same three search engines and a fourth one,
which performs a search by the entity identification (id).

    Component’s Configurable Attributes




The attribute which defines the Authentication task required is the AuthenticationCompId
attribute. All other attributes are like FindEntityInfo attributes.
           Component’s GUI


                                                                                     SearchResultsLabel
IntructionText




 SearchLabel




      The search results and entity information views are the same as shown previously in
      FindEntityInfo component description. Here we can see the FindPrivateInfoById and the
      FindPrivateInfoByOptionList respectively.

           Component’s Exceptions
           Authentication Required Exception.
            User has not been authenticated yet. He will be redirected to the Authentication
            component defined by the CompAuthId attribute.
           Null Keyword Exception.
            The user has not provided any keyword.
           Null Entity List By Keyword Exception.
            Could not find any entity which matches the given keyword.
           Null Entity List Exception.
            The OptionList from FindEntityInfoByOptionList parameter is null. Government should
            provide the list.
           Null Category List Exception.
            Government has not provided any category.
Authentication - Authentication
     Component’s Objective
This component was designed to perform authentication task. User should provide his
credentials to have access to some other tasks. This component is able to create new accounts,
recover password functionality and authenticate users and redirects him to the task which
needed the authentication.

     Component’s Configurable Attributes




If you set up RegisterLinkText and/or AccountLostLinkText properties, this component Will be
able to register new users and/or provide a account lost interface. You need to have web
services capable to perform these tasks. MessageText is a string attribute and is inherited from
AuthenticationComponent Class.
                    Component’s GUI


 MessageText
                                                                                                   RegisterSuccessMessage




RegisterLinkText                        AccountLostLinkText                                  Captcha!




        AccountLostMessage

                                                                                     AccountRecoverySuccessMessage




             The first two pictures show the form which user needs to fill to authenticate himself. The next
             two pictures show the form he needs to fill to create a new account and the last two pictures
             shows the form to recover account information.

                    Component’s Exceptions
                    Empty Verification Number Exception.
                     User has not provided the captcha’s verification number.
                    Null Authentication Parameters Exception.
                     User has not provided his credentials.
                    Invalid Authentication Parameters Exception.
                     User’s credentials are invalid.
                    Bot Detected Exception.
                     User provided the wrong Captcha’s number three times.
                    Create New Account Exception.
                     Could not create new account due to an error.
   Feature: Captcha! Control
    A Captcha Control is also available in this component. A government web programmer
    is able to customize it and use it in all tasks he needs. A full documentation about this
    feature is shown below:




      These are the customizable properties of this ASP.Net UserControl. To initialize it on a
      WebPage, perform the following steps:
         1. Insert a new directive on top of the WebPage code:

<%@ Register TagPrefix="xgov" TagName="captcha"
Src="~/Views/XMobAuthentication/XGovCaptcha.ascx" %>

          2. Insert the XGov Captcha Code where you want it to be
              shown:

<xgov:captcha runat="server" BackgroundColor="Black" ID="cpt"
TextColor="White" FontName="Arial" ImageWidth="100" ImageHeight="40"
/>

      Note: Code above is just an example. You can choose any value for the above
      properties. ImageHeight and ImageWidth are given in pixels.

      How does it works?
      It generates a random number from 1000 to 9999 and save this number in the BotKey
      Session. When user submits the form, the ValidationTextBox value is sent by Http
      QueryString (POST or GET form methods). To validate the random number with the
      number provided by user, you need to check if Session[“BotKey”] value is equals to
      Request.QueryString[“ValidadtionTextBox”] value.

      The Captcha image is generated automatically when the control is loaded, with the
      random number and some other drawings to confuse OCR bots. Images are stored at
      Captcha folder with a random string name. Its recommended that system
      administrator deletes theses files periodically.
Pay Fee Tax - PayFeeTax
     Component’s Objective
This component was designed to provide some e-payment services which users can choose to
pay a fee or tax. This component requires a previous authentication task.

     Component’s Configurable Attributes




You can choose any of the following payment options: Credit Card, Debit Card, Pay Pal,
PagSeguro, Cellphone Bill or Bank Payment Slip. You need to specify the Value of this fee/tax,
the component to authenticate user (CompAuthId) and others instructions and labels texts.
                                                    InitialInstructionText         CreditCardInstructionText
                      Component’s GUI


 PaymentReaso
 n
                                                                                               CellphonePaymentInstructionText



BankPaymentSlip

CreditCard

DebitCard

Cellphone Bill
                            ContinueButtonText
PagSeguro

PayPal




ThanksText
                                                                                                      PagSeguroInstructionText




                                                                                         PayPalInstructionText




                 In the first View, user is able to choose which PaymentOption he preferes. The second picture
                 user has a form to fill, related to CreditCard payment. In the third, user provides his cellphone
and will perform e-payment using his cellphone service. The forth picture shows the
ThanksText attribute and the others redirects users to external e-payment services: DebitCard,
PayPal and PagSeguro, respectively. Note: the banks shown in the DebitCard payment screen
must be defined by editing this View code. They are not configurable parameters.

     Component’s Exceptions
     Authentication Required Exception.
      User has not been authenticated yet. He will be redirected to the Authentication
      component defined by the CompAuthId attribute.
     Invalid Payment Option Exception.
      User has chosen a payment option other than the specified ones.
     On Payment Error Exception.
      Could not perform the remote payment: CreditCard or CellphoneBill types.
     Null Bank Url To Redirect Exception.
      Content Manager has provided no Url to redirect: DebitCard, PagSeguro or Paypal
      types.
Save As File – EmbeddedSaveAsFile and SaveAsFile


     Component’s Objective
This component is intended to provide a download engine to the service. Government can opt
to two different ways of interaction: a full download list web page; and a small plug-in which
can be embedded into any other mobile component by a web programmer. This short plug-in
has a button where user can download a configurable file.

      Component’s Cross-Media Characteristic
All files which can be downloaded by these components are provided by a WebService from
the Government legacy.

They are also Cross-Media components by default. When adding them to a Service Model
using the X-Builder Tool, it’s necessary to create a simple Push Transition from each Mobile
Save As File component to any other Web Component.

This is necessary because SaveAsFile and EmbeddedSaveAsFile components realize a Push
Transition and the file is downloaded on a Web Component. The situation is shown below:

            1. Citizen finds a file which is useful to him/her. He wants to download it.
            2. Instead of downloading to his/her mobile phone, user is asked to take a
               Download Ticket from the Web Portal. It should be done by someone who has
               a computer.
            3. This third person takes a Download Ticket and gives it to the Citizen.
            4. The citizen provides this ticket to the EmbeddedSaveAsFile or SaveAsFile
               component and the third person will start downloading it in his/her computer.

Because of these transitions, this component communicates through Content Manager to
Transition Manager Services. Tickets are managed by the Web Portal and are stored and
associated to the X-User Session in the Transition Manager.
    Component’s Configurable Attributes




     How to Implement the Embedded Component
As XGov Captcha! For mobile devices, a government web programmer must edit some web
pages, where it is necessary to have an Embedded Save As File component. This person must
perform the following tasks:

   1. Insert the following line of code on top of web page code:
       <%@ Register TagPrefix="xgov" Namespace="Mobile.Components"
       Assembly="Mobile" %>
   2. Insert the following code where you want the embedded component be displayed:

<xgov:XMobSaveAsFileControl
ID="XMobSaveAsFileControl1" runat="server" FrameworkComponentId="3000"
PanelStyle="width: 200px; height: 78px;
text-align: center; margin-right: 5%;
border: solid thin black; background-color: White;
margin: 1% auto 1% auto; padding: 2% 2% 0 2%; color: black; font-size:
small; font-weight: bold;"
LabelStyle="color: black; font-size: smaller;"
MessageStyle="color: Red; font-weight: bold;
font-size: 8pt;">
<Properties>
      <!-- Here you can add as many properties as you want. These
            properties will be passed as QueryString (name-value pairs)
            on the WebService Request and will be available on the
            Property[] you receive on Government Legacy’s WebServices.
            -->
      <xgov:PropertyControl runat="server" Name="Prop1"
      Value="Value1">
</xgov:PropertyControl>
</Properties>
</xgov:XMobSaveAsFileControl>

Understanding this code:

      FrameworkComponentId is an Integer attribute and MUST be setted. The correct value
       for this attribute is the ComponentId attribute of the MobSaveAsFile component
       which was created by the X-Builder Tool.
      PanelStyle contains CSS definition for the <div> element which contains this
       component.
      LabelStyle contains CSS definition for the InstructionText string label.
      MessageStyle contains CSS definition for the ResponseText string label.
      <Property> is an optional attribute and you can have as many as you want. Each
       property is a Name-Value pair which may contain some important values to your
       WebService.
      There is also an OnBeforeRender event, which is called when the component is
       initialized. It is useful to add some properties or edit this component attributes
       pragmatically.

    Component’s GUI
                                                  SaveButtonText


       InstructionText


                                                                    ResponseText




    Component’s Exceptions
    Could Not Transfer To Download Exception.
     Could not communicate to the Content Manager or Content Manager could not
     communicate to Transition Manager. The transition node has not been created and
     user will not be able to perform Push Transition.
    Invalid Download Ticket Exception.
     User has provided an invalid Download Ticket or it has been expired. In the second
     case, user should ask for a new Download Ticket in the Web Portal.
    Could Not Create Node Exception.
An error on the Transition Manager occurred. It was not possible to create the
transition node.
Print Document – PrintDocument


     Component’s Objective
This component is intended to provide a simple print task. User can find useful to print a
document while performing his/her task. It is also cross-media component which ease the
printing task on a mobile phone. The document will be printed on a Web component.

There is only an embedded plug-in version for this component.

      Component’s Cross-Media Characteristic
All documents which can be printed by this component are provided by a WebService from the
Government legacy.

It is also Cross-Media components by default. When adding them to a Service Model using the
X-Builder Tool, it’s necessary to create a simple Push Transition from each Mobile Print
Document component to any other Web Component.

The situation is shown below:

            1. Citizen finds a document which is useful to him/her. He wants to print it.
            2. Instead of printing from his/her mobile phone, user is asked to take a Print
               Ticket from the Web Portal. It should be done by someone who has a
               computer.
            3. This third person takes a Print Ticket and gives it to the Citizen.
            4. The citizen provides this ticket to the Print Document component and the third
               person will start printing it on his/her computer.

Because of these transitions, this component communicates through Content Manager to
Transition Manager Services. Tickets are managed by the Web Portal and are stored and
associated to the X-User Session in the Transition Manager.
    Component’s Configurable Attributes




      How to Implement the Embedded Component
As Embedded Save As File component, a government web programmer must modify some
Views, where he wants to add a Print Document component plug-in. This component is much
similar to Embedded Save As File. The programmer must perform the following steps to add
this plug-in:

   1. First of all, he needs to add (if no added yet) this line of code on top of the web page
      code:

<%@ Register TagPrefix="xgov" Namespace="Mobile.Components"
Assembly="Mobile" %>

   2. Then, he needs to add the following code where he wants to display a Print Document
      control:

<xgov:XMobPrintDocumentControl ID="XMobPrintDocumentControl1"
runat="server" FrameworkComponentId="2001"
      PanelStyle="width: 200px; height: 78px; text-align: center;
      margin-right: 5%;
         border: solid thin black; background-color: White;
         margin: 1% auto 1% auto;
         padding: 2% 2% 0 2%; color: black; font-size: small; font-
         weight: bold;"
           LabelStyle="color: black; font-size: smaller;"
           MessageStyle="color: Red; font-weight: bold; font-size: 8pt;"
           OnBeforeRender="test">
         <!-- Here you can add as many properties as you want. These
         properties will be passed as QueryString (name-value pairs) on
         the WebService Request and will be available on the Property[]
         you receive on Government Legacy’s WebServices. -->
       </xgov:XMobPrintDocumentControl>

Understanding this code:

       FrameworkComponentId is an Integer attribute and MUST be setted. The correct value
        for this attribute is the ComponentId attribute of the MobPrintDocument component
        which was created by the X-Builder Tool.
       PanelStyle contains CSS definition for the <div> element which contains this
        component.
       LabelStyle contains CSS definition for the InstructionText string label.
       MessageStyle contains CSS definition for the ResponseText string label.
       <Property> is an optional attribute and you can have as many as you want. Each
        property is a Name-Value pair which may contain some important values to your
        WebService.
       There is also an OnBeforeRender event, which is called when the component is
        initialized. It is useful to add some properties or edit this component attributes
        pragmatically.
       Although it is not shown, you can add as many Properties as you want, using the same
        code used to set up properties on Embedded Save As File component.

    Component’s GUI
                                                     PrintButtonText


         InstructionText


                                                                       ResponseText




    Component’s Exceptions
    Could Not Transfer To Print Exception.
     Could not communicate to the Content Manager or Content Manager could not
     communicate to Transition Manager. The transition node has not been created and
     user will not be able to perform Push Transition.
    Invalid Print Ticket Exception.
     User has provided an invalid Print Ticket or it has been expired. In the second case,
     user should ask for a new Print Ticket in the Web Portal.
 Could Not Create Node Exception.
  An error on the Transition Manager occurred. It was not possible to create the
  transition node.

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:12/3/2011
language:Galician
pages:31
liamei12345 liamei12345 http://
About