Sie sind auf Seite 1von 60

Subject:

eRegulations

DocType: Technical Specifications

Managed by : Created on :

eRegulations team 01 April 2013

CONTENTS 1. SHORT PRESENTATION OF MAIN FUNCTIONAL PARTS ................................................................ 3 2. ADMIN WEB APPLICATION ......................................................................................................... 4 2.1. APPLICATION ARCHITECTURE 2.2. DATA - CONCEPTS AND STATES 2.3. DOMAIN MODEL 5 6 8

2.3.1 STEP CONTEXT DIAGRAM ........................................................................................................... 8 2.3.2. E-REGULATIONS DATA STRUCTURE .............................................................................................. 9 2.4. CODE EXECUTION FLOW 28 2.4.1 REQUESTING A NEW PAGE ......................................................................................................... 28 2.4.2. TRIGGER AN ACTION ON THE PAGE (UPDATE) ............................................................................... 30 2.5. PROCEDURE SNAPSHOTS 2.6. HISTORY TRACKING OF EREGULATIONS CONTENT MODIFICATIONS 2.7. LABEL TRANSLATION 32 44 46

3. TRANSLATOR WEB APPLICATION ............................................................................................... 47 3.1. APPLICATION ARCHITECTURE 3.2. PRESENTER LOGIC - CODE FLOW 3.3. DATA STRUCTURE 48 49 50

4. PUBLIC WEB APPLICATION ........................................................................................................ 52 4.1. APPLICATION ARCHITECTURE 4.2. CONSISTENCY REVIEW - DATA STRUCTURE 53 54

5. DATA API SERVER ...................................................................................................................... 56 6. CRALERTS CLI ............................................................................................................................ 57 6.1. APPLICATION ARCHITECTURE 6.2. CONFIG FILE 57 58

7. STATISTICS CLI ........................................................................................................................... 59 7.1. APPLICATION ARCHITECTURE 7.2. CONFIG FILE 7.3. DATA STRUCTURE

59 60 60

UNCTAD - eRegulations team

Page 2

1. SHORT PRESENTATION OF MAIN FUNCTIONAL PARTS


The eRegulations system is based on several interconnected applications being responsible for assuring data entry activities, pre-processing the information and presenting it to the internet user. The main eRegulations applications / components are listed below: Admin WebApp - web application allowing data entry by authorized user Translator WebApp - web application allowing the translation of eRegulations content by an authorized user Public WebApp - web application displaying the data in HTML format Data API Server - web application for handling the RESTful web services in JSON format CRAlerts CLI - program executable in console line interface through a regular job that sends email alerts for responding on consistency reviews tickets or status changes Statistics CLI - program executable in console line interface through a regular job that computes statistical data and saves into the database

UNCTAD - eRegulations team

Page 3

2. ADMIN WEB APPLICATION


The eRegulations Admin WebApp allows a user with the correct credentials to enter the back office space of the system and to update the eRegulations content. The management of information is built on three main pillars that target the main areas of the application 1. eRegulation Content Here below the principal repositories: 2. Public Interface (public web pages) The admin application is also responsible for the information displayed on the public web site of e-regulations. We identified the following editable elements 3. Country parameters (system utility-belt) In this are the system groups several utility modules that helps the administrator manage auxiliary information present within the system user management feedbacks listing country settings (cost variables catalogue, foreign currencies used in the public system, third parties catalogue) label translation for the admin/public web pages history tracking of eRegulations content modifications files maintenance (possibility of file name changing into more web friendly names for uploaded documents or images) layout home page the procedure menus that assures not only direct linking with the procedures in the eRegulations content but supplementary visual information to be displayed in the public pages about us page procedures, blocks of steps, steps and recourses contacts (entities, units and persons in charge) requirements laws media library

UNCTAD - eRegulations team

Page 4

2.1. APPLICATION ARCHITECTURE


The architecture of the Admin Web Application follows a 3-tiers design : Data, Business, Presentation. We implemented the Interface Segregation Principle for decoupling the Data Access Layer implementation from the contract definition allowing in the future for easy update in case of more powerful technologies. Also the Data Access Layer was designed to implement the Repository pattern and Unit of Work pattern to assure the transactional action of persisting the data. Also for the web application we implemented the Model View Presenter pattern and define the views as interfaces gaining in flexibility of implementing the view interfaces as ASPX pages or as customized views for Ajax requests. The domain modeling respects the Domain Design Driven principles by defining several Root Aggregate Model responsible for the persistence of all their collections of composite models. We illustrate in the following diagram the layered architecture of the solution

UNCTAD - eRegulations team

Page 5

2.2. DATA - CONCEPTS AND STATES


The system is built around the following main concepts: - Objective a concrete investment operation presented as a ordered list of blocks - BlockOfSteps a ordered list of steps with a high level of cohesion - Step any interaction necessary to achieve the objective The Objectives are organized in a tree-way, in the sense that first there can be defined a list of main objectives, further permitting a detailed filtration of them in sub-objectives. A Block of steps can be qualified as optional therefore all the contained steps will be treated as optional within the objective. Also a block is responsible for setting the order of steps and also the relation of each step with the previous one (either parallel, alternative or sequential) A Step is described with several categories of info: - general info - results of steps - contact - requirements - costs - timeframe - legal frame - additional info - recourse The system is also the manager of several repositories that are highly linked to the description of one step. They are self-manageable repositories - Entities in charge - Units in charge - Persons in charge - General requirements ( downloadable forms, sample forms, online form links, documents, etc) - Laws (articles, full laws - either web links for online bookmarking or uploaded documents) - Media library (all the documents uploaded are stored in media library in logical objects that decouples the media file from the database reference for easy maintenance) All the eRegulations content follows the principle of internationalization by providing the data in one principal language, usually the country official language and in a secondary language, usually an international language. All the data-entry form will assure the persistence of data in the principal language leaving to special graphical interfaces for translation of content. There is also a special "external admin interface" called the Translator Admin WebApp that will allow an authorized translator to enter a specialized backoffice and update/request for publication of translation of content. UNCTAD - eRegulations team Page 6

Managing the State of a Data Procedure, BlockOfSteps and Step are stateful objects in the sense that at any time any of it can have only one state. The possible states are: - MODIFIED - PUBLISHED The following diagram describe the lifecycle of a Step, and the actions which will change its present state

/ create

MODIFIED

/ publish

/ Update

PUBLISH

When published the data is stored in a different format that is less normalized, still highly optimized for data- consumption systems. The system is capable of storing a complete snapshot of a procedure at a specified moment in time. A procedure can have several snapshots that will allow us to reconstruct the full version of that procedure at that particular time. When taking this snapshot the system crawls through the full graph of domain model in order to retrieve the information for root objects as well as for all the dependencies. The snapshots are persisted in special tables in the database, tables that are prefixed with "snapshot_". The snapshots tables have been designed for fast retrieval and query operations and are a less-normalized replica of the eRegulations content. A special record of the snapshots data is the current snapshot which responds to the need of frequent publish actions of the current eRegulations data. Each time we publish a stateful object the correspondent snapshot data is reconstructed.

UNCTAD - eRegulations team

Page 7

2.3. DOMAIN MODEL


2.3.1 STEP CONTEXT DIAGRAM

The diagram below will illustrate as example the domain modeling of the Step as the Root Aggregate Class and all the collection of bound classes.

The entire model of the eRegulations system has been implemented following a Domain Driven Design approach.

UNCTAD - eRegulations team

Page 8

2.3.2. E-REGULATIONS DATA STRUCTURE


Table fields
Table Name Admin_Block Model Block Column Id Type Int32 DbType Int NOT NULL IDENTITY NVarChar(10 0) NOT NULL NText Bit NOT NULL Int NOT NULL Int DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL Bit NOT NULL Bit NOT NULL Int NOT NULL IDENTITY Int NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Null able FALSE

Admin_Block Admin_Block Admin_Block Admin_Block Admin_Block Admin_Block Admin_Block Admin_Block Admin_Block Admin_Block Admin_Block Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility

Block Block Block Block Block Block Block Block Block Block Block StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility

Name Description IsOptional PhysicalPresence RepresentationThirdParty CreatedDate CreatedUser ModifiedDate ModifiedUser IsInRecycleBin Deleted Id

String String Bool Int32 Int32 DateTi me String DateTi me String Bool Bool Int32

FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

Step_Id IsExpectedResultsVisible IsEntityInChargeVisible IsUnitInChargeVisible IsPersonInChargeVisible IsRequirementsVisible IsCostsVisible IsCostsCommentsVisible IsTimeframeVisible

Int32 Bool Bool Bool Bool Bool Bool Bool Bool

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

UNCTAD - eRegulations team

Page 9

Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_StepSection Visibility Admin_Block_i18n

StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility StepSectionVi sibility Block_i18n

IsTimeframeWaintingTimeI nLineVisible IsTimeframeTimeSpentAtT heCounterVisible IsTimeframeWaitingTimeU ntilNextStepVisible IsTimeframeCommentsVisi ble IsLegalJustificationVisible IsLegalJustificationComme ntsVisible IsAdditionalInfoVisible IsRecoursesVisible IsCertificationVisible Id

Bool Bool Bool Bool Bool Bool Bool Bool Bool Int32

