I'm working on a project to syndicate library content with RSS.... and learn .NET, C#, and AJAX

Sunday, August 19, 2007

Back to Work!

This week was my first back at work. Needless to say, I didn't progress with ListMaker at all! But, I did get my PC fixed up to use the new Active Directory authentication. I had to update my SQL Server connections to use the new 'user' for both ListMaker and for my MS Access ODBC connections to our development server. At least I've got ListMaker working in the new environment. Hopefully I'll be able to snatch some hours to finish up in the coming weeks.

Wednesday, August 8, 2007

ListMaker Progress

Okay I did do

1. need to use the variables from the user table instead of the static variables I've been using
2. check persistence of the data about the current user.
3. finishing the ranking (this took forever!!)

The above could stand lots of checking. I still need to:

4. remove viewstate from controls that don't need it
5. clean up debugging spew

but before I do that, I discovered a funny error that I have to fix first -- users don't have their own items; all items are shared, so any one can delete any one else's stuff (!!!) I need to make a whole new table JMU_User_Items. Not sure how I overlooked that!! It's definitely an early mistake because it's not on the ER diagrams. I guess when you're just testing as one user, it's easy to overlook that!

I really want to re-implement that silly ATLAS accordion, too. The other wish-lists aren't as critical for show and tell.

Tuesday, August 7, 2007

Hiatus - Busch Gardens

Spent just over 24 hours on a quickie vacation to Busch Gardens with E & family. I went on the Big Bad Wolf, which is probably the tamest coaster in the park - but a big step for me. I think I'll try the Loch Ness Monster next time! However I'm not trying the Griffon and never would have enjoyed it.... didn't much care for Wild Thing which has an even longer-duration drop although *perhaps* not at 90 degrees - which would make me hate it worse!

Big Bad Wolf



Griffon


Wild Thing (at ValleyFair, MN) - I have ridden this coaster!

Sunday, August 5, 2007

To-do list

All right, here is what I see that I have left to do:

  1. need to use the variables from the user table instead of the static variables I've been using
  2. check persistence of the data about the current user.
  3. finishing the ranking
  4. remove viewstate from controls that don't need it

And here are some things I'd like to do:

  1. Improve XML comments and XSLT display
  2. re-implement the Ajax accordion for the long list.
  3. Add the ability to add one "subject" to the Create new account routine. Add a suggest of some sort that uses the subject. Or, just add a pull-down to the search to limit / search by subject.
  4. Get the LEO and PL searches working

And here are the things I don't think I'll have time to do after all, but would have done if I had a few more weeks:

  1. Ability to add multiple "subjects" to the Create new account routine. Adding multiple is much tricker because you have to be able to edit, delete individual ones AND merge any results in an intelligent way.
  2. Have those subjects pull in news, faq, etc.
  3. See others' lists / especially librarian-created lists.

Saturday, August 4, 2007

XSLT for ListMaker program comments

One of my ancillary goals, after discovering that Visual Studio can create XML documentation from code comments, was to create an XSLT stylesheet for the resulting XML. So far it's real basic, but at least I've got proof-of-concept! With only a few days left to my leave, I need to move quickly.


Hiatus

Took a break:


Does this field look unplayable to you? The players didn't agree, either:

The very nice Pittsburgh scoreboard. Too bad the series wasn't as nice.

Saturday, July 28, 2007

Map of controls, their panels, and their methods

I realize this is nigh illegible, but wanted to memorialize the document, which lists each control that calls methods and turns on/off panels, with separate rows for controls with conditionals. Last two pages are 'created' controls which don't appear in the initial asp. I'm not 100% sure it will help, but it can't hurt. If I can't attain one kind of persistence, this attests to another kind entirely! Dinnertime now.

Note: I did try to do this before beginning, but didn't know what needed to be in its own method. I think I could do it better from the beginning -- and would -- if I had to do it again, now that I have a bit more of an idea of the construction.

ListMaker Persistence

Earlier I mentioned that I had stuck a bunch of methods in Page_Load just to make things work, but that it didn't seem right, somehow. Also, throughout the code, I'm turning on and off panels to display the right controls.

I decided it was more elegant, albeit not ideal, to deal with all the panel manipulation and also the needed method calls on a per-control basis immediately in the Page_Load. Even if I had put all the controls into user controls, I'd still have to turn them on/off for different main control actions. NOTE: need to leave some of the panel manipulation in the control methods, for example, if it depends on the success of the operation. Might not hurt to map all controls and what should happen 1) always and 2) conditionals

Since some of my controls have auto-gen ids, such as img_btn_del, which might actually be img_btn_del1, img_btn_del2, etc., I got to use regular expressions, which is always a nice lift in the morning.

References


Friday, July 27, 2007

ListMaker Login, Logout, timeout

Today I implemented the Login, Logout, Create new account, and Timeout. Something's still not quite right about the Logout - although I am telling it to clear the session variable that says the user is logged in, it is not. But, it's thunderstorming here and I want to turn off the computer.

Next:

  1. need to add "subjects" to the Create new account routine.
  2. need to use the variables from the user table instead of the static variables I've been using - most methods will need to be updated.
  3. need to check persistence of the data about the current user.
References:

Amazon Web Services

So many awesome new technologies, so little time ...

Today I took a brief break to explore Amazon Web Services, a goldmine as far as libraries are concerned! I made my first REST request, for the item information about Cyteen, the book I'm currently reading (note: it is not about a cyborg teenager) . Basically it gets the amazon info you're used to, but in XML.

Thursday, July 26, 2007

