Home > Articles > Mobile Application Development & Programming > HTML5 & Web Standards

MyInformIT: It's All About Me, Me, Me

  • Print
  • + Share This
Though he's opposed to selfishness in general, the Kaptain works hard to let InformIT users customize their InformIT experience.
Like this article? We recommend

Like this article? We recommend

Selfishness! It's taking over the U.S. these days, it seems to me. Driving around Indianapolis, for example, has become one big thrill ride. Everywhere I look, someone is running a stop sign or stomping on the gas to make it through a traffic signal that isn't even remotely yellow any more. And the offending motorist who risks everyone's lives to shave three minutes from the drive time, more often than not, also has a cell phone glued to one ear. Granted, this is Indianapolis, but the local roadways aren't quite the equivalent of the Indianapolis 500, the Brickyard 400, or even the U.S. Grand Prix course.

It isn't just driving, either. People cut in front of me in line at the grocery store. And don't think I can't tell when people I'm speaking with aren't really listening—just waiting for me to finish talking so that they can chatter.

Selfishness!

You can find plenty of selfishness around work, too. If someone moves on to another job, that ex-employee isn't out the door five minutes before the feeding frenzy starts around his or her cube or office. People grab the chair, the office supplies, the phone, the computer—pretty much whatever isn't glued down. A school of piranhas should be this ferocious.

Web site creation is a natural hotbed of egocentricity, too. Any new page template that comes up on the schedule at InformIT is created by one of our three designers. They're all very skilled, and duly proud of their work. Heaven forbid that one of us lowly developers should suggest a minor change because we feel it adds logic into the mix. The argument "it makes more sense this way" doesn't seem to carry much weight when it involves resizing a table or shifting something around. It's tough being a logical guy around those of more artistic temperament. (Naturally, I let them know exactly what I think when they suggest a code change—but that's different!)

As the old saw goes, if you can't beat 'em, join 'em. We at InformIT can indulge in our selfishness, and cater to yours, in the interest of knowledge. The result is the MyInformIT page. MyInformIT is where you, the user, can squirrel away any articles, books, and other shiny items that catch your eye. It's your own private drawer with a password as the key. I think that it's time to let you see how MyInformIT works from the inside.

Introducing MyInformIT

The MyInformIT page is most easily accessed by clicking the MyInformIT badge located under the InformIT logo at the upper-left corner of the page (see Figure 1). If you have already logged in and have a cookie, clicking this takes you right to the MyInformIT page. If not, you'll get a login page where you can enter your username and password, or create a new account if necessary. Once you've logged in, you go to the MyInformIT page. Figure 2 shows an example of mine.

Figure 1 The gateway to MyInformIT.

Figure 2 A typical MyInformIT page.

In the left column, you can see the content that I've saved: some articles, Free Library books, and other books. On the right are recommendations generated based on the profile that I entered. These are compiled by matching my entries on the personalization screen with the InformIT taxonomy. (Remember that? I discussed it in an earlier article.) Before we get to how the saved content and recommendations lists are built, let's examine how a piece of content is saved to MyInformIT in the first place.

On every article, book, or Free Library book page, there's a link called Save to MyInformIT. Figure 3 shows an example of an article written by my friend and fellow InformIT development drone, Sean Geiger. At the far right is the Save to MyInformIT link, with a cute little disk icon. By the way, because we can't keep our design team from tinkering, the screen shots I use might not look exactly like the site now—in fact, the design might have changed radically. Don't be alarmed!

Figure 3 Save me!

If you were to put your mouse over this link, you would see something like the following:

javascript:popAdd('/myinformit/addTo/index.asp? _
 session_id={337C3444-CB4D-44D9-968B-EF5F36BB6192} _
 &t={6373D50E-EF0B-4084-B8A7-032653E262E2} _
 &n={9163B40A-C60A-4FF6-9082-68895FA208D9} _
 &command=add _
 &product_id={988311BD-D419-43A5-9FA2-BD7FCB6F2E10}')

It's actually all one line. I've placed underscores at the locations of my intentional line breaks.

A JavaScript function, popAdd, is called. This simply executes a window.open function, and passes in the address enclosed in the single quotes (' '). From my previous articles, you'll recognize the n and t arguments, which identify the navigation ID and tab navigation ID, and thus the state of the page. In this case, they identify the state database/SQL Server. For now, we're more interested in the session_id and product_id arguments. The command = add argument should be evident enough.

The product_id, you'll recall, uniquely identifies the piece of content with which it's associated. (Hey, this is Sean's article!) The session_id specifies the other relevant quantum of information: Who wants to save it? The ASP that's called, /myinformit/addTo/index.asp, is very simple, and looks like this:

1  <%@ Language=VBScript %>
2  <!-- #include file="../../core/session.asp" -->
3  <!-- #include file="../../includes/objects/state.asp" -->
4  <!-- #include _
    file="../../includes/objects/dynamicInclude.asp" -->
5  <!-- #include _
    file="../../includes/objects/browseTopicBox.asp" -->
6  <!-- #include _
    file="../../includes/objects/templateFunctions.asp" -->
7  <!-- #include file="../../includes/buckets/buckets.asp" -->
8
9  <html>
10 <head>
11 <title>InformIT</title>
12 <link rel="stylesheet" _
     href="../../stylesheets/informit_content.css">
13 </head>
14
15 <script language="JavaScript">
16
17 //re-Add content that is already in MyInformIT
18 function reAdd() {
19
20  var pPage;
21
22  pPage = window.location.href + '&readd=yes';
23  window.close();
24
25  window.open(pPage,
    'popWin','resizable=no,scrollbars=no,
       width=550,height=148,toolbar=no');
26 }
27
28 </script>
29
30 <body bgcolor="#FFFFFFF" leftmargin="10"
    topmargin="10" marginwidth="10" marginheight="10">
31
32 <table width="100%" border="0" cellspacing="5"
    cellpadding="5">
33 <tr>
34 <td>
35 <% '***********************************************
36 ' Include MyInformIT content function response
37 '*********************************************** %>
38 <!--#include file="addTo.asp" -->
39 </td>
40 </tr>
41 </table>
42
43 </body>
44 </html>

I would have glossed over this file, as it's mainly a shell to include the file that does all the work, addTo.asp, but I wanted to highlight the JavaScript above on lines 16–29. If a user tries to add some content that he or she has previously saved, addTo.asp has to recognize this fact. The JavaScript above is critical to that purpose. File that away for later as we move on to addTo.asp.

  • + Share This
  • 🔖 Save To Your Account