Admin_Block_i18n Admin_Block_i18n Admin_Block_i18n Admin_Block_i18n Admin_Block_Step Admin_Block_Step Admin_Block_Step Admin_Block_Step Admin_Block_Step Admin_Block_Step Admin_Menu

Block_i18n Block_i18n Block_i18n Block_i18n Block_Step Block_Step Block_Step Block_Step Block_Step Block_Step Menu

Block_Id Lang Name Description Id Block_Id Step_Id [Order] IsParallele IsAlternative Id

Int32 String String String Int32 Int32 Int32 Int32 Bool Bool Int32

Admin_Menu Admin_Menu Admin_Menu Admin_Menu

Menu Menu Menu Menu

Name MappingType Objective_ID Block_ID

String String Int32 Int32

Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NText Int NOT NULL IDENTITY Int NOT NULL Int NOT NULL Int NOT NULL Bit NOT NULL Bit NOT NULL Int NOT NULL IDENTITY NVarChar(10 0) NOT NULL VarChar(20) NOT NULL Int Int

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

FALSE FALSE TRUE TRUE


Page 10

UNCTAD - eRegulations team

Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu Admin_Menu_i18n

Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu Menu_i18n

ExplanatoryText WebPageKeywords WebPageDescription CreatedDate CreatedUser ModifiedDate ModifiedUser IsInRecycleBin Deleted IsVisibleInPublicMenu IsVisibleToGuest Image1 Image2 Image3 IconURL IconActiveURL PublicLayoutNbCols Id

String String String DateTi me String DateTi me String Bool Bool Bool Bool String String String String String Int32 Int32

Admin_Menu_i18n Admin_Menu_i18n Admin_Menu_i18n Admin_Menu_i18n Admin_Menu_i18n Admin_Menu_i18n Admin_MenuHierar chicalData Admin_MenuHierar chicalData Admin_MenuHierar

Menu_i18n Menu_i18n Menu_i18n Menu_i18n Menu_i18n Menu_i18n MenuHierarc hicalData MenuHierarc hicalData MenuHierarc

Menu_Id Lang Name ExplanatoryText WebPageKeywords WebPageDescription Id

Int32 String String String String String Int32

Parent_Id Child_Id

Int32 Int32

NText NVarChar(25 0) NOT NULL NVarChar(25 0) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL Bit NOT NULL Bit NOT NULL Bit Bit NVarChar(25 5) NVarChar(25 5) NVarChar(25 5) NVarChar(25 5) NVarChar(25 5) Int Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NText NVarChar(25 0) NVarChar(25 0) Int NOT NULL IDENTITY Int Int NOT

TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE

FALSE FALSE FALSE TRUE TRUE TRUE FALSE

TRUE FALSE
Page 11

UNCTAD - eRegulations team

chicalData Admin_MenuHierar chicalData Admin_MenuPerLa ngVisibility Admin_MenuPerLa ngVisibility Admin_MenuPerLa ngVisibility Admin_MenuPerLa ngVisibility Admin_Object_Me dia Admin_Object_Me dia Admin_Object_Me dia Admin_Object_Me dia Admin_Object_Me dia Admin_Objective

hicalData MenuHierarc hicalData MenuPerLang Visibility MenuPerLang Visibility MenuPerLang Visibility MenuPerLang Visibility Object_Medi a Object_Medi a Object_Medi a Object_Medi a Object_Medi a Objective

[Order] Id

Int32 Int32

Menu_Id Lang Visible Id

Int32 String Bool Int32

Object_Id Type Media_Id [Order] Id

Int32 String Int32 Int32 Int32

Admin_Objective Admin_Objective Admin_Objective Admin_Objective Admin_Objective Admin_Objective Admin_Objective Admin_Objective Admin_Objective_B lock Admin_Objective_B lock Admin_Objective_B lock Admin_Objective_B lock

Objective Objective Objective Objective Objective Objective Objective Objective Objective_Blo ck Objective_Blo ck Objective_Blo ck Objective_Blo ck

Name CreatedDate CreatedUser ModifiedDate ModifiedUser IsInRecycleBin Deleted AdditionalInfo Id

String DateTi me String DateTi me String Bool Bool String Int32

Objective_Id Block_Id [Order]

Int32 Int32 Int32

NULL Int NOT NULL Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL Bit NOT NULL Int NOT NULL IDENTITY Int NOT NULL VarChar(100) NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL IDENTITY NVarChar(10 0) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(10 00) Int NOT NULL IDENTITY Int NOT NULL Int NOT NULL Int NOT NULL

FALSE FALSE

FALSE FALSE FALSE FALSE

FALSE FALSE FALSE FALSE FALSE

FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE

FALSE FALSE FALSE


Page 12

UNCTAD - eRegulations team

Admin_Objective_i 18n Admin_Objective_i 18n Admin_Objective_i 18n Admin_Objective_i 18n Admin_Objective_i 18n Admin_ObjectiveHi erarchicalData Admin_ObjectiveHi erarchicalData Admin_ObjectiveHi erarchicalData Admin_ObjectiveHi erarchicalData Admin_Step

Objective_i18 n Objective_i18 n Objective_i18 n Objective_i18 n Objective_i18 n ObjectiveHier archicalData ObjectiveHier archicalData ObjectiveHier archicalData ObjectiveHier archicalData Step

Id

Int32

Objective_Id Lang Name AdditionalInfo Id

Int32 String String String Int32

Parent_Id Child_Id [Order] Id

Int32 Int32 Int32 Int32

Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NVarChar(10 00) Int NOT NULL IDENTITY Int Int NOT NULL Int NOT NULL Int NOT NULL IDENTITY Bit NOT NULL Bit NOT NULL Bit NOT NULL DateTime NVarChar(50 ) Int NVarChar(30 0) NOT NULL Int NOT NULL Int Bit NOT NULL NVarChar(20 0) Bit NOT NULL Int Int Int Int

FALSE

FALSE FALSE FALSE TRUE FALSE

TRUE FALSE FALSE FALSE

Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step

Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step

PublishedStatus IsRecourse Certified CertificationDate CertificationUser CertificationEntityInCharge _Id Name PhysicalPresence RepresentationThirdParty IsOnline OnlineStepURL IsOptional EntityInCharge_Id UnitInCharge_Id PersonInCharge_Id Contact_Law_Id

Bool Bool Bool DateTi me String Int32 String Int32 Int32 Bool String Bool Int32 Int32 Int32 Int32

FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE
Page 13

UNCTAD - eRegulations team

Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step_i18n

Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step_i18n

Contact_Articles RequirementsPhysicalPrese nce HasCosts NoCostsReason IsPayMethodCash IsPayMethodCheck IsPayMethodCard IsPayMethodOther PayMethodOtherText CostsComments WaintingTimeInLineMin WaintingTimeInLineMax TimeSpentAtTheCounterMi n TimeSpentAtTheCounterM ax WaitingTimeUntilNextStep Min WaitingTimeUntilNextStep Max TimeframeComments Timeframe_Law_Id Timeframe_Articles LawsComments AdditionalInfo CreatedDate CreatedUser ModifiedDate ModifiedUser IsInRecycleBin Deleted Id

String String Bool String Bool Bool Bool Bool String String Decim al Decim al Decim al Decim al Decim al Decim al String Int32 String String String DateTi me String DateTi me String Bool Bool Int32

NVarChar(40 0) VarChar(75) Bit NOT NULL VarChar(75) Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(20 0) NText Decimal(18,6 ) NOT NULL Decimal(18,6 ) NOT NULL Decimal(18,6 ) NOT NULL Decimal(18,6 ) NOT NULL Decimal(18,6 ) NOT NULL Decimal(18,6 ) NOT NULL NText Int NVarChar(40 0) NText NText DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL Bit NOT NULL Bit NOT NULL Int NOT NULL

TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

UNCTAD - eRegulations team

Page 14

Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_i18n Admin_Step_Recou rse Admin_Step_Recou rse Admin_Step_Recou rse Admin_Step_Recou rse Admin_StepCost

Step_i18n Step_i18n Step_i18n Step_i18n Step_i18n Step_i18n Step_i18n Step_i18n Step_i18n Step_i18n Step_Recours e Step_Recours e Step_Recours e Step_Recours e StepCost

Step_Id Lang Name PayMethodOtherText CostsComments TimeframeComments LawsComments AdditionalInfo Contact_Articles Timeframe_Articles Id

Int32 String String String String String String String String String Int32

Step_Id Recourse_Id [Order] Id

Int32 Int32 Int32 Int32

Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost

StepCost StepCost StepCost StepCost StepCost StepCost StepCost StepCost StepCost StepCost StepCost

Step_Id [Order] AggregateOperator IsSeparator Value Unit Operator Parameter Type AverageValue Comments

Int32 Int32 String Bool Decim al String String String String Decim al String

IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(30 0) NOT NULL NVarChar(20 0) NText NText NText NText NVarChar(40 0) NVarChar(40 0) Int NOT NULL IDENTITY Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL IDENTITY Int NOT NULL Int NOT NULL NVarChar(2) NOT NULL Bit NOT NULL Decimal(19,4 ) NOT NULL NVarChar(10 ) NVarChar(20 ) NOT NULL NVarChar(10 0) NVarChar(50 ) NOT NULL Decimal(19,4 ) NVarChar(40

FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE

FALSE FALSE FALSE FALSE

FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE
Page 15

UNCTAD - eRegulations team

Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost Admin_StepCost_i1 8n Admin_StepCost_i1 8n Admin_StepCost_i1 8n Admin_StepCost_i1 8n Admin_StepCost_i1 8n Admin_StepCost_i1 8n Admin_StepLaw

StepCost StepCost StepCost StepCost StepCost_i18 n StepCost_i18 n StepCost_i18 n StepCost_i18 n StepCost_i18 n StepCost_i18 n StepLaw

AverageValueComments FilterGlobalOption Law_Id Articles Id

String Int32 Int32 String Int32

StepCost_Id Lang Comments AverageValueComments Articles Id

Int32 String String String String Int32

Admin_StepLaw Admin_StepLaw Admin_StepLaw Admin_StepLaw Admin_StepLaw Admin_StepLaw Admin_StepLaw_i1 8n Admin_StepLaw_i1 8n Admin_StepLaw_i1 8n Admin_StepLaw_i1 8n Admin_StepLaw_i1 8n Admin_StepRequir ement Admin_StepRequir ement

StepLaw StepLaw StepLaw StepLaw StepLaw StepLaw StepLaw_i18 n StepLaw_i18 n StepLaw_i18 n StepLaw_i18 n StepLaw_i18 n StepRequire ment StepRequire ment

Step_Id [Order] AggregateOperator Law_Id Articles Comments Id

Int32 Int32 String Int32 String String Int32

StepLaw_Id Lang Articles Comments Id

Int32 String String String Int32

Step_Id

Int32

0) NVarChar(10 00) Int Int NVarChar(40 0) Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(40 0) NVarChar(10 00) NVarChar(40 0) Int NOT NULL IDENTITY Int NOT NULL Int NOT NULL NVarChar(2) NOT NULL Int NOT NULL NVarChar(40 0) NVarChar(40 0) Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(40 0) NVarChar(40 0) Int NOT NULL IDENTITY Int NOT NULL

TRUE TRUE TRUE TRUE FALSE

FALSE FALSE TRUE TRUE TRUE FALSE

FALSE FALSE FALSE FALSE TRUE TRUE FALSE

FALSE FALSE TRUE TRUE FALSE

FALSE
Page 16

UNCTAD - eRegulations team

Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement Admin_StepRequir ement_i18n Admin_StepRequir ement_i18n Admin_StepRequir ement_i18n Admin_StepRequir ement_i18n Admin_StepRequir ement_i18n Admin_StepResult

StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment StepRequire ment_i18n StepRequire ment_i18n StepRequire ment_i18n StepRequire ment_i18n StepRequire ment_i18n StepResult

[Order] AggregateOperator Type GenericRequirement_Id StepResult_Id NbOriginal NbCopy NbAuthenticated Comments FilterGlobalOption Law_Id Articles Id

Int32 String Int32 Int32 Int32 Int32 Int32 Int32 String Int32 Int32 String Int32

Int NOT NULL NVarChar(2) NOT NULL Int NOT NULL Int Int Int NOT NULL Int NOT NULL Int NOT NULL NText Int Int NVarChar(40 0) Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NText NVarChar(40 0) Int NOT NULL IDENTITY Int NOT NULL Int NOT NULL NVarChar(10 0) NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL NVarChar(50

FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE

StepRequirement_Id Lang Comments Articles Id

Int32 String String String Int32

FALSE FALSE TRUE TRUE FALSE

Admin_StepResult Admin_StepResult Admin_StepResult Admin_StepResult Admin_StepResult Admin_StepResult Admin_StepResult

StepResult StepResult StepResult StepResult StepResult StepResult StepResult

Step_Id [Order] Name NbOriginal NbCopy NbAuthenticated Type

Int32 Int32 String Int32 Int32 Int32 String

FALSE FALSE FALSE FALSE FALSE FALSE FALSE


Page 17

UNCTAD - eRegulations team

Admin_StepResult Admin_StepResult Admin_StepResult Admin_StepResult_ i18n Admin_StepResult_ i18n Admin_StepResult_ i18n Admin_StepResult_ i18n Admin_StepResult_ i18n EntityInCharge

StepResult StepResult StepResult StepResult_i1 8n StepResult_i1 8n StepResult_i1 8n StepResult_i1 8n StepResult_i1 8n EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg

Law_Id Articles IsDocumentPresent Id

Int32 String Bool Int32

StepResult_Id Lang Name Articles Id

Int32 String String String Int32

EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge

Name Address City PostalCode CountryCode Phone1 Phone2 Fax1 Fax2 Email1 Email2 Website1 Website2 Image

String String String String String String String String String String String String String String

ScheduleDay1MorningStart String ScheduleDay1MorningEnd String

) NOT NULL Int NVarChar(40 0) Bit NOT NULL Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NVarChar(40 0) Int NOT NULL IDENTITY NVarChar(10 0) NOT NULL NVarChar(25 0) NVarChar(50 ) NVarChar(50 ) NVarChar(50 ) NVarChar(50 ) NVarChar(50 ) NVarChar(50 ) NVarChar(50 ) NVarChar(10 0) NVarChar(10 0) NVarChar(25 0) NVarChar(25 0) NVarChar(25 5) NVarChar(5) NOT NULL NVarChar(5)

TRUE TRUE FALSE FALSE

FALSE FALSE FALSE TRUE FALSE

FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE
Page 18

UNCTAD - eRegulations team

EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge

e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e

ScheduleDay1EveningStart ScheduleDay1EveningEnd ScheduleDay1IsClosed

String String Bool

ScheduleDay1IsNotAvailabl Bool e ScheduleDay2MorningStart String ScheduleDay2MorningEnd ScheduleDay2EveningStart ScheduleDay2EveningEnd ScheduleDay2IsClosed String String String Bool

ScheduleDay2IsNotAvailabl Bool e ScheduleDay3MorningStart String ScheduleDay3MorningEnd ScheduleDay3EveningStart ScheduleDay3EveningEnd ScheduleDay3IsClosed String String String Bool

ScheduleDay3IsNotAvailabl Bool e ScheduleDay4MorningStart String ScheduleDay4MorningEnd ScheduleDay4EveningStart ScheduleDay4EveningEnd ScheduleDay4IsClosed String String String Bool

ScheduleDay4IsNotAvailabl Bool e ScheduleDay5MorningStart String ScheduleDay5MorningEnd ScheduleDay5EveningStart String String

NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 19

UNCTAD - eRegulations team

EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge EntityInCharge_i18 n

EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e EntityInCharg e_i18n

ScheduleDay5EveningEnd ScheduleDay5IsClosed

String Bool

ScheduleDay5IsNotAvailabl Bool e ScheduleDay6MorningStart String ScheduleDay6MorningEnd ScheduleDay6EveningStart ScheduleDay6EveningEnd ScheduleDay6IsClosed String String String Bool

ScheduleDay6IsNotAvailabl Bool e ScheduleDay7MorningStart String ScheduleDay7MorningEnd ScheduleDay7EveningStart ScheduleDay7EveningEnd ScheduleDay7IsClosed ScheduleDay7IsNotAvailabl e ScheduleComments CreatedDate CreatedUser ModifiedDate ModifiedUser OwnershipStatus Deleted IsVisibleInPublicDirectory GoogleMapsURL Id String String String Bool Bool String DateTi me String DateTi me String String Bool Bool String Int32

NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(50 0) DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL VarChar(50) NOT NULL Bit NOT NULL Bit NVarChar(80 0) Int NOT NULL IDENTITY

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE

UNCTAD - eRegulations team

Page 20

EntityInCharge_i18 n EntityInCharge_i18 n EntityInCharge_i18 n EntityInCharge_i18 n EntityInCharge_i18 n EntityInCharge_i18 n EntityInCharge_i18 n EntityInCharge_i18 n GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t GenericRequiremen t_i18n GenericRequiremen t_i18n GenericRequiremen t_i18n GenericRequiremen t_i18n GenericRequiremen

EntityInCharg e_i18n EntityInCharg e_i18n EntityInCharg e_i18n EntityInCharg e_i18n EntityInCharg e_i18n EntityInCharg e_i18n EntityInCharg e_i18n EntityInCharg e_i18n GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement GenericRequi rement_i18n GenericRequi rement_i18n GenericRequi rement_i18n GenericRequi rement_i18n GenericRequi

EntityInCharge_Id Lang Name Address City Website1 Website2 ScheduleComments Id

Int32 String String String String String String String Int32

Name Description Type CreatedDate CreatedUser ModifiedDate ModifiedUser OwnershipStatus Deleted IsDocumentPresent IsVisibleInPublicDirectory Id

String String String DateTi me String DateTi me String String Bool Bool Bool Int32

Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NVarChar(25 0) NVarChar(50 ) NVarChar(25 0) NVarChar(25 0) NVarChar(50 0) Int NOT NULL IDENTITY NVarChar(10 0) NOT NULL NText NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL VarChar(50) NOT NULL Bit NOT NULL Bit NOT NULL Bit Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NText

FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE FALSE

FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

GenericRequirement_Id Lang Name Description

Int32 String String String

FALSE FALSE FALSE TRUE


Page 21

UNCTAD - eRegulations team

t_i18n Law

rement_i18n Law

Id

Int32

