Showing posts with label Website. Show all posts
Showing posts with label Website. Show all posts

Thursday, July 16, 2009

ProTrans.com Google Analytics...

If anyone is interested in getting a visual of the traffic that comes into ProTrans.com, you can by using Google Analytics.
Here you can find some interesting information about who is visiting our site, like where they are from, how long they are staying, which pages are they visiting the most, which browser they are using (IE 6 still has a 47% share, which is ridiculous :-( ), etc.
To login into it, simply go to Google.com/Analytics and login with the developer test e-mail account ProTransDev@gmail.com, and I don't want to send the password via a blog, but most of you know it already.

Monday, February 2, 2009

New Schedule System for Service Scheduler

The service scheduler has been moved over to the new scheduling system. It is now easier to enter information and you have much more flexibility in the schedules that you create.

NOTE: Since the scheduling system is different from the old one, you will need to log in to development and update the schedules for your services. You will need to get latest on the solution before doing this. Andrew can then automatically move your schedules to production.

From the "Service Manager" page in the website, double-click any row to edit its schedule:



You can enter many different schedules, just hit ENTER between schedules so that they are each on their own line. Here are some of the formats that it accepts:
  • Monday at 4:00am
  • Monday, Tuesday, and Saturday at 8:06pm
  • Weekends at 5:00pm
  • Weekdays at 5:00pm
  • Every 30 minutes
  • Every hour
  • Monday and Tuesday on the first and third week of the month at 8:00am
  • 8:00am on the 22nd of the month


When you hit 'Submit', the grid will refresh and the schedules for your service will be displayed.

Tuesday, January 27, 2009

Shipment Selector Control - Date Ranges

Here are the supported ways to enter a date range (currently any date range entered will search shipments by ship date):
  • 1/1/2009 – 1/10/2009
  • 1/1/2009 to 1/10/2009
  • 1/1/2009
  • January 1st, 2009 to February 15th, 2009
  • January 2009 to February 2009
  • January to February
  • Jan 2008
  • Jan 2008 to Sep. 2009
  • January 15th to February 26th
  • January
  • Yesterday
  • Today
  • Last X days
  • Last X weeks
  • Last X months
  • Last X years
  • This week
  • Last week

Monday, January 26, 2009

ProTransPanel

In a continued effort to make the website easy to develop...introducing the ProTransPanel web control. Add it to your page and enjoy these savings:
  • No need to modify CSS to match the layout of your page
  • No need to create a submit button
  • Simplified layout — overall just less code to write.

Here's an example of this control in action:


Add this line to the top of your page to register the control:
<%@ Register Assembly="ProTrans.Enterprise.Controllers" Namespace="ProTrans.Enterprise.UIs" TagPrefix="protrans" %>


Then for each section of your page that requires user input, wrap your controls in a ProTransPanel control like so:
<protrans:ProTransPanel ID="panSearch" runat="server" Title="Enter a zip code (or address) to find:" 
        LabelWidth="80" SubmitButtonWidth="100" SubmitButtonText="Search">
        
        <asp:Label ID="Label5" AssociatedControlID="txtSearch" runat="server" Text="Zip Code:"></asp:Label>
        <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label6" AssociatedControlID="ddCountry" runat="server" Text="Country:"></asp:Label>
        <asp:DropDownList ID="ddCountry" runat="server">
            <asp:ListItem Text="US" Value="US"></asp:ListItem>
            <asp:ListItem Text="Canada" Value="CA"></asp:ListItem>
            <asp:ListItem Text="Mexico" Value="MX"></asp:ListItem>
        </asp:DropDownList>
</protrans:ProTransPanel>


On the code-behind of your page, you can wire in the postback event of the submit button like so:
    Protected Sub panAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles panAdd.SubmitClick
        Try
            '' TODO: 
        Catch ex As Exception
            HandleException(ex)
        End Try
    End Sub


Here are the important properties you can set on a ProTransPanel:
  • Title – The title of the section on the page (or leave it blank)
  • SubmitButtonText – The text to display on the submit button (or leave it blank)
  • LabelWidth – The width of labels on your page in pixels (should correspond to the label with the longest text)
  • SubmitButtonWidth – The width of the submit button in pixels (should correspond to the amount of text displayed on the button)
  • EnableSubmitButton – Set this to false if you do not need a submit button.

Thursday, January 8, 2009

URL Authentication

ProTransWeb has a security mechanism that requires a user to log in to view certain pages within the application. While this is obviously an important and needed feature, sometimes it is a barrier that prevents efficient cooperation between other applications and the website. For instance, we have a new page, "Shipment Charges", that we would like to open when a certain button in ProTrack is clicked.

Enter URL Authentication. The Authenticate.aspx page in ProTransWeb accepts information from the URL after the "?" character (the part of the URL referred to as the querystring) and tries to authenticate the user based on that information. The power to create this authenticated URLs has been bundled in a service named CreateAuthenticatedQuerystring (which I will describe how to use in just a second).

By forming a URL carefully, we can accomplish the following things:
  • Create a URL that cannot be spoofed by anyone who doesn't know the 'secret key'.
  • Log a user in without requiring them to go through the login form.
  • Provides a way to perform impersonation of a user without knowing their password.
  • Take the user to a particular, protected page.
  • Ensure that this powerful URL only works for a limited time (defaulting to 15 minutes).
How to Use CreateAuthenticatedQuerystring

You must pass the parameters "URL" and "Username" to this service to create a proper authenticated URL.
  • URL — should be the page that you want to take the user to (this can be a full URL that includes http://, or a relative URL from the "Enterprise" directory of ProTransWeb).
  • Username — should be the user that will be logged in. This must match a user in the system, otherwise the user will be directed to the login page.
The service will return a single value back to you: "Querystring". This value must be added to the URL to the "Authenticate.aspx" resource (currently residing at http://[BASE URL]/Public/Authenticate.aspx).

Here is some sample code for creating a URL:
'' How to generate a valid querystring:
nvpRequest.Add("Url", "Brokerage/BrokerageVerification.aspx")
nvpRequest.Add("Username", "someusername")
nvpResponse = appContext.Service("CreateAuthenticatedQuerystring").SendReceive(nvpRequest)
Response.Write("http://localhost/ProTransWeb/Public/Authenticate.aspx" + nvpResponse("Querystring"))

Wednesday, January 7, 2009

Shipment Selector Control

There's a new way to add 'select-a-shipment' functionality to your pages. Simply add the ShipmentSelector.ascx control to your page and users will be presented with a consistent, and powerful way to find shipments.

Sort of like Google, users can enter any search criteria they want and the ShipmentSelector control will do its best to find what they were looking for. Currently you can enter either: a track number, a bill-of-lading number, an invoice number, or an ASN ID. If there were multiple matches, the control presents the user with a chance to refine their search.

The control defaults to requiring the user to pick only one shipment (if multiple are found, the user is presented with a grid to select the one they were really looking for). However, you can override this functionality to accept a list of shipments by setting RequireSingleShipment = false on the control's properties. Have your page listen to the ShipmentsSearched event to be able to react to the user's search.

Also similar to a Google search, there are advanced keywords you can place in your query to restrict the search. For instance, starting your search with "BOL:" signals that you only want to search for bill-of-lading numbers.

Wednesday, December 10, 2008

Page Messages

The web architecture now has a unified way of handling errors and displaying messages to the user. This is critical in providing a consistent manner in the way in which we communicate important events to a user. When is this portion of the architecture important?:
  • When our code malfunctions and the user needs to know that something went wrong.
  • When the information the user submits is not in a valid format.
  • When the user successfully accomplishes some task and needs confirmation that everything went okay.
  • When the controller/entity layer decides that the user needs to be warned once before taking certain actions (creating a new shipment where the data looks a bit questionable).


Anytime you need to display something to a user, simply call ShowMessage from within your ASPX page and all of the particular details are taken care of for you. You'll be able to specify whether this message is an error, a warning, or just an informative message.

Secondly, from this point forward, all top-level events must have Try..Catch..End Try statements. Any exception caught should be sent to the HandleException method where the user will be displayed a notice that an error has occurred, and the error will get logged to our database. What is a "top-level event"? Any event that is the direct cause of the user submitting data or built-in wired events in the ASP.NET page lifecycle. (example: Page_Load, cmdSave_Click, etc.).

Exceptions

The only times you should not use ShowMessage for displaying messages to a user are:
  • When you are working with a modal dialog that is built around the Telerik ToolTip control. The reason here is because the message will not look as if it came from the modal dialog; it will be buried under the dialog's shadow.
  • When your message(s) must be displayed right next to other user interface controls for some reason. This is rare -- one case that matches this scenario is the current logon control area.

Tuesday, December 2, 2008

Code Organization Part 1 (Folder Structure)

To create quality software many things have to be taken into consideration outside of the algorithms within the source code. One of the most important aspects of quality software development is organization. This series of posts will deal with the main organizational concepts within the ProTrans software world, including but not limited to the web folder structure, the solution and project structures, and even the naming conventions used. If everyone assists in keeping the software-related objects organized it will increase the efficiency in which we code, as well as improve on the readability and therefore maintenance costs associated with development.
First, we will discuss the ProTrans website folder structure. Before I get into the structure too deep, I should mention that a few decisions were made prior to coming up with this folder structure.
The decision to place all of our web applications (for the time-being) into one project was a conscience decision based on the fact that the negative aspects of if we start splitting them up, the management of the configuration files as well as the increased difficulty that comes with deployment out-weighed the benefits. You might have noticed that previously developed web applications such as AccountingReports and OperationReports, are no longer being used, and the web pages inside of these projects have been migrated inside of the ProTransWeb project. There are some costs associated with this decision, such as not having the ability to segregate the web applications on the server into separate application pools, we are opening ourselves up to the ProTransWeb dll growing to be too large. These costs are manageable and can be dealt with later, but in order to get us moving in a positive direction without the added complexity of dealing with multiple projects and solutions, we decided to group all web apps into ProTransWeb.
Now onto the folder structure itself. There is not much to discuss here, other than show the skeleton that we have (which can be downloaded at http://indypro2/PTDev/Shared%20Documents/Enterprise/Architecture/Coding%20Standards/ProTransWeb%20-%20FileSystemStructure.doc). The main points are that there are three levels of presentation pages...public, customer-based, and internal. This is going to help in how we secure our site as well (which I'll discuss in a later post), because our security model is folder based (meaning that there is no security on stuff inside of public, you have to be signed in to get to stuff inside of customer-based, and you have to be signed in and a member of an internal role to be authorized to view a page within the internal node of pages). Inside of the internal folder there are all of the business unit folders. Inside of these business unit folders you should try and group certain multi-page projects, and put reports in the reports folder, etc. When thinking of were to place projects and pages, just think of what is the most simple and intuitive place to put it, and discuss it with your co-developers a little. There are also other system folders to hold things like UserControls, Masterpages, scripts, etc.
If you have any questions about the folder structure or you have a better idea of how to organize it, please let me know.
Thanks