ListMaker User Login: Begin

Today I cleaned up a lot of the debugging labels; fixed some problems I noticed.

(reloading appeared to be deleting extra items on My Lists, but actually, My Lists just wasn't refreshing until the second click so that you could see the item was deleted. I'm sure this is wrong on some level, but I added the my_lists button click to Page Load just like populate_edit_list and fill_list_display. It seems that if I make programmatically generated controls, the method that creates them needs to be in Page Load.)

(also the delete button on My Items was not working - similar problem but also with sql stmt errors)

I sketched out the user login panel, made some changes to the db tables, and began work on it. For now I am not going to worry about pw security, although I may try this approach if I get time.
Here's the login bit (whee!):

Wednesday, July 25, 2007

ListMaker Triumphant

Well, I fixed a lot of broke stuff today ... the ranking is still not beautiful, but the data in-and-out seems to be okay -- that's what took me most of the day, sadly. Now the user keeps his/her list_id on save to preserve the URL.
So, next will be

  1. re-hiding the debug labels (see below)
  2. finishing the ranking
  3. user login - this is imperative for testing by more than one user!

Persistence woes

I'm still missing something about persistence. Today (so far) was much like the Disastrous ListMaker day. Deleting items wasn't working -- my solution in place at the moment is to call fill_edit_display both in the Page_Load and at the end of the remove_Item method. (fill_edit_display just draws the pretty table and puts data in it from the dataset...)

If it's just in the Page_Load method, then when you click Remove to remove the item, neither my debug label nor the list_display update until you click another button that refreshes the page (no matter that Remove appears to refresh the page). If it's just in remove_item, then remove_item doesn't even seem to be called -- note that fill_edit_display is responsible for creating the remove_item buttons -- but how can I see them if they aren't there, hm?

delete_this, which deletes an entire list, has this characteristic as well -- that is, it calls populate_edit_list before it ends, and this is also featured in the Page_Load.

I think it must be because both remove and delete buttons are programmatically created rather than originally in the default document. It must be related to when the app actually creates the controls themselves in the lifecycle of the page. For now, I'm just glad it seems to work.

Can't sort a DataSet

You can't sort a DataSet; if you're filling the ds from one SQL query you can sort in the query ... but I have two queries and two datasets that I merge into one, so then it is not sorted. However, you can sort a DataView:

Tuesday, July 24, 2007

ListMaker ... Ranking added but currently hosed

Well ... I added the ranking interface and logic, and it should have worked. I also fixed up the problem where the List_ID was getting replaced on save, meaning the user's URL would be changing all the time (bad). But it's almost 6pm and B. has made a special dinner, and I don't really understand the error I'm getting (when I try to save list to db):

The name "LIST" is not permitted in this context.

and even before the error, the ranking wasn't saving. So I guess I'll take a look tomorrow. Most of today was spent on email anyway; also getting caught up with some JWL correspondence and marketing, and checking out Technorati.

Before I forget, the subject_id is still static - when I do the user login I need to change that.


Common errors and what they mean to me

Some .NET errors make a lot of sense. For example,

"There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement."

Thank You! I know exactly what is up with that. However, others are less clear. I'm gonna start a list here of cryptic errors and the most common reasons for why they occur (at least to me). This will probably reflect *my* weaknesses as a programmer rather than anything actually related to the error : )

System.Data.SqlClient.SqlException: Incorrect syntax near '.'.
-- this means you forgot a comma in a list in the SQL statement - probably after the penultimate item.

Object reference not set to an instance of an object.
-- this means you don't even have a NULL value for something. You don't actually have the something.
-- look for variable declarations.

And finally, some error messages are just plan hi-larious:

'success' does not exist in the current context

Thanks for the zen tip!

Monday, July 23, 2007

Add JMU_Items to ListMaker

Users can now add items of their own (these are called JMU_Items after the table name, which distinguishes them from R2 items) and then add those to lists. Still to be done:
  1. the Delete Item does not work yet / again for items from lists. (@#$%) Deleting lists works fine so I should start there.
  2. So Ranking might be something to tackle, next.
  3. Then the user login.

Sunday, July 22, 2007

Harry Potter

All day. Finished. Awesome.

Thursday, July 19, 2007

ListMaker - RSS integration

Today I integrated the RSS-generator bit into ListMaker, so the user can get a RSS subscription link for any of their lists, or preview it in a new window. I had to re-validate my RSS after adding in the URL / link because of URL encoding. Also the XML needed to be not unencoded (I was XMLUnwrapping things for general purposes, but the RSS feed needed to not be unwrapped). I need to ask Bill about adding my jewel-dev database to the web server so I can upload this and test it with 'real' feed consumers...

Monday, July 16, 2007

Mandibular Bug



This was on our screen door for 3 days. It's gone today -whew!


ListMaker Update

This morning I fixed the bad "refresh" behavior and also incorporated Bill/Greg's XMLWrap and XMLUnWrap methods so that the string data is properly formatted (Amos & Andy instead of Amos ' Andy).