Law Law Law Law Law Law Law Law Law Law Law_i18n

Law Law Law Law Law Law Law Law Law Law Law_i18n

Name Description CreatedDate CreatedUser ModifiedDate ModifiedUser OwnershipStatus Deleted IsDocumentPresent IsVisibleInPublicDirectory Id

String String DateTi me String DateTi me String String Bool Bool Bool Int32

Law_i18n Law_i18n Law_i18n Law_i18n Media Media Media Media Media Media Media Media Media

Law_i18n Law_i18n Law_i18n Law_i18n Media Media Media Media Media Media Media Media Media

Law_Id Lang Name Description Id Name FileName Extention Description Length PreviewImageName CreatedDate CreatedUser

Int32 String String String Int32 String String String String Decim al String DateTi me String

Int NOT NULL IDENTITY NVarChar(30 0) NOT NULL NText DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL VarChar(50) NOT NULL Bit NOT NULL Bit NOT NULL Bit Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(30 0) NOT NULL NText Int NOT NULL IDENTITY NVarChar(30 0) NOT NULL NVarChar(50 0) NVarChar(15 ) NText Decimal(18,0 ) NVarChar(10 0) DateTime NOT NULL NVarChar(50 ) NOT NULL

FALSE

FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

FALSE FALSE FALSE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE

UNCTAD - eRegulations team

Page 22

Media Media Media Media Media_i18n Media_i18n Media_i18n Media_i18n PersonInCharge

Media Media Media Media Media_i18n Media_i18n Media_i18n Media_i18n PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar ge PersonInChar

ModifiedDate ModifiedUser Deleted IsDocumentPresent Id Media_Id Lang Name Id

DateTi me String Bool Bool Int32 Int32 String String Int32

PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge PersonInCharge_i1

UnitInCharge_Id Name Profession Phone1 Phone2 Email1 Email2 Image CreatedDate CreatedUser ModifiedDate ModifiedUser OwnershipStatus Deleted IsVisibleInPublicDirectory Id

Int32 String String String String String String String DateTi me String DateTi me String String Bool Bool Int32

DateTime NOT NULL NVarChar(50 ) NOT NULL Bit NOT NULL Bit NOT NULL Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(30 0) NOT NULL Int NOT NULL IDENTITY Int NVarChar(10 0) NOT NULL NVarChar(30 0) NVarChar(50 ) NVarChar(50 ) NVarChar(10 0) NVarChar(10 0) NVarChar(25 5) DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL VarChar(50) NOT NULL Bit NOT NULL Bit Int NOT

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 23

UNCTAD - eRegulations team

8n PersonInCharge_i1 8n PersonInCharge_i1 8n PersonInCharge_i1 8n PersonInCharge_i1 8n UnitInCharge

ge_i18n PersonInChar ge_i18n PersonInChar ge_i18n PersonInChar ge_i18n PersonInChar ge_i18n UnitInCharge PersonInCharge_Id Lang Name Profession Id Int32 String String String Int32

UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge

UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge

EntityInCharge_Id Name Image ScheduleIsInherited

Int32 String String Bool

ScheduleDay1MorningStart String ScheduleDay1MorningEnd ScheduleDay1EveningStart ScheduleDay1EveningEnd ScheduleDay1IsClosed String String String Bool

ScheduleDay1IsNotAvailabl Bool e ScheduleDay2MorningStart String ScheduleDay2MorningEnd ScheduleDay2EveningStart ScheduleDay2EveningEnd ScheduleDay2IsClosed String String String Bool

ScheduleDay2IsNotAvailabl Bool e ScheduleDay3MorningStart String ScheduleDay3MorningEnd ScheduleDay3EveningStart ScheduleDay3EveningEnd String String String

NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NVarChar(30 0) Int NOT NULL IDENTITY Int NVarChar(10 0) NOT NULL NVarChar(25 5) Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5)

FALSE FALSE FALSE TRUE FALSE

TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 24

UNCTAD - eRegulations team

UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge

UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge

ScheduleDay3IsClosed

Bool

ScheduleDay3IsNotAvailabl Bool e ScheduleDay4MorningStart String ScheduleDay4MorningEnd ScheduleDay4EveningStart ScheduleDay4EveningEnd ScheduleDay4IsClosed String String String Bool

ScheduleDay4IsNotAvailabl Bool e ScheduleDay5MorningStart String ScheduleDay5MorningEnd ScheduleDay5EveningStart ScheduleDay5EveningEnd ScheduleDay5IsClosed String String String Bool

ScheduleDay5IsNotAvailabl Bool e ScheduleDay6MorningStart String ScheduleDay6MorningEnd ScheduleDay6EveningStart ScheduleDay6EveningEnd ScheduleDay6IsClosed String String String Bool

ScheduleDay6IsNotAvailabl Bool e ScheduleDay7MorningStart String ScheduleDay7MorningEnd ScheduleDay7EveningStart ScheduleDay7EveningEnd ScheduleDay7IsClosed String String String Bool

NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 25

UNCTAD - eRegulations team

UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge_i18n

UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge UnitInCharge _i18n UnitInCharge _i18n UnitInCharge _i18n UnitInCharge _i18n UnitInCharge _i18n SystemLangu age SystemLangu age SystemLangu age SystemLangu age

ScheduleDay7IsNotAvailabl e ScheduleComments CreatedDate CreatedUser ModifiedDate ModifiedUser OwnershipStatus Deleted IsVisibleInPublicDirectory Id

Bool String DateTi me String DateTi me String String Bool Bool Int32

UnitInCharge_i18n UnitInCharge_i18n UnitInCharge_i18n UnitInCharge_i18n SystemLanguage SystemLanguage SystemLanguage SystemLanguage


UnitInCharge_Id Lang Name ScheduleComments Code Name IsActive IsPrincipal

Int32 String String String String String Bool Bool

Bit NOT NULL NVarChar(50 0) DateTime NOT NULL NVarChar(50 ) NOT NULL DateTime NOT NULL NVarChar(50 ) NOT NULL VarChar(50) NOT NULL Bit NOT NULL Bit Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL NVarChar(10 0) NOT NULL NVarChar(50 0) VarChar(2) NOT NULL NVarChar(20 ) NOT NULL Bit NOT NULL Bit NOT NULL

FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE

Relationships
Table Admin_StepSectionVisibility Admin_Block_i18n Admin_Block_Step Admin_Block_Step Admin_Menu Admin_Menu Admin_Menu_i18n Admin_MenuHierarchicalData Admin_MenuHierarchicalData
UNCTAD - eRegulations team

ThisKey Step_Id Block_Id Block_Id Step_Id Block_ID Objective_ID Menu_Id Child_Id Parent_Id

OtherKey Id Id Id Id Id Id Id Id Id

Reference Admin_Step Admin_Block Admin_Block Admin_Step Admin_Block Admin_Objective Admin_Menu Admin_Menu Admin_Menu
Page 26

Admin_MenuPerLangVisibility Admin_Object_Media Admin_Object_Media Admin_Object_Media Admin_Object_Media Admin_Object_Media Admin_Object_Media Admin_Objective_Block Admin_Objective_Block Admin_Objective_i18n Admin_ObjectiveHierarchicalData Admin_ObjectiveHierarchicalData Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step Admin_Step_i18n Admin_Step_Recourse Admin_Step_Recourse Admin_StepCost Admin_StepCost Admin_StepCost_i18n Admin_StepLaw Admin_StepLaw Admin_StepLaw_i18n Admin_StepRequirement Admin_StepRequirement Admin_StepRequirement Admin_StepRequirement Admin_StepRequirement_i18n Admin_StepResult Admin_StepResult Admin_StepResult_i18n EntityInCharge_i18n GenericRequirement_i18n Law_i18n Media_i18n PersonInCharge PersonInCharge_i18n UnitInCharge UnitInCharge_i18n
UNCTAD - eRegulations team

Menu_Id Media_Id Object_Id Object_Id Object_Id Object_Id Object_Id Block_Id Objective_Id Objective_Id Parent_Id Child_Id CertificationEntityInCharg e_Id EntityInCharge_Id UnitInCharge_Id PersonInCharge_Id Contact_Law_Id Timeframe_Law_Id Step_Id Recourse_Id Step_Id Step_Id Law_Id StepCost_Id Step_Id Law_Id StepLaw_Id Step_Id StepResult_Id GenericRequirement_Id Law_Id StepRequirement_Id Step_Id Law_Id StepResult_Id EntityInCharge_Id GenericRequirement_Id Law_Id Media_Id UnitInCharge_Id PersonInCharge_Id EntityInCharge_Id UnitInCharge_Id

Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id Id

Admin_Menu Media GenericRequireme nt Law Admin_Menu Admin_StepResult Admin_Step Admin_Block Admin_Objective Admin_Objective Admin_Objective Admin_Objective EntityInCharge EntityInCharge UnitInCharge PersonInCharge Law Law Admin_Step Admin_Step Admin_Step Admin_Step Law Admin_StepCost Admin_Step Law Admin_StepLaw Step Admin_StepResult GenericRequireme nt Law Admin_StepRequir ement Admin_Step Law Admin_StepResult EntityInCharge GenericRequireme nt Law Media UnitInCharge PersonInCharge EntityInCharge UnitInCharge
Page 27

2.4. CODE EXECUTION FLOW


