Welcome Guest, you are in: Login

FDOT Wiki

RSS RSS

Navigation (EnterpriseLibrary)



Search the wiki
»

Client Facades

RSS
Modified on Wednesday, 06 March 2013 11:00 AM by 156.75.200.109 Categorized as Uncategorized

While the FEL 4 is intended primarily as a service implementation, a set of client facades are available as a separate package for offline development. The facade pack includes facades for the ConnectionString, DotCode, OrgCode, and Staff services with data extracts included in the package to serve as a local data store. To use the facade pack, first add it to your project from NuGet by opening the FDOT NuGet Repository, selecting Fdot.Enterprise.Facades, and clicking "Install". Note that adding the facades to your project also adds the client contracts for the ConnectionString, DotCode, OrgCode, and Staff services along with the core assembly.

Image

Local data

Installing the facades package will also add a LocalData folder to your project, which contains the local data extracts for each of the services in JSON format. Those can be modified as necessary to mock data. For example, a new DoT code collection can be added by creating a new file containing a JSON array of objects conforming to the IDotCode interface, or appending the new values to an existing array.

Application configuration settings

Local data will only be used if valid path settings are specified in the application configuration file. Either a directory or specific file path can be provided for most services; however, care must be taken with the staff data since it requires three different types of data files (staff members, delegates, and delegate connectors). If a file path is provided, then data for a given service will only be loaded from that file. If the path is a directory, then all files in that path will be loaded. For that reason, the staff data either needs to be split across different directories, or each type of data contained in a single file - all data residing at the target path must be of the same type.

Examples


    <add key="ConnectionStringFacade.LocalDataPath" value="..\..\localdata\connections\connections.json" />
    <add key="DotCodeFacade.LocalDataPath" value="..\..\localdata\dotcodes" />
    <add key="OrgCodeFacade.LocalDataPath" value="..\..\localdata\orgcodes" />
    <add key="StaffFacade.LocalDataPath" value="..\..\localdata\staff\all-staff.json" />
    <add key="StaffFacade.LocalDataPath.Delegates" value="..\..\localdata\staff\delegates.json" />
    <add key="StaffFacade.LocalDataPath.DelegateConnectors" value="..\..\localdata\staff\delegate-connectors.json" />

The majority of the service methods are read only; however the staff service also supports delegate management. This can be emulated with local data by adding the following key and setting its value to true, allowing delegate updates to be persisted to local data. Note that because the data is stored as a file, multiple developer environments using shared local data should exercise care when enabling local data persistence to avoid file contention issues. To help mitigate this concern, the local data is read and loaded into memory at the application's start and persisted immediately at the time of the update. For reference, the delegate and delegate connector data sources are updated during delegate management.

    <add key="StaffFacade.DoPersistLocalUpdates" value="false" />

When developing internally, or with via VPN, it may not be obvious whether local data was configured properly and is being used, or whether the services are being called. By default, the facades will look for local data on the configured paths and, on failing to either find or load it, will switch over to use available services. That process begins with a check against the discovery proxies, whose responsibility it is to return the endpoints for services honoring a given contract. Should the discovery calls fail, or if the discovery proxies fail to return any endpoints, the host address and an endpoint address pattern are used to try a service by convention. Adding the following values will prevent the facades from being able to successfully call a service. An exception will be thrown on the attempt to connect, which will provide clear indication that local data was not loaded correctly.

    <add key="DiscoveryProxies" value="" />
    <add key="HostAddress" value="" />

IConnectionString

Example

[
   {"Key":"FEL_SAMPLE_U", "Value":"DATA SOURCE=D9UT24;USER ID=SOMEUSER;PASSWORD=p@$$w0rd"}
]

Property constraints

PropertyTypeMax
ColumnNamestring18
ColumnDescriptionstring18
Valuestring8
Descriptionstring30



IDotCode

Example

[
   {"ColumnName":"MYNEWCODES","ColumnDescription":"MYNEWCODES","Value":"CODE1","Description":"Code Value 1"}, 
   {"ColumnName":"MYNEWCODES","ColumnDescription":"MYNEWCODES","Value":"CODE2","Description":"Code Value 2"}
]

Property constraints

PropertyTypeMax
ColumnNamestring18
ColumnDescriptionstring18
Valuestring8
Descriptionstring30

IOrgCode

Example