Next:

  • integrate the RSS-generator I wrote. Test with JMU web portal and BBoard
  • User login of some sort (this will take a bit)
  • Add panel for user to add new items to jewel and include in list (this might be tricky as then my query will have to get items from two diff tables.

Focus()

So, setting the focus was actually pretty easy! I put this in my Page_Load method:

string controlName = Request.Params.Get("__EVENTTARGET");
if (controlName == "create_lbtn") {
txt_listtitle.Focus(); }
else if (controlName.Substring(0,9) == "edit_link") { //we have many of these controls, any will do.
txt_search_rdb.Focus(); }

else { welcome_lbtn.Focus(); }

So, now the Delete button does not fire on refresh -- nor any other button. And, as it turned out, JavaScript was not even necessary!

__doPostBack and JavaScript focus

Most of the ASP.NET controls call a JavaScript function, __doPostBack, to make their magic. Today I found a nice, simple explanation about how this works...
Understanding the JavaScript __doPostBack Function?

I am working on getting the Delete button (and other buttons) not to operate when Refreshed. I'm thinking of just changing the focus() with JavaScript...

Sunday, July 15, 2007

CD Buddy

A common librarian task is to have to look up a bunch of books - maybe to check and see if the library already owns the 10-20 books that he is thinking of ordering. It sure would be handy to be able to enter several ISBNs or Titles into LEO rather than one at a time..... so this morning, I made CDBuddy for this purpose.

Something I wanted it to do was automatically do a title search on the ISBNs for which it didn't find matches (that's what I'd do!). Since it didn't find matches, it can't get them from LEO. I guess (some other time) the program could go try to find the titles from WorldCat or Amazon, and then do a title search in LEO with those titles ... but that's farther than I wanted to go : )


Saturday, July 14, 2007

Functional ListMaker