We will illustrate in this section the code execution flow for two possible cases of user interaction with the admin web application. - requesting a new page - triggering an action on the page (update information, publish, change the order of elements, etc)

2.4.1 REQUESTING A NEW PAGE

Requesting a new page will involve the creation of a new instance of System.Web.UI.Page. Depending on the page requested the Asp.Net Page must implement the correspondent IView interface. We will exemplify for viewing the details page of one step: 1. User makes a request in the browser by clicking on a hyperlink. The request will send as a query parameter the ID of the requested step. Here the sequence of code: 1. IIS identifies the requested resource as "StepGeneral.aspx" inside the admin application, so it forwards the request to our application UNCTAD - eRegulations team Page 28

2. Asp.Net creates a new instance of the object "Views_Regulation_StepGeneral" 3. Asp.Net trigger the event "Page_Load" 4. Inside the "Page_Load" we create a new instance of the presenter sending in the constructor the current instance of Views_Regulation_StepGeneral as this class implements the interface IStepView and the AppContext which is an application context that travels through all the layers. The AppContext is created each time a request is intercepted by our application. It is cached through the duration of the request in the HttpContext 5. the newly created presenter will call the method InitView send the stepId as parameter 6. the presenter holds all the presentation logic. It has a reference of the "IView" interface which will use for displaying the information. Still is not aware of how this interface is implemented (in our case is the System.Web.UI.Page) 7. the presenter will create a new instance of the BusinessObjectAPI related to our need (in our case StepBO) 8. the BusinessObjectAPI holds a reference to the Root Aggregate Class (in our case Step). the presenter creates a new instance of the model, it sets the Id of the model and it attaches it to the BusinessObjectAPI. 9. the presenter demand the BusinessObjectAPI to load the model 10. the BusinessObjectAPI will call the RepositoryFactory in order to retrieve an instance of IRepository that will use for talking to the DataLayer (it will return an instance of LiqRepository) 11. the BusinessObjectAPI uses the IRepository instance and load the model from the data (the repository will call a SQL query that will be executed against the SQL Server DB and the load the model with the db data) 12. the BusinessObjectAPI holds a collection of errors in case any operation performed raised an error 13. the presenter verifies if the load of model was ended successfully and if so it tells the IView (in our case the Regulation) to display the details of the model . If the process of loading the data failed, the presenter calls the "ShowErrors" method of the IView to display the errors 14. inside the System.Web.UI.Page methods/properties of the IView implementation we set the data to html elements 15. the System.Web.UI.Page finishes the cycle and display the html output UNCTAD - eRegulations team Page 29

2.4.2. TRIGGER AN ACTION ON THE PAGE (UPDATE)

Sending a post request to the server is 99% made through an Ajax call (with a XMLHttpRequest). The end point is a static method in the aspx page having the attribute [WebMethod]. Inside this static method we create an instance of the custom view that implements our IView interface (IStepView). We will use the same presenter (StepPresenter) together with our custom view in order to achieve our updating purpose. The difference is the transport of all the data that the browser will exchange with the server. In the case of the Ajax call we encapsulate the data in Data Transfer Objects (DTO) which are light objects holding only property fields. In the case of classic Http post request the transport would have been the form input collection send either encoded in the url as query string or send as payload inside the body of the http request message. All the custom views are extended from a base class called BaseWebView that holds all utilities needed by all the custom views. The AppContext is also created each time a request is handled. It is also cached in the current HtppContext managed by the Asp.Net framework. UNCTAD - eRegulations team Page 30

We will exemplify for updating the details page of one step: 1. User clicks on the "SAVE" button inside the step page. The client side code will wrap all the data from the editable fields in a JSON object and the sends a new XMLHttpRequest to the endpoind " StepGeneral.aspx/Update" with the payload the newly JSON object that will deserialize into a DTO C# Object and a ID parameter with the value equal to the StepID. Here the sequence of code: 1. IIS identifies the requested resource as "StepGeneral.aspx/Update" inside the admin application, so it forwards the request to our application 2. Asp.Net searches for the static method "Update" having the [WebMethod] attribute inside the class behind the "StepGeneral.aspx" page and calls this method 3. we retrieve the AppContext 4. create a new instance of our custom view that implements the interface IStepView (in our case UpdateView). Send in the constructor the DTO received 5. create a new instance of the presenter sending the instance of our custom view and the AppContext 6. the newly created presenter will call the method Update send the stepId as parameter 7. the presenter holds all the presentation logic. It has a reference of the "IView" interface which will use for retrieval of all the necessary information to update the model. Still is not aware of how this interface is implemented (in our case is the instance of CustomView) 8. the presenter will create a new instance of the BusinessObjectAPI related to our need (in our case StepBO) 9. the BusinessObjectAPI holds a reference to the Root Aggregate Class (in our case Step). the presenter creates a new instance of the model, it sets the Id of the model and it attaches it to the BusinessObjectAPI. 10. the presenter demand the BusinessObjectAPI to load the model 11. the BusinessObjectAPI will call the RepositoryFactory in order to retrieve an instance of IRepository that will use for talking to the DataLayer (it will return an instance of LiqRepository) 12. the BusinessObjectAPI uses the IRepository instance and load the model from the data (the repository will call a SQL query that will be executed against the SQL Server DB and the load the model with the db data) 13. if no errors encountered the presenter will ask the view to update the model. As our custom view received through the constructor the DTO sent by the user it will use it to update the model. 14. then the presenter will ask the IRepository instance to persist the modifications 15. the BusinessObjectAPI holds a collection of errors in case any operation performed raised an error 16. the presenter verifies if the update of model was ended successfully and if so it raises an event called SavedSuccessfully. (normally in the custom view you will write an SavedSuccessfullyHandler where you will have a flag holding the operation response. If the process of loading the data failed, the presenter calls the "ShowErrors" method of the IView to display the errors (the custom view will hold the errors inside a collection of errors) 17. the webMethod then verifies if the success flag of the custom view is true and sends a ok message to the browser. If custom view has errors inside its collection, the webMethod will throw an ApplicationException with the message holding the serialized version of all the view errors.

UNCTAD - eRegulations team

Page 31

2.5. PROCEDURE SNAPSHOTS


As already mention the system allows you to register a full snapshot replica of one procedure. The snapshot is saved in specialized tables that are less normalized and holds the data in both the principal and secondary languages. Each time a user clicks on "Save snapshot" button in the admin interface the system makes a deep copy of the data for one procedure. The data saved for one procedure is: - objective full data - blocks of steps full data - steps full data (and for each element used form the Repositories it copies the current full data: full data for GenericRequirement, Law, EntityInCharge, UnitInCharge, PersonInCharge) The last undated snapshot, called also the "current snapshot" is used for keeping the current published data of eRegulations procedures content. Also the eRegulations Data API Publisher retrieves the information for one procedure from the current snapshot and send it to the eRegulations Data API Server. The reconstruction of the current snapshot of one procedure is triggered by each of the following events: - publish an objective - publish a block - publish a step - publish a recourse - update an item in GenericRequirement repository for all the procedures where that GenericRequirement is used - update an item in Law repository repository for all the procedures where that Law is used - update an item in EntityInCharge repository repository for all the procedures where that EntityInCharge is used - update an item in UnitInCharge repository repository for all the procedures where that UnitInCharge is used - update an item in PersonInCharge repository repository for all the procedures where that PersonInCharge is used Note: The tables do not have a strong link between them, there are no foreign keys that enforce the restriction for the data, as the data is automatically generated through the execution of special stored procedures easily identied as they all holder the "snapshot" word in their names: - sp_snapshot_get... - sp_take_snapshot ... UNCTAD - eRegulations team Page 32

Table name SnapshotRegistry SnapshotRegistry SnapshotRegistry SnapshotRegistry SnapshotRegistry SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep

Column name Id Objective_id SnapshotVersion SnapshotDate IsCurrent Registry_Id Objective_Id Block_Id IsRecourse Step_Id [Order] IsParallele IsAlternative Certified CertificationDate CertificationUser Id Lang Name PhysicalPresence RepresentationThirdParty IsOnline OnlineStepURL IsOptional Contact_Law_Id Contact_Law_Name Contact_Law_Description Contact_Articles RequirementsPhysicalPresence HasCosts NoCostsReason IsPayMethodCash IsPayMethodCheck IsPayMethodCard IsPayMethodOther PayMethodOtherText CostsComments WaintingTimeInLineMin WaintingTimeInLineMax TimeSpentAtTheCounterMin TimeSpentAtTheCounterMax

DbType Int NOT NULL IDENTITY Int NOT NULL Int NOT NULL DateTime NOT NULL Bit NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Bit NOT NULL Int Int NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL DateTime NVarChar(50) Int NOT NULL VarChar(2) NOT NULL NVarChar(100) NOT NULL Int NOT NULL Int Bit NOT NULL NVarChar(200) Bit NOT NULL Int NVarChar(300) NVarChar(400) NVarChar(400) VarChar(75) Bit NOT NULL VarChar(75) Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(200) NText Decimal(18,6) NOT NULL Decimal(18,6) NOT NULL Decimal(18,6) NOT NULL Decimal(18,6) NOT

Null able FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE
Page 33

UNCTAD - eRegulations team

SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStep SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepCost SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge

WaitingTimeUntilNextStepMin WaitingTimeUntilNextStepMax TimeframeComments Timeframe_Law_Id Timeframe_Law_Name Timeframe_Law_Description Timeframe_Articles LawsComments AdditionalInfo CertificationEntityInCharge_Id CertificationEntityInCharge_Name Status Version StatusDate Registry_Id Objective_Id Block_Id Step_Id [Order] Id Lang AggregateOperator IsSeparator Value Unit Operator Parameter Type AverageValue Comments AverageValueComments FilterGlobalOption Law_Id Law_Name Law_Description Articles CalculatedValue Registry_Id Objective_Id

NULL Decimal(18,6) NOT NULL Decimal(18,6) NOT NULL NText Int NVarChar(300) NVarChar(400) NVarChar(400) NText NText Int NVarChar(100) Int Int DateTime Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(2) NOT NULL Bit NOT NULL Decimal(19,4) NOT NULL NVarChar(10) NVarChar(20) NOT NULL NVarChar(100) NVarChar(50) NOT NULL Decimal(19,4) NVarChar(400) NVarChar(1000) Int Int NVarChar(300) NVarChar(400) NVarChar(400) Decimal(19,4) Int NOT NULL Int NOT NULL

FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE

UNCTAD - eRegulations team

Page 34

SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh

Block_Id Step_Id Id Lang Name Address City PostalCode CountryCode Phone1 Phone2 Fax1 Fax2 Email1 Email2 Website1 Website2 Image ScheduleDay1MorningStart ScheduleDay1MorningEnd ScheduleDay1EveningStart ScheduleDay1EveningEnd ScheduleDay1IsClosed ScheduleDay1IsNotAvailable ScheduleDay2MorningStart ScheduleDay2MorningEnd

Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(100) NOT NULL NVarChar(250) NVarChar(50) NVarChar(50) NVarChar(50) NVarChar(50) NVarChar(50) NVarChar(50) NVarChar(50) NVarChar(100) NVarChar(100) NVarChar(250) NVarChar(250) NVarChar(255) NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT

FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 35

UNCTAD - eRegulations team

arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge

ScheduleDay2EveningStart ScheduleDay2EveningEnd ScheduleDay2IsClosed ScheduleDay2IsNotAvailable ScheduleDay3MorningStart ScheduleDay3MorningEnd ScheduleDay3EveningStart ScheduleDay3EveningEnd ScheduleDay3IsClosed ScheduleDay3IsNotAvailable ScheduleDay4MorningStart ScheduleDay4MorningEnd ScheduleDay4EveningStart ScheduleDay4EveningEnd ScheduleDay4IsClosed ScheduleDay4IsNotAvailable ScheduleDay5MorningStart ScheduleDay5MorningEnd ScheduleDay5EveningStart ScheduleDay5EveningEnd ScheduleDay5IsClosed ScheduleDay5IsNotAvailable ScheduleDay6MorningStart ScheduleDay6MorningEnd ScheduleDay6EveningStart

NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 36

UNCTAD - eRegulations team

SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepEntityInCh arge SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepLaw SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge

ScheduleDay6EveningEnd ScheduleDay6IsClosed ScheduleDay6IsNotAvailable ScheduleDay7MorningStart ScheduleDay7MorningEnd ScheduleDay7EveningStart ScheduleDay7EveningEnd ScheduleDay7IsClosed ScheduleDay7IsNotAvailable ScheduleComments Registry_Id Objective_Id Block_Id Step_Id [Order] Id Lang AggregateOperator Law_Id Law_Name Law_Description Articles Comments Law_IsDocumentPresent Registry_Id Objective_Id Block_Id Step_Id Id Lang Name

NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(500) Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(2) NOT NULL Int NOT NULL NVarChar(300) NOT NULL NText NVarChar(400) NVarChar(400) Bit NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(100) NOT NULL

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

UNCTAD - eRegulations team

Page 37

SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepPersonInC harge SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme

Profession Phone1 Phone2 Email1 Email2 Image Registry_Id Objective_Id Block_Id Step_Id [Order] Id Lang AggregateOperator Type GenericRequirement_Id GenericRequirement_Name GenericRequirement_Description GenericRequirement_Type StepResult_Id StepResult_Step_Id NbOriginal NbCopy NbAuthenticated Comments FilterGlobalOption

NVarChar(300) NVarChar(50) NVarChar(50) NVarChar(100) NVarChar(100) NVarChar(255) Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(2) NOT NULL Int NOT NULL Int NVarChar(100) NText NVarChar(50) Int Int Int NOT NULL Int NOT NULL Int NOT NULL NText Int

TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE TRUE
Page 38

UNCTAD - eRegulations team

nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepRequireme nt SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepResult SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility

Law_Id Law_Name Law_Description Articles GenericRequirement_IsDocumentPres ent Registry_Id Objective_Id Block_Id Step_Id [Order] Id Lang Name NbOriginal NbCopy NbAuthenticated Type Law_Id Law_Name Law_Description Articles IsDocumentPresent Registry_Id Objective_Id Block_Id Step_Id IsExpectedResultsVisible IsEntityInChargeVisible IsUnitInChargeVisible IsPersonInChargeVisible IsRequirementsVisible IsCostsVisible

Int NVarChar(300) NVarChar(400) NVarChar(400) Bit Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(100) NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL NVarChar(50) NOT NULL Int NVarChar(300) NVarChar(400) NVarChar(400) Bit NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL

TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 39

UNCTAD - eRegulations team

SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepSectionVisi bility SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar

IsCostsCommentsVisible IsTimeframeVisible IsTimeframeWaintingTimeInLineVisibl e IsTimeframeTimeSpentAtTheCounter Visible IsTimeframeWaitingTimeUntilNextSte pVisible IsTimeframeCommentsVisible IsLegalJustificationVisible IsLegalJustificationCommentsVisible IsAdditionalInfoVisible IsRecoursesVisible IsCertificationVisible Registry_Id Objective_Id Block_Id Step_Id Id Lang Name Image ScheduleIsInherited ScheduleDay1MorningStart ScheduleDay1MorningEnd ScheduleDay1EveningStart ScheduleDay1EveningEnd ScheduleDay1IsClosed ScheduleDay1IsNotAvailable

Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Bit NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(100) NOT NULL NVarChar(255) Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 40

UNCTAD - eRegulations team

ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge

ScheduleDay2MorningStart ScheduleDay2MorningEnd ScheduleDay2EveningStart ScheduleDay2EveningEnd ScheduleDay2IsClosed ScheduleDay2IsNotAvailable ScheduleDay3MorningStart ScheduleDay3MorningEnd ScheduleDay3EveningStart ScheduleDay3EveningEnd ScheduleDay3IsClosed ScheduleDay3IsNotAvailable ScheduleDay4MorningStart ScheduleDay4MorningEnd ScheduleDay4EveningStart ScheduleDay4EveningEnd ScheduleDay4IsClosed ScheduleDay4IsNotAvailable ScheduleDay5MorningStart ScheduleDay5MorningEnd ScheduleDay5EveningStart ScheduleDay5EveningEnd ScheduleDay5IsClosed ScheduleDay5IsNotAvailable ScheduleDay6MorningStart

NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Page 41

UNCTAD - eRegulations team

SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotStepUnitInChar ge SnapshotObjective SnapshotObjective SnapshotObjective SnapshotObjective SnapshotObjective SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotObject_Media SnapshotBlock

ScheduleDay6MorningEnd ScheduleDay6EveningStart ScheduleDay6EveningEnd ScheduleDay6IsClosed ScheduleDay6IsNotAvailable ScheduleDay7MorningStart ScheduleDay7MorningEnd ScheduleDay7EveningStart ScheduleDay7EveningEnd ScheduleDay7IsClosed ScheduleDay7IsNotAvailable ScheduleComments Registry_Id Id Lang Name AdditionalInfo Registry_Id Objective_Id Block_Id Step_Id Lang Object_Id Type [Order] Media_Id Media_Name Media_FileName Media_Extention Media_Description Media_Length Media_PreviewImageName Media_IsDocumentPresent Registry_Id

NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL NVarChar(5) NOT NULL Bit NOT NULL Bit NOT NULL NVarChar(500) Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(100) NOT NULL NVarChar(1000) Int NOT NULL Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL Int NOT NULL VarChar(100) NOT NULL Int NOT NULL Int NOT NULL NVarChar(300) NOT NULL NVarChar(500) NVarChar(15) NText Decimal(18,0) NVarChar(100) Bit NOT NULL Int NOT NULL

FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE
Page 42

UNCTAD - eRegulations team

SnapshotBlock SnapshotBlock SnapshotBlock SnapshotBlock SnapshotBlock SnapshotBlock SnapshotBlock SnapshotBlock SnapshotBlock


Objective_Id [Order] Id Lang Name Description IsOptional PhysicalPresence RepresentationThirdParty

Int NOT NULL Int NOT NULL Int NOT NULL VarChar(2) NOT NULL NVarChar(100) NOT NULL NText Bit NOT NULL Int NOT NULL Int

FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE

UNCTAD - eRegulations team

Page 43

2.6. HISTORY TRACKING OF EREGULATIONS CONTENT MODIFICATIONS