[
   {
     "Description":"TURNPIKE INFORMATION TECH OFC",
     "ShortTitle":"TPK IT",
     "Status":"ACTIVE",
     "StatusChangeDate":"\/Date(991713600000)\/",
     "District":"08",
     "CostCenter":"018",
     "Level1":"55",
     "Level2":"08",
     "Level3":"30",
     "Level4":"00",
     "Level5":"018",
     "FullOrgCode":"55083000018"
   }
]

Property constraints

PropertyTypeMaxNotes
Descriptionstring60
ShortTitlestring10
Statusstring12
StatusChangeDateDate4
Districtstring2same as Level2
CostCenterstring3same as Level5
Level1string2
Level2string2same as District
Level3string2
Level4string2
Level5string3same as CostCenter
FullOrgCodestring11concatenation of Level1 + Level2 + Level3 + Level4 + Level5

IStaffMember

Example

[{
   "PrimaryId":1,
   "ExternalIds":[1],
   "Active":true,
   "ActualSupervisorPosition":null,
   "StatusTimestamp":"\/Date(1228906826000)\/",
   "FirstName":"TEST",
   "LastName":"USER",
   "MiddleName":"Q",
   "BeginDate":{"Value":"\/Date(589176000000)\/"},
   "EndDate":null,
   "StaffType":
      {
         "ColumnName":null,
         "ColumnDescription":null,
         "Value":"CONSULTN",
         "Description":"CONSULTANT STAFF"
      },
   "District":"99",
   "RacfId":"MCLKCTU",
   "PeopleFirstId":"00199999",
   "ConsultantId":null,
   "Position":"",
   "EmailAddress":"",
   "Signature":"",
   "Phone":"3865551212",
   "PhoneExtension":"",
   "Fax":"3865551212",
   "Building":"MC LAKE CITY FIELD OFFICE",
   "Office":"",
   "Room":"",
   "MailStation":"99",
   "LastUpdateUserId":"SRSLOAD",
   "LastUpdateTimestamp":"\/Date(1329306916000)\/",
   "PositionWorkTitle":"OFFICER - MOTOR CARRIER",
   "OrganizationalCode":
      {
         "Description":"MOTOR CARRIER SIZE \u0026 WEIGHT",
         "ShortTitle":"MOTOR CARR",
		 "Status":"ACTIVE",
         "StatusChangeDate":"\/Date(1326085200000)\/",
         "District":"65",
         "CostCenter":"995",
         "ManagerPosition":null,
         "Level1":"55",
         "Level2":"65",
         "Level3":"40",
         "Level4":"00",
         "Level5":"995",
         "FullOrgCode":"55654000995"
      },
   "ClsfFamily":"",
   "ClsfGroup":"",
   "ClsfOccupation":"",
   "StaffTypeEnum":4,
   "ExtensionData":{}
}]

Property constraints

PropertyTypeMax
PrimaryIdintn/a
ExternalIdsint arrayn/a
Activebooln/a
ActualSupervisorPositionstring6
StatusTimestampdaten/a
FirstNamestring25
LastNamestring30
MiddleNamestring25
BeginDatedaten/a
EndDatedaten/a
StaffType IDotCoden/a
Districtstring2
RacfIdstring8
PeopleFirstIdstring10
ConsultantIdstring9
Positionstring2
EmailAddressstring230
Signaturestring200
Phonestring10
PhoneExtensionstring5
Faxstring10
Buildingstring30
Officestring80
Roomstring10
MailStationstring10
LastUpdateUserIdstring8
LastUpdateTimestampdaten/a
PositionWorkTitlestring80
OrganizationalCodeIOrgCoden/a
ClsfFamilystring50
ClsfGroupstring50
ClsfOccupationstring68
StaffTypeEnumn/an/a
ExtensionDatan/an/a

IDelegate

Example

[{
   "Application":"EPS",
   "LastUpdateTimestamp":"\/Date(1265052761768)\/",
   "LastUpdateUserId":"SRS_EBO",
   "StaffFromId":2,
   "StaffToId":2365,
   "StatusCode":"A"
}]

Property constraints

PropertyTypeMax
Applicationstring8
LastUpdateTimestampdaten/a
LastUpdateUserIdstring8
StaffFromIdintn/a
StaffToIdintn/a
StatusCodestring1
  Name Size
- nuget_fel4_facades.jpg 173.66 KB

ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.