I've fixed most of what was functionally wrong with ListMaker. It now seems to be operating smoothly except that if you delete a list, then refresh the browser it will delete the next list, and so forth -- makes cleanup a breeze, but I imagine the user would not be thrilled. Next:
  1. check the data behind the scenes to make sure it's really doing what I think
  2. implement Bill/Greg's XML Encode / UnEncode (I left this out for the beginning).
  3. integrate the RSS-generator I wrote. Test with JMU web portal and BBoard
  4. User login of some sort (this will take a bit)
  5. Add panel for user to add new items to jewel and include in list (this might be tricky as then my query will have to get items from two diff tables.

If all this gets done, I'll try to get the subject-recommender part going so that the user has some suggestions to work with even before searching ... maybe get New Titles from InfoApp.

And if all THAT gets done, maybe I'll go back to PL / LEO searches and allow user to include items from these in their lists. Might finish up CDBuddy or some variant thereof, first.







Things I learned today

Before I forget ... here's stuff I learned today

  • If you want to programmatically change color, use a color method. Can't just change the property with a string.
  • Careful with char and varchar. Using char will pad your field with white spaces since it is a fixed-length field.
  • Very simple CSS buttons allow for text-only buttons that can have color, etc.

Friday, July 13, 2007

No more user control

I merged my 'list_widget' user control with the rest of the program. While this didn't solve the problems immediately, it has made it easier to fix them, which I'm doing right now. I also did go ahead and make new graphics (or the lack thereof). I'll post a pic later.

Romeo and Juliet tonight, after the Baja Bean.

Thursday, July 12, 2007

ViewState Links

Disastrous ListMaker

Polished up the CSS somewhat on Wed. morning - now functionally better -- but the new desk edge is the most eye-drawing element, and it's useless. I think I'll re-photograph my notebook on a monochrome surface, then edit out the desk entirely and use soft shades of color ... ahhh.

Most of today was spent working on data persistence (this is the "disastrous" feeling). Basically, I don't know what the status of all my page elements are at any particular time. I miss Perl. Since my working data isn't too big, I've switched from Session[] to ViewState[], but I'm not liking how this seems to work with User Controls. I made a test program with one label, one button, and a user control with its own label and button, but it seemed like everything updated everything else, which didn't make sense ... (just like my real program) ... (and yes, I did turn off the Submit Behavior of the buttons).

I did get two problems fixed:

  • Moving items from the search results to the to-be-saved list now seems to work great (I think). It was always appending, and not showing up right away. Now it works on the click, and also has the right items. The on the click is highlighted because nothing else seems to work on the first click (see below) ...
  • You can Create new lists (this had broken) and give them titles, and it sort of checks to see if there's a duplicate title. This isn't working totally perfectly, though.

Here's what's still not working:

  • deleting items from the to-be-saved list (I swear this was working before but blog says not). This has be baffled - it should be a simple onclick event, but it's not firing.
  • there are several places where the action has taken place (save list, view list to edit) but it's not showing up on the screen on the first click. It takes a second click.
  • I'm not sure that saving edited lists and saving newly created lists is really working - it looks like it is working, but I need to check the data.
The solutions to the above that I've thought of so far:
  • Getting rid of the 'user control' If I do this, it would be in the hopes of removing a layer of confusion from the ViewState. But I was so proud that I got it working, with delegates and whatnot. But, it's not really necessary.
  • Starting from scratch (ha, ha, ... no wait maybe that's a good idea...)
  • Try to learn more about View State from my test program and the books and making the current version work (yccchhhh) - the trick is how it works with user controls, though. I think I get it without the user control -Well, here's how it looks as of now... see the Edge?

DataSet vs. DataReader

For future reference ....

1. DataReaders have less overhead than DataSets and are more efficient.
2. DataReaders can be databound (i.e. to a DataGrid).

but

1. DataSets are disconnected. They are like disconnected models of the database.
2. DataSets can be made into Session objects or files, for persistence (which I need)
3. DataSets can provide access to more than one table and table relationships
4. DataSets can be bound to multiple controls and/or reiterated through multiple times whereas a DataReader is a once through.
5. You can jump to a particular record or go backwards through a DataSet.

Also, if you name your table then you don't have to worry about getting the right Table[i]!!

Tuesday, July 10, 2007

CSS / graphics for ListMaker

Well, I went ahead and tried my hand at recreating my graphics with ListMaker. I did the heading text drop shadow with CSS! It's about 50KB at the moment...

I figure if I do the CSS early, I can look out for problems with the CSS as I'm debugging other stuff (i.e. resizing browser windows). I had it almost "pretty good" but then something busted. Here's my last good build. Now, if I can just get that LH background col graphic AND the two-columns working at the same time:



Visuals for ListMaker

The other day I was pining for my inforM days at Maryland (they still have WebTrack, which I originally designed /helped populate!) and decided to work more on the ListMaker visuals. I hope that this will also spiff my CSS skillz since I will be trying to recreate my design with CSS and minimal actual graphics. Here's my initial attempt:

What the user sees upon login:


What the user sees after beginning work:

Monday, July 9, 2007

XML Documentation and Web Application vs. Web Site

I had read early on that one can document C# code with XML, and today since I was reviewing all my code and comments, thought it would be a good time to try this myself. You just use three slashes instead of two, and insert XML tags around your comments. Then Visual Studio can generate the XML file when you Build, and you can display the XML in a nice HTML page if you use an XSLT stylesheet. And if you want your nice HTML page to look like MSDN, you might check out Sandcastle, an add-in for VS to generate such pages.

Hereare some of the sites that seemed most helpful:

Before I got too far along, I realized I was missing some of the 'commands' in VS necessary to generate the XML. This is because I've got a Web Site instead of a Web Application (see Birth of ListMaker post). Which raised the question, just what is a 'Web Application' to VS? This is one of those basic questions that is hard to find information about since most folks have moved on - but, Scott Gu has an excellent introductory tutorial: Visual Studio 2005 Web Application Project Option. Also a nifty comparison chart and additional details on MSDN.

And here is one way to generate the XML doc for a .cs if you don't use the Web Application template:

>csc common.cs /doc:mydoc.xml

but, this just does the one file. In forums.asp.net, I found sample code that will do it for all the files and do it without opening the command line ... http://forums.asp.net/t/843207.aspx ...

Also, for future reference, here are other compiler options: http://msdn2.microsoft.com/en-us/library/ms379563(vs.80).aspx

Sunday, July 8, 2007

Session State in ListMaker


It's all about scope - where you are allowed to do what and to what. Spent most of this evening (and into the morning) chasing a dataset which drives the insert query for when you want to create a new list and want your items to be connected with that new list (success above!). Finally, decided to learn a little something-something about Session State with ASP.NET and this solved my DataSet problem.
Other accomplishments this evening, all in a flurry after breaking thru with Session State: ListMaker will let you Create a New List and save it. The Edit button for a list loads the items into the fill_results_display, but the delete button for each item still needs to be hooked up. If I'm a good girl, my next step will be to step back and see how I'm doing programmatically -- that is, am I following good OOP techniques? How's that documentation? But of course I want to move on with new / enhanced functionality... temptation, temptation...

Hiatus

Alex was here Thurs pm, Fri, and Sat (today). We three enjoyed new games St. Petersburg and Lost Cities. A Winter's Tale on Fri. night at Blackfriars was surprising; Dona Rosa's beforehand filled us with authentic sopes, enchiladas, and rellenos.

Today Bryan watched a STL Cardinals tripleheader but I only managed one plus 3 innings of the last one. It was a heartbreaker, with my fave Aaron Miles giving up several runs on errors and losing by 1 after Pujols hit into a double play.

Thursday, July 5, 2007

ListMaker 1.0 - new screenshots


Here's the new ListMaker home page. Rather than the old Edit pull-down, I'll just display all the lists in the opening view. Each list will have the option to delete, edit, or view the RSS output. The 'delete' works; the 'edit' and 'rss' need hooking up but the logic is sitting somewhere.

Note: I had a beastly time with "user controls" at first - not really the technology so much as figuring out the best use for a user control. You can bubble up events from user controls to the parent page, but I didn't figure out how to communicate between user controls on the same page. Then I realized I shouldn't be using user controls for what I was. As of now, I just have one user control, the widget that has two panels - one that lets you search for items and the other that displays the list-in-progress. since I can use the same structure for Create and Edit (I hope!) I made it a 'user control'.


The second image shows the "Create New List" screen which is working. Strangely enough, I didn't end up using the CSS tabs - I put 'em in and then ripped 'em out. when I decided to put the edit and create at point of need. Technically that "Welcome" is still one of the tabs - silly.



Accessible tabs with CSS

Before I lose this, here's a nifty site to use CSS with accessible navigation tabs:
http://www.sitepoint.com/article/accessible-menu-tabs

And here's another - but I didn't use this technique:
http://www.alistapart.com/articles/slidingdoors/

Also, a note here that using AJAX clearly has the potential to raise accessibility concerns. For this project, since it is a learning-by-doing, I'm going to play first, fix (if necessary) later, even though perhaps usually I would try to get it right ahead of time.

Tuesday, July 3, 2007

ListMaker - pastel version

Before the progress report, I have a design question. At the moment I have users search for items, select from them to make a temporary list, then they can save the list to the database. Since the 'lists' will one day be live, this allows the user to "work" without the public seeing the changes. But, some of today's models (Netflix) seem to be more immediate - that is, perhaps as the user chooses items, they get saved to the list immediately. In Blogger, I guess the model is that you edit, then save, which is closer to what I'm doing. So, I guess I'll stick with that. But I wonder if even the blogger edit-save model will become the immediate-save model one day.

I worked on the CSS for ListMaker today as it was getting too ugly to bear. I also removed some old placeholder controls. I'm also now using a common method to fill my dataset for "the list we're working on" and also a common method to display a dataset in a tabular format (the green box below). Right now, though, all the controls are still on all the time, and all the buttons postback so that everything is cumulative, which is wrong! I keep saying I need to separate stuff into user controls, but I don't want to leave that job in the middle so I need a chunk of time. Maybe next time.




SQL Query

Apparently I just needed a good night's sleep:

select [rdb-production].[dbo].items.item_id, [rdb-production].[dbo].items.title,
[jewel-dev].[dbo].JMU_List_Items.JMU_Lists_Items_ID
FROM [rdb-production].[dbo].Items, [jewel-dev].[dbo].JMU_List_Items
WHERE ([rdb-production].[dbo].Items.Item_ID = [jewel-dev].dbo].JMU_List_Items.Item_ID) AND
([jewel-dev].[dbo].JMU_List_Items.JMU_Lists_ID = 38)

Monday, July 2, 2007

Annual Report Day; editing with ListMaker

Most of today I worked on catching up with email and drafting annual report material. I did make a bit of progress on ListMaker's edit list feature, but need to straighten out a SQL query to get the items, lists, and the ID from the linking table (hint to self: start on line 297). After wrapping up the SQL query, however, I need to move to the overall architecture before I make too many more 'user controls' that are just stuck on the page instead of neatly filed away. Then it should go fairly quickly.

Houseguests tomorrow night and through Saturday, though, so don't expect wild flights of progress this week : )

Oh, and the AJAX accordion had to go for now because I can't see what I'm doing in design view with it in there.

Friday, June 29, 2007

Successful RSS output creation

I may have gone about it in a backwards way, but I did actually produce valid RSS output today!!! I used a static List_ID, but got the Items from the rdb Items table. Below is my SQL query and also a screenshot. Also I discovered the ASP.NET 'Literal' which is what I used to tell my code-behind where to stick the RSS it generated. Bill used the ASP Repeater and a DataSet to fill it, and that might be smarter.

First, the SQL query:

SELECT Items.title, Items.default_abstract FROM [rdb-production].[dbo].Items INNER JOIN
([jewel-dev].[dbo].JMU_List_Items INNER JOIN [jewel-dev].[dbo].[JMU_Lists] ON [jewel-dev].[dbo].[JMU_List_Items].JMU_Lists_ID = [jewel-dev].[dbo].[JMU_Lists].List_ID)
ON [jewel-dev].[dbo].JMU_List_Items.Item_ID = [rdb-production].[dbo].Items.Item_ID
WHERE ([jewel-dev].[dbo].[JMU_Lists].List_ID = 38)

And the screenshot:


RSS Output and User Controls

Today I am reading up on "User Controls," an ASP.NET technique which is basically like include files. I'm also reading various articles on generating RSS output with C#. I'm surprised at the variety of strategies employed, and also at the relative (seeming) quietude. That is, I didn't get as many fabulous results with my Google searches as usual; no one seems to really be the expert, yet. There's an RSS Toolkit for ASP.NET - yet it has less than 1,000 downloads. Hmm...

Links:

Thursday, June 28, 2007

ListMaker 1.0

Today was good; user can now select items from her result list, move them to temporary part of screen, then save to database. Also, user can view lists that they've previously made. I need to ask Bill about whether I really need to make relationships in my database or whether I can just always use INNER JOINs.

Here's another crazy ListMaker snapshot. Functional problems with the below (after moving into AJAX accordion) include the thing that looks like a bulleted list (it is a reorder list) which is not letting me add items (so I'm using the plain ListBox); the search box in the maroon no longer functions to search, because it is being used to accordion. But, I am hungry. More later. Oh, and b4 u say anything about the colors, they are just so I can see what is what :)