The eRegulations domain model is fully aware of "dirty" properties and right before updating the model into the database it iterates through all the models registered in the DataContext (RootAggregate object and all the aggregate/composite objects) and stores the modifications of those updated properties. A "dirty property" of an object is that property that changed its original value, the original value being the one retrieved from the database. As described earlier in the document the process of updating a model in the database implies the first loading of the current data from the database , update only a precise list of properties from that model (depending in which context you are) and then ending by persisting the modifications in the database. The implementation of IRepository is capable of having this low-level verification the moment before throwing all the updates in the database. It is based on the DataContext that assures the Unit of Work action of persisting the data. We will list bellow the structure of the audit tables that hold the original and modified value of each field of the model. It also takes account the root aggregate object and the relations of dependent objects to that root aggregate object.

Table name AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecordFi elds AuditRecords

Model AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecordF ield AuditRecord

Column Id AuditRecordId FieldName FieldType OldValue_asIntege r NewValue_asInteg er OldValue_asDecim al NewValue_asDeci mal OldValue_asText NewValue_asText OldValue_asDateTi me NewValue_asDate Time OldValue_asBoole an NewValue_asBool ean Id

Type System.Int32 System.Int32

DbType Int NOT NULL IDENTITY Int NOT NULL

Null able FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE

System.String VarChar(100) NOT NULL System.String VarChar(100) NOT NULL System.Int32 Int System.Int32 Int

System.Deci Decimal(19,4) mal System.Deci Decimal(19,4) mal System.String NText System.String NText System.DateT ime System.DateT ime System.Boole an System.Boole an System.Int32 DateTime DateTime Bit Bit Int NOT NULL IDENTITY

UNCTAD - eRegulations team

Page 44

AuditRecords AuditRecords AuditRecords AuditRecords AuditRecords AuditRecords AuditRecords AuditRecords AuditRecords AuditRecords

AuditRecord AuditRecord AuditRecord AuditRecord AuditRecord AuditRecord AuditRecord AuditRecord AuditRecord AuditRecord

Action EntityTable EntityTableKey AssociationTable AssociationTableK ey IsAssociationTrans lated TranslationTable TranslationTableK ey AuditDate UserName

System.Byte TinyInt NOT NULL System.String VarChar(50) NOT NULL System.Int32 Int NOT NULL System.String VarChar(50) System.Int32 Int System.Boole Bit an System.String VarChar(50) System.Int32 Int System.DateT DateTime NOT ime NULL System.String VarChar(50) NOT NULL

FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE

Relationships
Table name AuditRecordFields ThisKey AuditRecordId OtherKey Id Reference AuditRecord


UNCTAD - eRegulations team Page 45

2.7. LABEL TRANSLATION


The eRegulation Admin Interface & Public Interface static texts are fully managed by the eRegulations system . All the titles, all the messages, all the labels are updatable through the "Country parameters -> System translation" page. The texts are stored in sequential files organized in a tabular manner: labelId | labelTranslationInLang1 | labelTranslationInLang1 | ... The texts are organized in several files following a logical separation of contextual ussage. The totality of files gives as the translation dictionary used by the system. One system works with two dictionnaries: Local and Central. A central dictionary can be used by several admin systems installed on the same server. When looking up a certain label the system will look first if the translationModule (file) exists in the local dictionary and if the module contains a local translation of that label. If found the system will return that translation. If the translation is not found in the local dictionary the system will look it up in the central repository and it will return the translation found. The call for the translation of a label is:
GetMultilangValue("labelKey", "default translation text", "translationModule")


UNCTAD - eRegulations team Page 46

3. TRANSLATOR WEB APPLICATION


The eRegulations Translator Web Application is accessible at the same location as the Admin Web Application and behaves like a special sub-module that is activated only if the authenticated user has the "Admin- Regulation-Translator" role. The interface is completely different from the Admin Web Application and it is built to serve to a authorized translator to update the datra of the eRegulation content in a secondary language. Here below the categories of eReegulation content that can be translated through this interface: objectives blocks steps recourses generic requirements laws entities in charge units in charge persons in charge menus

The translator interface access a replica version of the content that is recorded in special tables after an explicit action from the admin interface. The explicit action is "Send to translator". The idea behind this specialized interface is to create a decoupled working space to external users of the system. Their work will not directly affect the eRegulation content. The translator can work in a parallel space and only when their work is fully completed they can commit the translation at which time the data is copied back into the " _i18n" tables in the admin space. The administrator can then validate (publish) the translation or can directly make some final corrections. When the administrator is sending an element to translator the system makes a full copy of that object and also its current translation data, it serializes it into XML format ans saves that data in specialized tables : "XMLSerializedItem" and "XMLSerializedItem_i18n". It is worth mentioning an important rule that was introduces as a need of assuring a better organization of work: translator can work on one element only at one particular moment in time. The system implements this rule by demanding the explicit actions from the translator for : - start working on element - stop working on element In order to take into account the time implications of the translation activity the system records the version of the data in the original language and also a version of the translation: - the version of the original data is incremented each time the administrator "re-demands" a translation after a previous translation has been commited or it has the status "working in progress". - the version translation is incremented with each commit The translation can be in one status at one time: inexitent work in progress already commited ( a first commit exists) not commited (never commited) Page 47

UNCTAD - eRegulations team

3.1. APPLICATION ARCHITECTURE


The architecture of the Translator Web Application follows a 3-tiers design : Data, Business, Presentation. You can have a look at the diagram here 2.1. Application architecture. The architecture follows the same Model View Presenter pattern and define the views as interfaces gaining in flexibility of implementing the view interfaces as ASPX pages or as customized views for Ajax requests. The update of translation follows the same sequence described in the previous chapters. (see 2.4. code execution flow) The challange of this application was to isolate the working of the translator from the main repository. Keep the admin data to fuel the public and the snapshot tables and also have a version of the data that the translator can focus on. Also all the eRegulations applications must share the domain model. We illustrate in the static diagram below translation contracts used for this module

UNCTAD - eRegulations team

Page 48

For assuring the independent working space we used the idea of storing a serialized version of the model and reconstruct it for the translator application only. The translator admin application is working with only 4 tables: XMLSerializedItem XMLSerializedItem_i18n Workspace ProcedureContext

We used the same principle of interface segregation for assuring a shared contract for all the models that will force the consistency of implementation across all the models that must be translated. One key concept was the need of keeping track of the property accessors that are capable of having translated data.

3.2. PRESENTER LOGIC - CODE FLOW


We will explain the logic inside the presenter for loading the page inside the translator space 1. The presenter method "InitView" is called with the parameter Id (parameter that refers to the id of the object inside the translator space) 2. A new instance of the XMLSerialializedItemBO (BusinessObjectAPI) is called 3. the businessObject API loads the XMLSerializedItem from the dabase using the correspondent IRepository instance (in our case LinqXMLSerializedItemRepository) 4. verifies the status of the current user Workspace (if the item is activ, the ask teh view to set that flag, or show a message). If another object is activ in the current user Workspace retrieve the name of that element and trigger an "ItemLocked" event passing the activ element in evenArguments 5. verify if a newer version of the same element exists and trigger an OnNewVersionReleased event if found 6. deserialize the XMLData and XMLTranslationData into Model object 7. if the original data has a new version (step 5 resulted in true) the display for the current modification the number of words added / deleted in rapport to the current version. ask the view tp display the data of latest version Note: The client side code is capable of passing a "diff" algorithm to all the fields in case there were changes in the original data

UNCTAD - eRegulations team

Page 49

3.3. DATA STRUCTURE


Table name Workspace Workspace Workspace Workspace Workspace XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n ProcedureCont ext

Model Workspace Workspace Workspace Workspace Workspace XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n XMLSerializedIt em_i18n ProcedureCont ext

Column Id Username XMLSerializedIte m_Id XMLSerializedIte m_Name StartDate Id ObjectType ObjectId ObjectVersion Data WordsDeleted WordsAdded CreatedDate CreatedUser Id XMLSerializedIte m_Id Lang TranslationVersi on Data ModifiedDate ModifiedUser CommitDate Id

Type System.Int32 System.String System.Int32 System.String System.DateTim e System.Int32 System.String System.Int32 System.Int32 System.Xml.Linq. XElement System.Int32 System.Int32 System.DateTim e System.String System.Int32 System.Int32 System.String System.Int32 System.Xml.Linq. XElement System.DateTim e System.String System.DateTim e System.Int32

DbType Int NOT NULL IDENTITY NVarChar(50) Int NOT NULL NVarChar(1000) DateTime Int NOT NULL IDENTITY NVarChar(300) NOT NULL Int NOT NULL Int NOT NULL Xml NOT NULL Int Int DateTime NOT NULL NVarChar(50) NOT NULL Int NOT NULL IDENTITY Int NOT NULL Char(2) NOT NULL Int NOT NULL Xml DateTime NVarChar(50) DateTime Int NOT NULL IDENTITY

Null able FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE

UNCTAD - eRegulations team

Page 50

ProcedureCont ext ProcedureCont ext ProcedureCont ext ProcedureCont ext


ProcedureCont ext ProcedureCont ext ProcedureCont ext ProcedureCont ext

ProcedureId

System.Int32

Int NOT NULL NVarChar(300) NOT NULL NVarChar(300) NOT NULL Int NOT NULL

FALSE FALSE FALSE FALSE

ProcedureName System.String ObjectType ObjectId System.String System.Int32

Relationships

Table name Workspace XMLSerializedItem_i18n


ThisKey XMLSerializedItem_Id XMLSerializedItem_Id

OtherKey Id Id

Reference XMLSerializedItem XMLSerializedItem

UNCTAD - eRegulations team

Page 51

4. PUBLIC WEB APPLICATION


The eRegulations Public Web Application is responsible for displaying the published version of eRegulations content. The information structure can be divided in the following categories of pages: home page about us page repositories pages : entities in charge, laws, generic requirements procedures: summary of procedure, details of step within a procedure feedback pages

For authorized user the public system will display additional information: consistency review tickets and statuses statistical report of the system

The eRegulations Public web application is built on top of the ASP.Net MVC framework. For responding to ajax calls the system uses the Asp.Net Web API framework.

UNCTAD - eRegulations team

Page 52

4.1. APPLICATION ARCHITECTURE


The architecture of the Admin Web Application follows a 3-tiers design : Data, Business, Presentation. The Presentation implements a Model-View-Controller design pattern.

UNCTAD - eRegulations team Page 53

The business layer is occupied by the reusable business library described in the Admin Web Application chapter. As earlier written the public version of one procedure is retrieved from the snapshot tables. For this we added a new BusinessObjectAPI called the SnapshotBuilder that has the main responsability of loading into the domain model the data from snapshot tables. It also uses a IRepository instance to access the data layer. The controllers used for displaying the data of Repositories and Consistency Tickets use the basic BusinessObjectAPI for those models.

4.2. CONSISTENCY REVIEW - DATA STRUCTURE


Table name

Model

Column

Type System.Int32

DbType

consistency_status Consistency_Status id

Int NO T NULL IDENTITY consistency_status Consistency_Status systemId System.Int32 Int NOT NULL consistency_status Consistency_Status pagename System.String NVarChar(30) consistency_status Consistency_Status menuid System.Int32 Int consistency_status Consistency_Status objectiveId System.Int32 Int consistency_status Consistency_Status stepId System.Int32 Int consistency_status Consistency_Status status System.Int32 Int consistency_status Consistency_Status version System.Int32 Int consistency_status Consistency_Status cycle System.Int32 Int consistency_status Consistency_Status content System.String NVarChar(1000) consistency_status Consistency_Status dateCreate System.DateT SmallDateTime d ime consistency_status Consistency_Status creatorId System.Int32 Int consistency_status Consistency_Status isLast System.Int32 Int consistency_status Consistency_Status oldid System.Int32 Int consistency_ticket Consistency_Ticket id System.Int32 Int NOT NULL s IDENTITY consistency_ticket Consistency_Ticket systemId System.Int32 Int NOT NULL s consistency_ticket Consistency_Ticket objectiveId System.Int32 Int s consistency_ticket Consistency_Ticket stepId System.Int32 Int s consistency_ticket Consistency_Ticket stepGuid System.Guid UniqueIdentifier s consistency_ticket Consistency_Ticket section System.String NVarChar(50) s consistency_ticket Consistency_Ticket objectId System.Int32 Int s consistency_ticket Consistency_Ticket priority System.Int32 Int s consistency_ticket Consistency_Ticket status System.Int32 Int s consistency_ticket Consistency_Ticket content System.String NVarChar(1000)
UNCTAD - eRegulations team

Null able FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
Page 54

s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_ticket s consistency_com ments consistency_com ments consistency_com ments consistency_com ments consistency_com ments consistency_com ments consistency_com ments consistency_com ments

Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Ticket Consistency_Comm ent Consistency_Comm ent Consistency_Comm ent Consistency_Comm ent Consistency_Comm ent Consistency_Comm ent Consistency_Comm ent Consistency_Comm ent

dateCreate d creatorId lastModifie d modifierId comments Counter commentL astStatus SEID responsibl eId pagename menuid oldid id ticketId dateCreate d userId comment status SEID oldid

System.DateT ime System.Int32 System.DateT ime System.Int32 System.Int32 System.Int32

SmallDateTime Int SmallDateTime Int Int Int

TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

System.String NVarChar(40) System.Int32 Int

System.String NVarChar(30) System.Int32 System.Int32 System.Int32 System.Int32 System.DateT ime System.Int32 Int Int Int NOT NULL IDENTITY Int SmallDateTime Int

System.String NVarChar(1000) System.Int32 Int

System.String NVarChar(40) System.Int32 Int

UNCTAD - eRegulations team

Page 55

5. DATA API SERVER


The eRegulations API Server is developed in Node.Js and the data is stored in MongoDb (nosql database). The admin is responsabile for publishing through the eRegulations HttpWebServices Publisher all the information once it is being published. The API Server receives the data through http web services and updates its replica of data in the MongoDb database. All the POST/PUT/DELETE request must contain a correct authorization header in order to be treated by the API Server The API Server responds to all the GET requests. Please see the code and documentation of the API Server here: https://github.com/egovernment/eRegulations-api UNCTAD - eRegulations team Page 56

6. CRALERTS CLI
The Consistency Review Command Line Interface (CRAlerts CLI) is a console executable program that queries the eRegulations content, computes a series of statistical data related to the status of steps and send an email to all the consultant users of the system. The program is intended to be executed on a regular basis by setting a weekely (or more frequent) task in the stask scheduler.

6.1. APPLICATION ARCHITECTURE


UNCTAD - eRegulations team Page 57

The CRAlerts BusinessObject API uses 4 data aggregators : GeneralReviewAggregator GeneralStatusAggregator ProcedureStatusAggregator StepStatusAggregator

All the data aggregators implement the interface IDataAggegator that has only one method:
void CalculateStatistics(ConsultantUser user, IList<StructuredProcedure> data,ref Dictionar y<string, object> DataBag);

The systems uses the Mustache template engine for building the html body of all the emails.

6.2. CONFIG FILE


The CRAlert CLI program uses a config file to retrieve a list of eRegulations systems for which the job must be executed. The config file, usually named "systems.xml" it must be written in the XML format and should have the with the following structure: <?xml version="1.0" encoding="utf-8" ?> <systems> <system> <Id>__sytemId__</Id> <Name>__Title__</Name> <Url>__sytemERegulationsURL__</Url> <ConnectionString>__sytemSQLConnectionString__</ConnectionString> <LeftLogoUrl>__sytemLeftLogoImageUrl__</LeftLogoUrl> <RightLogoUrl>__sytemRightLogoImageUrl__</RightLogoUrl> <Lang>__sytemMainLanguage__</Lang> <PublicSiteVersion>__sytemPublicVersion__</PublicSiteVersion> </system> </systems> where: Id: the system Id (all the eRegulations systems are registered in a table SystemInstance) Name: the title of eRegulations system Url: the url where the eRegulations system is located ConnectionSring: a valid sql connection string used to connect to the DB where eRegulations data is sored LeftLogoUrl: the url of the image used as left logo in the home page RightLogoUrl: the url of the image used as right logo in the home page PublicSiteVersion: the value establishing the version of the publis site. As for future reference to connect the URL Construction Paradigm for the hyperlinks referencing eRegulations public site pages

UNCTAD - eRegulations team

Page 58

7. STATISTICS CLI
The Statistics Review Command Line Interface (CRAlerts CLI) is a console executable program that queries the eRegulations content, computes a series of statistical data related to eRegulations content. The program is intended to be executed daily from tuesday (early hours) until saturday (early hours) by setting a task in the stask scheduler. It calculates all the indicators and stores them in the database flagging them with the date of the previous calendaristical day.

7.1. APPLICATION ARCHITECTURE


UNCTAD - eRegulations team Page 59

The Statistics BusinessObject API stores data calculated for the followind indicators: All the indicators implement the interface IIndicatorSet that has only one method:
public void SaveStatistics(List<StructuredProcedure> data, SystemInfo system, ERegAppContex t ctt);

Total Number of published procedures Total number of procedures Total number of certified procedures Total number of published steps Total number of entities in charge Total number of units in charge Total number of persons in charge Total number of laws Total number of generic requirements Total number of results of steps Total number of feedbacks

7.2. CONFIG FILE


The Statistics program uses a similar config file like CRAlerts CLI in order to retrieve a list of eRegulations systems for which the job must be executed. See: 6.2. Config file

7.3. DATA STRUCTURE


Name2 Name3 StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet

Name4 Id SystemId CreatedDate Type Value OptionalField1 OptionalValue1 OptionalField2 OptionalValue2 OptionalField3 OptionalValue3 OptionalField4 OptionalValue4 OptionalField5 OptionalValue5 SystemImageD ate

Type System.Int32 System.Int32 System.DateTim e System.String System.Decimal System.String System.String System.String System.String System.String System.String System.String System.String System.String System.String System.DateTim e

DbType Int NOT NULL IDENTITY Int NOT NULL DateTime NOT NULL NVarChar(200) Decimal(19,4) NVarChar(200) NVarChar(200) NVarChar(200) NVarChar(200) NVarChar(200) NVarChar(200) NVarChar(200) NVarChar(200) NVarChar(200) NVarChar(200) DateTime NOT NULL

Null able FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE

StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet StatisticSet

UNCTAD - eRegulations team

Page 60

Das könnte Ihnen auch gefallen