Crazy ListMaker

I have a sort of secret self-Schadenfreude when I am creating something ... so I'm going to take screenshots of my lovely ListMaker especially when it looks most messed up. I mean, if someone asked me to create the below, I have no idea how I'd do it ... except that I've done it! All that was amiss was a fixed width for my AJAX accordion.

Wednesday, June 27, 2007

ListMaker 1.0

ListMaker now has an AJAX collabsible panel that displays results. Oh, and it allows the user to search for Items in the R2 database, displays the results (in aforementioned collapsible panel) with checkboxes for each item. Then user can select the items and click a button to save them, and for now they are saved in another part of the screen.

Next step will be saving the list into the database, then view, edit, or delete lists they created...

For now I am using a static variable to hold my user name and ID.

Hooking up the AJAX Collapsible Panel took me the most time -- because I was assuming it had to be much harder than it looked!

Tuesday, June 26, 2007

Hiatus - ALA Annual 2007

Started a blog for Professional Development, with ALA Annual being the first set of entries: http://jcf-pd.blogspot.com/ (I did very little at ALA related to my summer leave project).

Friday, June 22, 2007

The Birth of ListMaker

Yesterday sucked as I tried to separate out my JMU User Create List from the rest of R2. I made the new database successfully, and installed the AJAX Control Toolkit successfully, then things went to suck. First I made a new app ('LibraryListMaker") and tried to port in parts of R2. Apparently the "Web Applications" template doesn't have an App_Code folder, which is kind of important for beign able to keep random code files handy. So I restarted wtih a "Website" template (it did have an App_Code folder) and tried to port in files again. It couldn't ever find the code I put in the App_Code, though, I suspect because I didn't create the item within the App_Code folder correctly - that is, I just pasted stuff in place and generally munged it. I also suspect trouble with namespaces.

Anyway, this morning I started from scratch and set up a "Website" with a .cs in the App_Code that did some simple string manipulation and I managed to pass it a string and get a diff. string back. Emboldened by this, I went ahead and ported just the dbconnection parts of Bill's common.cs and commonbase and default, and managed to retrieve some data from Jewel into a label area. (Note: Jewel is my name for my database; JMU User Lists = JUL = Jewel). So far, I think the app name will be ListMaker. It was LibraryListMaker, but that's the one that never hooked up, and also that's a long name.

Bill was right that I should start with an empty document. (of course). Thanks, Bill.

Off to ALA now.

Wednesday, June 20, 2007

Hiatus

Sat. and Sun. were spent with Margie - awesome - and Monday was Moving Meris and doing some JWL housekeeping and e-mail catching upping. Tuesday was SPT lunch (at which Kevin urged me to take a closer look at Zotero). I did do one more database-connection thingummy in the a.m. with my new JMU User Create Lists so there was a small accomplishment. I made my own label and populated it from my new db tables.

Also on Tuesday, had a great conversation with Bill: I'm gonna rip my JMU User Create Lists out of R2 and even make its own database, rather than tables within the R2 db, so it is easily portable, just in case it works. Also Bill showed me the GetDS method and other basic functions he calls in. Thank you, Bill.

Today (Wed.) I spent getting ready for the ALA Annual Conference, including poster session-related stuff. And working on the new Digital Services person paperwork. So, no programming, alas! Tomorrow I hope to be able to do a bit, but then Fri-Monday I will be in absentia. Grr...

Friday, June 15, 2007

Create JMU User List

Today I created a new user control, "Create JMU_User List," aka Create_List_Fac within Bill's R2 Admin, following the pattern he used for the other user controls. I also added several database tables to rdb-prodcution that I will need for storing info about faculty lists. (Note: the "fac" suffix in the classname is unfortunate - I needed to differentiate them from librarian-created lists but hadn't thought through it yet. I did prefix the db table names JMU_User, which is a better nomenclature and maybe I'll go back and rename Create_List_Fac in the code).

Anyway, my goal for today was to successfully create the user control and make one successful connection to my new database tables. I modified the drop-down that gets librarian-created lists to instead get JMU User-created lists, and this works.

Next step will be to allow "JMU Users" to add items to their lists just like Create List. I'm hoping this is easy since Bill's code already does lots of this. Something I did that might make it not quite-so-easy is I removed the link between JMU Users and subjects, because they won't have subject-rights. They will be linked to subjects, but not in any way that relates to rights. For "JMU Users", Subjects will just help them narrow down searches to their interests, or display News or New Titles related to their interests.

In this sense, the "Subjects" are pretty lame - tags would serve better - if there was sufficient use and users. Maybe I will go ahead and put the tags in place, and populate the tag db with subjects for each existing item.... But that's for much later!

Sat, Sun, and Mon, I will be mostly "off" as Margie is coming to visit, I'm working with Chris on my PC, and helping Meris move.

Thursday, June 14, 2007

Hiatus

Took a few days away from .NET to go to Florida, review the galleys from JWL 1.2, and catch up on email. And (this morning) watch the STL Cardinals game I missed while in Florida (7-3 Cards! Go Wainwright!). I haven't solved my silly URL problem (below) but I need to move on toward my original goal of selecting R2 stuff for RSS lists. One of my problems with summer leave (maybe the only one) is that I keep thinking of more projects I could do, or want to do!! I'm reading a book about how to do just about anything with RSS/Atom, and now I want to go mashup crazy.

Sunday, June 10, 2007

Fun with HttpWebRequest

So I got HttpWebRequest working with everyday URLs, spitting web content into my app. But it choked on LEO XML server URLs such as:

http://leo.jmu.edu/xmlopac/?xml=<WXREQ_ROOT><KEY>i0143036610</KEY></WXREQ_ROOT>

I suspected the angle brackets but only within my code -- I didn't realize it was actually sending
http://leo.jmu.edu/xmlopac/?xml=%3CWXREQ_ROOT%3E%3CKEY%3Ei0143036610%3C/KEY%3E%3C/WXREQ_ROOT%3E
until I downloaded Fiddler debugging proxy and saw it for myself. So while the former URL went to the /dtd dir, the latter went to the /xmlopac dir.

Oh, and also, I noticed that LEO wants to set cookies, so I'd better enable that in my HttpWebRequest.

Friday, June 8, 2007

Things I learned today: C#, ASP.NET

I went back over some of the abstract concepts of C# that were not clear to me...

  • Local and Instance variables (turned out just to be what I call 'scoping')
  • overloading Methods (awesome)
  • passing parameters by value, by reference, and with 'out'

Also, I went through some of Programming ASP.NET's "advanced controls" and other exercises:

  • MultiView and Views
  • the Calendar object
  • Session State

Finally, I made my first AJAX application -- the simplest one on the AJAX ASP.NET site. Nice video, Scott Gu.

Why .NET is cool

One of my programming books suggeted that I check out the .NET Framework Class Library (FCL) and to reuse the classes and methods therein as much as possible. So I did. (The checking out part, at least) So anyway, suppose you wanted to something with a standard Windows File dialog box ... there's a whole class for this (duh.) That's tech speak for "you just say you want to use a File Dialog Box!!" You can basically make that metaphor your own! Suppose you want a file dialog that lists just .mp3 and .wma files. You just use the Filter property of SaveFileDialog! Or, as MSDN puts it, "Gets or sets the current filename filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box at the bottom of a file dialog."

Why is this cool? I once wrote a perl program for users to upload video files. I only wanted them to be able to use certain file types, since I had a specific media player I was using. I had to write all this validation to make sure the extensions were all "okay." And I had this stupid text note that told the user "file extension must be x, y, z, p, d, q." It would have been far cooler if the file dialog had just the acceptible types in it.

Not to mention the perl calendar (which I copied from someone else's code) for which I had to write all my own 'event handlers' so to speak. ASP.NET has a whole Calendar class with built in methods to do common calendar stuff.

For future reference, here's the list of magical .NET powers:
http://msdn2.microsoft.com/en-us/library/ms229335.aspx

Monday, June 4, 2007

Programming ASP.NET; C#

Finished Ch. 4, "Basic Controls" today, including Panels. I confess to skipping the typing for the Table control exercise ... perhaps this will be a major ingredient in a humble pie I will make later. I did read it. Ditto for the Image, but that is because I didn't want to go get an image. Lazy.

In the world of C#, I completed some exercises to illustrate classes, methods, and properties. These abstractions were previously boggling my mind. Next in this course will be figuring out what to call statements like this:
ScrollBars scrollBar = (ScrollBars)Enum.Parse(typeof(ScrollBars), strValue); pnlScroll.ScrollBars = scrollBar;

At this point, all I know is that "scrollBar" looks pretty silly after typing it a bajillion times. And that the above statement relates to ScrollBars and scrollBars. But not Scrollbars.

Now onto Final Fantasy...

Searching PL and LEO - success!

So, while the goal of my project is really just to make an RSS-constructor using the R2 database, it's been on my mind that LEO Library Catalog and Periodical Locator are crying out to be included. Yesterday afternoon I wrote my first successful PL and LEO search !!! User types in a search term and app goes and gets results and displays on my app's page, with checkboxes that user can select to "save" results. (at the moment, results are 'saved' to another area of the screen). The LEO one needs to be improved by using the MARC fields instead of what I'm using now (HTML!) PL thougthfully has comment tags that look pretty reliable. I'm not under any illusion that a screenscraper like I've written is a long term solution, but it might be good enough for a prototype. AND... it leads to possibilities such as:

  • App to look up multiple ISBNs in LEO or other systems simultaneously; first by ISBN, then by title keyword(?)

Also, yesterday I was so happy to use the Regex() to write my first regular expression within C# -- I almost felt at home there for a minute.

Saturday, June 2, 2007

Programming ASP.NET

I'm still on my little side trip from R2 into Programming ASP.NET, which is a great walkthrough of all the controls... I'm making one massive page with all my controls on it: AWESOME. Today, besides the book exercises, I learned...

  • use the StringBuilder instead of just concatenating, in order to save memory.
  • if you want onchange for radio or checkbox lists to change something (without AJAX) you must set AutoPostBack to true.
  • There's no "NotSet" value for BulletedListDisplayMode even though the book example says there is - you just use Text. See MSDN

Friday, June 1, 2007

Programming ASP.NET ... today I learned

OK I decided to go ahead and go through Programming ASP.NET's code examples. So far, today I've learned these things not in the book:


  • in C#, you need each case block that has a directive to end with something like break or goto (Book example must've been VB) or it won't compile

  • if you are using master pages, then your controls are given custom id numbers like this: ctl00$btnMyButton. (see http://www.codeproject.com/aspnet/InsideMasterPages.asp) for more. Meaning if you are trying to access them with getElementById you had better name them right.

  • Assigning a new txtHTML.Value does not seem to fire the JS onchange event

Also, I found a keen font for VS, called Consolas: http://www.microsoft.com/downloads/thankyou.aspx?familyId=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displayLang=en

Thursday, May 31, 2007

Tweaking R2 Create Lists

1. Against all odds, my SQL server re-install actually worked. I chose just to Remove the Database Services and then used the setup cd to install just that piece. Then ran the two hotfixes and it all seemed to work! I had to re-attach both databases (R2 and appcontrol) and I had to re-configure the SQL Server to accept remote connections. It is still not accepting requests through the "real" web browser, only the dev. browser. I am hoping next restart will take care of this.

2. Remember to STOP the development browser before refreshing the page. (IE has always sucked this way!)

3. My real goals for today were to:

  • alter appearance of R2 using stylesheets
  • alter the Create Lists Web Form (I added a button)
  • alter a function so it pops up a javascript alert (done!)

    I also...
  • changed the default behavior of the web form (i.e. it Shows All instead of just 'A')

I think next time I will try to create a new R2 tab / page (with no functions) and in a tester application, perhaps try out all the ASP.NET controls to be sure I know what they are / do. I also still need to write (in English) what I want my new 'module' to do.

Tuesday, May 29, 2007

SQL Server Blues...

It was all working swimmingly. Then, suddenly, I could not start the SQL Server Database Services. Was it all the Removing of Programs I did one day in Add/Remove Programs? Was it related to installing the SP2 Update and Hotfix?

Plus, house guests have been here. So, no real progress since I got R2 actually running! Dismay!

As I type, I am attempting to reinstall the Database Services part of SQL Server... then will try to run R2, then install the SP2 and its hotfix. It is such a behemoth.

Friday, May 25, 2007

Why I love my sysadmins, part II

So after many failed attempts to configure the connection strings in rgproto, as well as mucking through various SQL Server and ASP.NET configurations, I finally broke down and asked Bill for help... a few minutes later and he (of course) instantly saw what I should do: use the connection strings that worked for my test database, and just substitute the initial catalog. I had been trying to use his rgproto connection strings, and somehow substitute in my server/machine/account info.
Now I have my own local instance of R2, complete with database connectivity! Joy!

Thursday, May 24, 2007

Configuring ASP.NET 2.0 Application Services

Also I had to configure my ASP.NET 2.0 Application Services by running a utility from the Command Line!!! Now, I'm not afraid of the command line -- but I kinda expected that something so fundamental would be part of a GUI somewhere.... I mean, this isn't LAMP...
http://msdn2.microsoft.com/en-us/library/aa479307.aspx

Why I love my sysadmins...

Today was huge! Let me just state, for the record, that I know pretty much nothing about Windows beyond the user level. So IIS, SQL Server, and the mysterious world of "Services" are pretty much totally new to me. I know IIS' default root dir is inetpub/wwwroot and I know how to set permissions on directories within. That's it.

I brought my work PC home, since my laptop was NOT beefy enough to run SQL Server. So I had to set up SQL server on the new machine, which I'll call "the new machine." This turned out to be a trick because it already had SQL Server Express, and it wouldn't upgrade. Not that it felt it necessary to inform me of this. So it installed everything but the Database Engine (kinda fundamental). Not that it felt it necessary to inform me of this. Then it kept telling me this or that service wasn't started, but they weren't in the Services List... anyway, long story short, I finally had to uninstall all things SQL and then install fresh.

OK so then I had to get my Visual Studio projects from laptop to new PC, and merely copying the files didn't quite do it - had to figure out how to add existing web site to a new solution file. Done.

THEN I had to get my SQL Server databases from laptop to new PC and unlike MySQL there seems to be no easy LOAD DATA INFILE or some such. I mean, check this out: http://support.microsoft.com/kb/314546

I ended up using the detach / attach procedure, although it would have helped if they'd explained that these are simply in the Management Studio GUI. This seemed to work GREAT. Awesome.

Next was getting my IIS to serve websites to localhost. I expected it to just "do this" but it was good I went in and played with it because I had to update it from ASP 1.x to ASP 2.x and also I learned to specify that rgproto was an "application." Then guess what: it just magically appeared, AND (apparently) it connected to hollywood and actually works!!!

Next step will be to get it to connect to my local copy of the database. Then I can start mucking around for real.

Whew. Now I know even *more* reasons to appreciate system administrators (as if I needed more reasons). It's a pain to be your own.

Sunday, May 20, 2007

Master Pages with JavaScript and CSS; GridView

My accomplishments for today are creating a set of master pages (one master page, one nested master page) that reference a CSS and a JavaScript file. The Javascript is used to measure screen elements and then size the header appropriately. Also, I displayed a GridView that connects to a real Access database -- woo hoo!

Saturday, May 19, 2007

Stupid Microsoft ... web server angst

So I can't run my new Web application via a normal (non-Visual Studio) web browser because I have XP Home rather than Pro, so I don't have IIS to serve the web page. And the web sites that tell you how to hack it are dire.

I did install Apache just for fun, and it displayed the asp controls in text format, rather nicely, if not graphically:

asp:button id="importFT" runat="server" text="blah blah"

Had to remove the angle brackets to get the code to display in the blog!
For the record, apparently there is a non-hack way to run ASP.NET on the Apache web server: http://www.mono-project.com/

but hopefully JMU will just spring for an upgrade to XP Pro.

In the meantime I'll enjoy showing myself my own apps through the Visual Studio browser. Whee.

Friday, May 18, 2007

I happened upon what seems like an excellent walkthrough introduction to ASP.NET, called Real World ASP.NET: Building a Content Management System.

That title sounds huge, but the book starts small and then builds each chapter so that by the end, you do have a CMS (which the author calls CMS.NET). And, hopefully, an understanding of the inherent structures. I think that's what I'm going to start next. I've paused in my reading of Programming ASP.NET because I'm waiting for the newer edition; my library only had 2003 in print and there's a 2005 for 2.0. The CMS.NET book is also older but I like its approach so much that I'm game to go ahead and try it. Also, it doesn't get too fancy.

I've also drawn some possible interface pictures, and outlined some classes and methods that would need to go with different features. Some of these are already in R2. I haven't decided whether to try to copy R2, or, in the interest of education, to try to write them myself first and then compare with R2 to see how I could have done it differently.

Thursday, May 17, 2007

First C# program

Today I wrote my first C# program, following an example in a book: it created a window object and then two other objects that derived from the window object but overrode the window object's DrawWindow method. Then I drew each object. And indeed they overrode the window object's methods. All in the console! It was breathtaking.

Tuesday, May 15, 2007

Finished reading R2 admin code

Just finished reading Bill's R2 admin code - WOW. Still need to DL and read the public side of R2. Will also begin reading Programming ASP.NET or at least the parts I know I really don't get.

Monday, May 14, 2007

Learning C#

Today I finished Learning C#, by Jesse Liberty. It's rough for this perl girl to admit it, but there just might be something to appreciate here. Next step for me is to read Bill and Greg's R2 code and see if I can make sense of the structure now that I understand (or at least know of) classes, methods, interfaces, delegates, etc.

First post to My Library Syndication

So, I'm on Summer Leave until August, 2007. Awesome.

My creative project for the leave will be to learn ASP.NET, C#, and maybe a little AJAX. My subject for these technologies will be library syndication, which is all the rage on the library-related parts of this network of tubes we call the Internet.

This blog will (hopefully) help me keep track of related web sites, projects, books, and other stuff I find that seem to feed into my scope.