Utility To Troubleshoot SQL INSERT Statements

Today I wrote a Windows application in C# to help me troubleshoot SQL INSERT statements which do not have an equal number of columns and values. Unfortunately, SQL Server does not provide very informative error messages. It can be difficult to figure out why an INSERT statement is invalid when you have a large number of table columns and a long string of values. My Windows application allows you to paste the SQL statement into a rich text box. When you click the Parse button it will display the number of column names and the number of column values so you can easily see if the counts do not match. It also displays the column names and values in a data grid view so you can more easily spot the value that does not match up.

Troubleshoot INSERT statement

I learned how to use regular expression match collections in writing this program. I also worked out how to create a dataset programmatically, define its columns, and add rows of data.

Posted in Databases | Leave a comment

Things That Are Consuming My Time

I’ve been very busy the past few months and can’t seem to make much progress in getting things done to reduce my work load. Therefore a blog is in order to explain why. First, the USPS changed their shipping rates and broke the web service that provides International Shipping Rates. This is a problem for many e-commerce shopping carts including Storefront 6.0. I have developed a VBScript to test the USPS shipping API without using Storefront so I can determine exactly what the XML requests and responses are. Storefront does not provide a clue as to why the attempt to get the shipping rate fails. Unfortunately I am still unable to resolve this problem because USPS is not documenting their web services very well.

I’ve also been using Visual Studio 2005 a lot more now so it has been necessary for me to learn all the new features. I spent a lot of time learning the various debugging options and documented many obscure features. I still use Visual Studio 2003 for many ASP.NET 1.1 projects so I’ve also expanded my knowledge of Visual Studio 2003. I’m a real power user of Visual Studio now!

In addition to Visual Studio 2005, I’ve been studying C#. Many of the programming tasks that I know how to do in VB.NET have had to be translated into C#. Sometimes I learn how to do something in C# and then need to translate it into VB.NET. And sometimes I need to figure out how to do something in NET 1.1 that I’ve learned how to do in NET 2.0. So I’ve been kept busy juggling two programming languages and two application framework versions! I would like to convert all my ASP.NET 1.1 projects into ASP.NET 2.0 and reduce my use of Visual Studio 2003. Unfortunately, this requires a time consuming upgrade of Storefront 6.0.

I recently bought California Software’s BABY/400 to help me learn RPG. Unfortunately, the BABY/400 operating system emulator is pretty rare now and there is virtually no documentation on it to be found on the Internet. I have to struggle to figure out how to do the simplest things. It takes hours of trial and error. I have not even managed to run a RPG program yet.

I hope to decrease the pace of my studying as I gain more skill with Visual Studio 2005, C# and RPG. I’ve pretty much exhausted the Visual Studio 2005 subject and C# only occasionally requires some additional study now. I still need to spend a lot more time on BABY/400 and RPG but I’ve made considerable progress in that area.

This blog is now getting over 600 SPAM comments a day! The spammers have really ruined text blogging. I waste a lot of time deleting email notifications of spam comments so I have turned that off. If you want to leave a legitimate comment on my blog you should email me so I can find your comment to approve it.

Posted in Business | Leave a comment

Web Service Security

Most web service tutorials only show you how to return a simple string value and they don’t address security at all. All of the web services you create based on the tutorials will allow anonymous access over the Internet. Anonymous access does not allow you to create commercial web services for which you wish to charge a fee. Unfortunately there are few tutorials on web service security.

The preferred method of making web services secure is to use Microsoft’s Web Services Enhancements (WSE 3.0). Unfortunately I encountered many problems using the WSE. For one thing, it does not work with Web Application Projects, a type of Visual Studio project that does not use virtual directories. Instead you must use a regular IIS hosted web project. After solving that problem I was able to add authentication to my web service and I could send the UsernameToken to my web service using VBScript. However, I ran into another problem with my windows application client. The web service proxy class would not allow me to add the UsernameToken to the request.

So rather than struggle with WSE I wound up using custom SOAP headers using SOAP extensions. This requires the client to send an username and password in the SOAP headers in order to be authenticated. The web service must also restrict access to SOAP requests because it must receive a SOAP header. That means you cannot access the web service using POST or GET. I was still able to create three types of client applications; a VBScript client for testing purposes, a Windows application client, and a web application client using ASP.NET.

In addition to implementing authentication, I also figured out how to control the XML that my web service returns by returning an XML document. Usually you have to struggle with various data structures in order to determine what sort of XML will be returned. For example, a dataset returns XML that is hard to format using XSL. By returning an XML document I gain the ability to tweak the XML to accommodate the needs of my client applications.

Web services provide very flexible and powerful methods of exchanging data but they are not as popular as they should be because of the simplistic tutorials. As usual, Microsoft and technology gurus have failed to gear their examples to practical business applications. Most of the available material on web services is superficial and serves as little more than a brief and inadequate introduction.

Posted in ASP.NET, General | Leave a comment

ASP.NET 2.0 Health Monitoring

In addition to trace listeners, ASP.NET 2.0 has added a health monitoring system to log web events for a web application. Health Monitoring is similar to trace listeners with the additional option of logging the events to a SQL Server database.The only thing that distinguishes health monitoring from trace listeners is that it is exclusively for ASP.NET 2.0 web applications and not for Windows form applications. Health monitoring allows you to capture web events and add them to the traditional ASP.NET trace page. It can also send emails about web events. All of this can be set up in the web.config file without any special coding unless you want to create your own events.

So when should you use health monitoring and when should you use trace listeners? Health monitoring is the best choice for a production site that you want to monitor. You can monitor application starts and terminations, user authentications, and errors that occur while the web application is running. A trace listener is better for debugging when you want to output the value of many variables and trace the execution of your code.

Posted in ASP.NET | Leave a comment

log4net With ASP.NET 1.1

log4net provides the same sort of debug and trace logging capabilities as the trace listeners in ASP.NET 2.0 but it can be used in ASP.NET 1.1. Therefore if you like trace listeners in ASP.NET 2.0 but have some ASP.NET 1.1 web applications that you cannot upgrade, you should give log4net a try.

The log4net web page can be found at: http://logging.apache.org/log4net/ You will also need the NAnt build tool from http://nant.sourceforge.net/

Here are the steps to get started with log4net:

  1. Download NAnt, the free .NET build tool.
  2. Extract the contents of the archive to the location you wish to install C:\Program Files\NAnt
  3. Edit log4net-1.2.10 build.cmd file. Remove nant-0.85-nightly-2006-03-06 from line 21.
  4. Run the SN utility from the .NET Framework SDK as follows: sn -k log4net.snk
  5. Copy log4net.snk to log4net-1.2.10 directory
  6. Run build.cmd from command line
  7. Copy log4net.dll and log4net.xml files from log4net-1.2.10\bin\net\1.1\release to bin directory
  8. Add configSection to web.config file. The version number is the most troublesome aspect. It may not be required or you may need to get the exact string from the output window error messages!
  9. Add section to web.config
  10. Add Reference to log4net
  11. Add classes to Imports
    Imports log4net
    Imports
    log4net.Config
  12. Declare a logger object
    Private Shared ReadOnly log As ILog = LogManager.GetLogger(GetType(WebForm1))
  13. Add some Debug and Info statements to generate some output
    If log.IsDebugEnabled Then log.Debug(“Debug is enabled. Page_Load subroutine.”)
    If log.IsInfoEnabled Then log.Info(“Info is enabled. Page_Load subroutine.”)
  14. Make sure the web root has write permissions for ASPNET network account
  15. Add line of code to global.asa.vb file in Sub Application_Start. Make sure to include Imports log4net in global.asa.vb
    log4net.Config.XmlConfigurator.Configure()
  16. Add Assembly line to AssemblyInfo.vb <Assembly: log4net.Config.XmlConfigurator(ConfigFileExtension:=”log4net”, Watch:=True)>

log4net offers a few options that trace listeners don’t provide such as the ability to log trace and debug output to an Access database.

Posted in ASP.NET | Leave a comment

ASP.NET 2.0 Trace Listeners

I have been spending a lot of time exploring Visual Studio’s debugging options because I deal with a lot of large projects and web applications that require me to search through thousands of lines of code. Web applications are especially difficult to debug. For example, Storefront 6.0 has hundreds of classes which are not associated with web pages so I cannot determine the value of a variable just by enabling tracing.

ASP.NET 2.0 has added trace listeners which can redirect debug and trace statement output to a log file or the Windows Event Log. This has proven to be very useful for web services and web applications that cannot be debugged in Visual Studio. Now I can insert System.Diagnostics.Debug.WriteLine statements in a web service that is giving me problems and have the information I need written out to a log file while my client application consumes the web service. Since I cannot run the web service directly from Visual Studio this is the only way I can get any debug output while the web service is executing.

Web applications can be run locally in debug mode but it is very difficult to do remote debugging without a lot of cooperation from the web hosting company. Fortunately, trace listeners would allow me to write the debug output to a log file which I could then review.

To add a trace listener you just add a system.diagnostics section to your application config file or web.config file which will provide all the configuration information for the trace listener. It can also be specified in code. To disable the trace listener you just comment out that section of the web.config file. You definitely want to do that or the log file will continue to grow and grow with each application run.

Posted in ASP.NET | Leave a comment

dot.bomb: My Days and Nights at an Internet Goliath

I’ve been too busy to blog much lately. This blog gets over 100 spam comments a day and I don’t have time to read them all to find legitimate comments. If you want to leave a legitimate comment please send me an email with your comment’s subject line so I will know to look for it. Otherwise I’m just deleting all comments.

I just finished reading dot.bomb: My Days and Nights at an Internet Goliath by J. David Kuo. It is a nonfiction book about the rise and fall of the dot.com company Value America during the glory days of Internet speculation which ended in the big crash. I read this book in only two days because it directly relates to my business as a web developer. Of course, it was more from the web entrepreneur’s perspective than the technology perspective. I can’t help wondering if the company’s failure wasn’t due to a lack of emphasis on building the technology. It is always a mistake to focus on marketing and sales and make too little investment in the technology side of things. Otherwise you wind up selling what you can’t deliver and that seemed to be Value America’s problem. They never actually implemented their original business plan of inventory-less retailing and direct to consumer shipping.

Value America spent a fortune on print advertising and worried about the cost of customer acquistion. In contrast, my small business requires no advertising and client acquisition costs nothing. Web developers are in high demand and you don’t need to advertise to find more projects. You don’t need to do anything at all except post on message boards where businesses are looking for help to customize their web applications. Unfortunately, I can’t handle all the work that I would be able to acquire. Under ideal circumstances I think a web development firm could grow by investing heavily in expertise and nothing else. As long as the network infrastructure, development software, and office space were provided I think a team of web developers could do quite well without all those useless people whose only purpose is to get the business.

I have ordered a new laser printer and hard drive to complete my home office. I’ve also bought a lot of books to update my technology library. That is probably all I’m going to invest in my career for now. I will soon focus on reducing my debt. I may invest in some more video production equipment and software eventually.

Posted in General | Leave a comment

Integrating Custom Help Into Visual Studio

I have figured out how to convert my Notes.chm HTML Help file into the new Help 2.0 format and how to add it to the The Visual Studio .NET Combined Help Collection. First you need to download the Visual Studio .NET Help Integration Kit 2003 at: http://www.microsoft.com/downloads/details.aspx?FamilyID=ce1b26dc-d6af-42a1-a9a4-88c4eb456d87&DisplayLang=enYou will also need far42_inst660.exe from http://helpware.net/The process is actually quite long and rather involved but the FAR Collection Wizard found in Far-V4.2.0 is the key to doing this. The Visual Studio .NET Help Integration Kit 2003 allows you to maintain your help project in Visual Studio 2003 rather than use the old HTML Help Workshop which always crashed on me.

I am really thrilled about this because I have spent years building my help file to maintain my programming notes. Now I have access to all that information within Visual Studio! I can even view it in the Microsoft Document Explorer that Visual Studio 2005 uses. I am also pleased that I can ditch the old HTML Help Workshop.

The Visual Studio .NET Combined Help Collection

Posted in General | Leave a comment

I Have A New Job

This blog post is for my clients who may be wondering what I’m doing. I was recently hired by a local company for what may turn out to be a full time job. I needed to find a full time job because I can’t afford health insurance working on my own and my debt was rising. I plan to complete any freelance projects that I am currently working on or assist in transferring the work to another web developer. Please contact me if you have any questions or concerns.

Posted in General | Leave a comment

Expertise Greed

I am quite greedy for expertise. I am always looking to increase my knowledge and improve upon my skills. It is surprising how rarely career advice mentions the importance of gaining expertise. Maybe they just assume you have the expertise when you graduate from college and begin looking for a job. Your value in the job market depends heavily upon your expertise and skill set. At least this is true in the Information Technology industry.

Unfortunately I don’t have the time to study all the software and technology that I would like. I would like to learn how to customize several shopping carts and open source web applications. I would like to learn more PHP. But unless someone is paying me to work on a project using PHP or a project to customize a shopping cart, I just don’t have the time to conduct the necessary research and training. It takes a considerable investment of time to learn new technology and you really need to be realistic about how much you can handle. Therefore it is necessary to pick and choose. You need to evaluate the popularity of open source web applications and programming languages and choose just a few to specialize in.

There are a few areas where I need to improve upon my existing expertise. I need a firmer grasp of SQL. I know SQL quite well except for some more complicated queries using Inner and Outer Joins. Recently I had the occasion to explore ALTER statements to change a table design through queries. I usually do that using the SQL Server Enterprise Manager but sometimes you have really limited access to the database. I’m tempted to learn Oracle but most of my clients cannot afford Oracle so this is something I shouldn’t be too greedy for.

I’ve been using Visual Studio 2003 a lot for a current project so I’ve invested more time learning how to be more efficient using this IDE. I used to do a lot of my programming in FrontPage or Ultra-Edit but now I use Visual Studio. Maybe I should buy a book devoted to Visual Studio to really delve into its inner workings.

I have been investing a lot more time in polishing my ASP.NET skills. I’ve been doing a lot of work with XML. I’ve learned how to convert a dataset into XML and store it in a memory stream. Storefront 6.0 uses XML in a memory stream to store a lot of data so it does not have to make repeated database connections to retrieve basic information. I recently learned how to export that site XML to a file. This will be very useful in debugging my Storefront customizations because now I can see if database changes are reflected in the data that is kept in memory as XML.

One aspect of programming that I really need to master is object oriented programming. VB.NET now supports OOP but you really don’t need to create a class for most web applications. Creating a class for every object just creates extra effort. Most of the time you are not going to be reusing an object beyond the one web page. That being said, every ASPX page in an ASP.NET web application is technically an object with its own class and you need to deal with many built-in classes. However, I rarely create a class from scratch so that is something I need to practice. Storefront 6.0 uses a great many stand alone classes to represent objects like customers, order items, shopping carts, etc. Since some Storefront customizations require me to add new members, methods, and properties to existing classes I am finding it necessary to struggle with OOP.

Posted in General | Leave a comment

Netvibe’s Universal Widget API

Netvibes has developed an Universal Widget API which can be used to create widgets that work on multiple platforms. Currently a widget using their API will work on Google IG or the Netvibes mashup site. You can find the documentation and forums on the UWA at http://dev.netvibes.com/doc/.

I have created a few widgets but they don’t work on Google IG or Netvibes. They usually only work when I open them in my browser as a file on my system. This has been very frustrating for me. The problem is their sandbox which does not allow you to get XML from a third party web site. You are supposed to use a PHP script as a proxy to work around this problem. However, this does not always work for some reason. Another problem I have is that my web hosting company is adding a script at the bottom of my web pages for the site statistics. This script is preventing my Netvibes widgets from being well-formed HTML so they won’t work on Google IG or Netvibes.

I do have an example widget for Stickam that you can view but you will be unable to use it on Google IG or Netvibes.

http://www.williamsportwebdeveloper.com/Stickam.html

I was also thinking about developing some Pageflake widgets but I really need a development web site where I can host my projects.

Posted in General | Leave a comment

ASP.NET Mastery – Expanding My ASP.NET Expertise

It can take a long time to learn a programming language. After the initial period of study during which you learn the language syntax, there is a long period of learning how to do various useful tasks. For a programming language used in web applications, you need to know how to do these things; send emails, connect to a database and perform the CRUD functions (Create, Report, Update, Delete), parse text using regular expressions, generate Excel spreadsheets and Word documents, create text files, transform XML using XSL, determine if services are running, show disk space usage, list files in a directory, validate forms, etc.

I have been spending a lot of time recently polishing my ASP.NET skills. I’ve been adding a lot of material to my notes. Among the recent additions to my ASP.NET expertise is how to get the disk free space and disk used space totals using VB.NET. I was surprised to find that this simple task is not well documented but eventually I found some code that uses the Windows API to get this information. Maybe there is an easier way but at least I have an example of making Windows API function calls.

I’ve also learned how to do some simple AJAX using ASP.NET 1.1. There are AJAX Extensions for ASP.NET 2.0 but I have not learned how to use them yet and I cannot upgrade some client applications to ASP.NET 2.0 unless they request it. Therefore it was quite useful to figure out how to do AJAX with ASP.NET 1.1. This also required me to fill out my knowledge of how to work with XML in ASP.NET. I learned how to use a Memory Stream for the XmlTextWriter to use and how to use a XmlTextReader to load that into a XML document in order to perform a XSL transformation. I also learned how to transform XML from a remote server which is useful for consuming web services.

I worked out how to detect if a form is dirty (i.e. fields have been edited) and prompt the user to save his data before navigating away from the page. This is a technique that I stole from the Storefront 5.0 Merchant Tools but getting it to work with ASP.NET proved to be tricky because you need to get the JavaScript to invoke the server button web control’s button click event.

Last night I expanded upon my knowledge of the DataGrid which proved to be more spotty than I realized. I learned how to set the PagerStyle to the NumericPages mode. I also worked out a more complete example of how the TemplateColumn should be used to edit multiple fields in a row. The example from my book did not illustrate this very well.

Most of my work with ASP.NET has been to customize Storefront 6.0 but that does not require much original programming. I’m now doing a lot more ASP.NET work from scratch.

Posted in ASP.NET | Leave a comment

SQL Server Data Import – How To Preserve Primary Keys and Identity Fields

One of my biggest problems working with SQL Server databases is preserving my primary keys and identity fields when I try to copy tables from one database to another. The SQL Server Import and Export Wizard likes to remove primary keys and you lose your identity fields. This results in many errors when the web application attempts to insert new records without providing a value for the identity field because it is suppose to auto-increment.Today I figured out how to work around this problem using SQL Server 2005. Needless to say, I did not find much information about this topic on the Internet. The first thing you should do is run the Script Wizard to generate CREATE statements. Make sure the Script Primary Keys option is set to True. The tables in the destination database need to be created by running this script in order to get your primary keys and identity fields. The tables will not contain any rows of data.

Next you run the SQL Server Import and Export Wizard to copy your data into the tables. The trick here is to click the Edit Mappings button in the SQL Server Import and Export Wizard and check both Delete rows in existing destination tables and Enable identity insert in Transfer Settings.

SQL Server Import and Export Wizard

Transfer Settings

Unfortunately, this won’t help you if you want to import data into an existing table. You can’t just delete all its rows and import using identity insert or you’ll wind up with ID numbers that increment from the last value of the identity field. You need to drop the table and recreate it from a script to preserve your exact identity field ID numbers.

Posted in Databases | 8 Comments

Philadelphia YouTube Gathering

I’ve just watched Mr. Safety’s video about the next As One Gathering which will be held in Philadelphia on August 4th. I was in a Stickam chat with Nalts and Podcasting101 as they discussed their gathering in NYC on 7/7/07. There was some concern about rival gatherings and all the drama of competition but fortunately this appears to have been avoided.

I’ll probably attend the Philadelphia As One Gathering because I can drive there and drive back in one day and won’t need any hotel accommodations. I don’t know if I can go to the NYC gathering because I think traveling to NYC alone is very stressful. Maybe I can interest a local group into sponsoring a bus trip for all the local vlogger fanatics. Podcasting101 made the very good point that anyone who attends a gathering will appear in countless videos so it should not be too hard to find someone to sponsor a trip in return for the free publicity.

Although these gatherings are organized by YouTube vloggers they are not official YouTube events so I think everyone at LiveVideo should be welcome. I brought this up in the Stickam chat room and they said LiveVideo vloggers are welcome to attend.

http://www.youtubegathering.com/

Posted in Video Production | Leave a comment

Windows Server 2003 and Sharepoint

Today I got another 250 GB Western Digital hard drive that I bought on eBay. I have installed Windows Server 2003 on it in order to run Sharepoint. You cannot install Sharepoint on Windows XP. Sharepoint interests me because it uses web parts which are similar to the new web parts technology in ASP.NET 2.0. As soon as I get Service Pack 1 installed on my Windows Server 2003, I will install Visual Studio 2005 Professional and Microsoft Office Sharepoint Designer 2007. I don’t think there is a lot of custom web development being done for Sharepoint so that may be a good opportunity for me. I may develop a few web parts to sell and even create a marketplace for web parts. I have been unable to find anything like that on the Internet. I want to start using my web development skills to create my own business ventures because I’m not making enough money working on freelance projects.

Unfortunately, there were so many operating system updates to install that I spent the entire day on this task and did not get any work done on my client projects.

Posted in General | Leave a comment

Web Developers – Freelance VS Firms

Now that I’ve worked as a freelance web developer and as a web developer working for a small company that does a variety of Internet consulting and I.T. related work I have some thoughts on choosing one over the other. In my opinion, you are better off hiring a freelance web developer rather than giving your project to a firm. It does not matter how large or small the web development firm is, there will be serious disadvantages in having your project done by any firm that handles multiple projects.

For one thing, a web development firm is unlikely to spend much time on search engine optimization. They may offer SEO as a service but they are probably more interested in getting projects completed than they are in seriously helping a company rank well in the search engines. In order to get your web developer really involved in your search engine optimization efforts, you need a more intimate relationship with the developer who has to have some dedication to your project. Without this business relationship you are just going to get token efforts and a lot of reports that make it look like some SEO work is being done. SEO requires various technical skills and should not be treated as a purely marketing matter without any web developer involvement.

Another thing that firms tend to neglect is web application security. A web development firm is unlikely to want to spend the time to protect your web site from SQL injection attacks. Encrypting sensitive data to prevent embarrassing data thefts is also an extra step that a firm is unlikely to take. However, when you hire a freelance web developer that person will be free to dedicate more of his time to your project and therefore he can put in the extra effort to make the web application secure. This is particularly important for custom web applications that don’t have the built-in security of open source or commercial web applications.

In my experience, both search engine optimization and web application security are rather involved matters that require specialized knowledge which the typical web developer is unlikely to delve into. Developers tend to be isolated from the marketing concerns vital to search engine optimization. And developers are not inclined to build in web application security because they are more focused on functionality and opening up permissions to get their web applications running. Management is focused on getting projects done in a timely manner which means no extra effort will be made to promote your business or secure your data.

Posted in General | Leave a comment

Joomla And botMosXslt – XML Feeds In Portals

Last night I installed the Joomla open source content management system on my local web server and explored its ability to consume XML data feeds (web services, developer APIs, and RSS news feeds). The News Feed module did not allow me to specify a news feed stylesheet, aka XSL file, so I had to look for an extension to add this functionality. I found botMosXslt, a Mambot allowing processing from xml/xsl file using xslt processor and render the result in content. There were no instructions on how to install it so I will describe how to do so on a Windows web server running PHP 5.0:

  1. Copy mosxslt.php and mosxslt.xml to C:\Inetpub\wwwroot\joomla\mambots\content
  2. Create directory for XSL files at C:\Inetpub\wwwroot\joomla\custom\xml
  3. Select Mambots / Site Mambots in Joomla Administrator!
  4. In the Mambot Manager [Site] click the New button
  5. Enter “botMosXslt” for the Name field
  6. Leave content selected for the Folder field
  7. Enter “mosxslt” for the Mambot file field
  8. Leave Yes radio button selected for Published field
  9. Click the Save button

Joomla Msmbots

Site Mambot New

The new botMosXslt mambot should now appear in the list:

botMosXslt

Next I will describe how to use it to display LiveVideo Featured Videos and deal with an error:

  1. Select Content / All Content Items in Joomla Administrator!
  2. Click the New button
  3. Enter a title
  4. Enter the title alias
  5. Select a section
  6. Enter “{mosxslt GetFeaturedVideos.xml FeaturedVideos.xsl} ” as your content
  7. Click the Save button
  8. Copy GetFeaturedVideos.xml and FeaturedVideos.xsl to C:\Inetpub\wwwroot\joomla\custom\xml
  9. If Fatal error on xslt_create function, edit mosxslt.php

Joomla Content Menu

I got a fatal error because I did not have the required libraries to process XSLT using PHP on my system. Fortunately, I had already figured out an alternative way of doing it using the built-in capabilities of PHP 5.0. So if you get the following error add the code I list below it:

Fatal error: Call to undefined function xslt_create() in c:Inetpubwwwrootjoomlamambotscontentmosxslt.php on line 74

Edit the mosxslt.php file to work around this problem:

/* // Process xml
$xh = xslt_create();
$xsltResult = xslt_process($xh,
$fullXmlFilename, $fullXslFilename);
if ($xsltResult)
$htmlContents = $xsltResult;
else
$htmlContents = "!!! Error in executing XSLT !!!";
return $htmlContents;
*/

// Process xml on Windows
// edited by Robert S. Robbins 02/24/2007

$xml = new DOMDocument;
$xml->load($fullXmlFilename);
$xsl = new DOMDocument;
$xsl->load($fullXslFilename);
// Configure the transformer

$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl);
// attach the xsl rules
return $proc->transformToXML($xml);

Joomla - LiveVideo Featured Videos

As you can see I finally got this to work for me. However I did have to use a static XML file rather than pull the current list of LiveVideo Featured Videos using their Developer XPI.

Posted in General | 2 Comments

What Technology I Am Studying

I devote a lot of time each week to studying new technology. It is very important for a web developer to keep up his skill set because his expertise is his major asset. I prefer to learn incrementally because most programming languages and software have too many details or features to master. I can’t spend all day studying so I just try to pick up one new language feature or software feature to document and experiment with during the day. Sometimes it is just a regular expression or a JavaScript function that I found useful.

I’ve decided to give up on my plans to study Eiffel and Java Server Pages. There isn’t much work to be found in those programming languages and I do need to specialize. JSP was only of interest because a local company, Brodart, is always looking for JSP developers. I will continue to expand upon my knowledge of ASP.NET 2.0, XSLT, PHP, and C#. In regards to software, I will continue to study DotNetNuke 4.0 and After Effects 6.5. I should mention that my study of ASP.NET 2.0 will include the AJAX extensions.

I recently finished learning to use some additional aspects of database management using the new ASP.NET 2.0 Data Server Controls. I tried out the DetailsView, GridView, and FormView server controls that can be used to insert, edit, or delete records without writing any code. I also learned about CommandFields, DataKeyNames, and Parameters which are new properties and tags associated with these server controls. I’ll probably be doing more of my work in design mode within Visual Studio 2005 because it has many wizards and graphical user interfaces for working with these server controls. I rarely use design mode in Visual Studio 2003 because it does not compare with FrontPage 2003.

I have learned that DotNetNuke 4.0 has a module for XML and XSL transformations which is probably better suited for the developer APIs that return data as XML.

I put a foam windscreen on my StudioProjects B1 Cardiod Condenser Microphone and it really helps to reduce plosives, pops, and spikes.

Posted in General | Leave a comment

DotNetNuke 4 News Module and Web Parts Synergy

Tonight I tried to use some of the XSL stylesheets I created for my ASP.NET 2.0 web parts mashup in the DotNetNuke 4 web portal. I was very pleased to find that most of them work when used with the News module. The News module allows you to specify both the news feed and its news feed stylesheet so you can actually use any kind of XML feed. You can use web services, developer APIs, or RSS feeds. If you are not actually consuming a news feed then you just use your own stylesheet to control how the data is formatted.

I was able to use several of my web parts in my DotNetNuke 4 web portal because they were basically just XSL used to style XML feeds. Please see the screen shot below. I was able to use my local weather widget, the show my IP address widget, LiveVideo featured videos widget, and the actual news feed for the Newsvine Web Development Group (did not require a stylesheet). Therefore it appears as though my work with web parts will port to this web portal as long as it is based mostly on XML and XSLT (stylesheet transformations). DotNetNuke 4 does not use web parts but you can still minimize modules and move them from place to place when logged in as an administrator. I have the book Professional DotNetNuke 4 by Shaun Walker and others from WROX Press.

Dot Net Nuke 4

I’ve switched form using ASCX user controls for my web parts to using VB class files that are real web part controls. I made the switch because you can use title icon images in your web parts when they are actual web part controls. I really wanted those icons in my project because I’m an icon freak. I have a large collection of web site favorite icons. You can use regular Windows icon files .ico for web parts as long as they are 16×16 pixels. I have noticed a major drawback to web part mashups. Web parts do not use AJAX so there is an annoying refresh of the web page every time I make a change.

Web Parts With Title Icons

Posted in General | Leave a comment

RegexBuddy And xmlns:media

Today I purchased RegexBuddy, a tool for creating and testing regular expressions. Regular expressions are strings that describe or match a set of strings, according to certain syntax rules. In other words, a regular expression is a complex syntax for searching through text. It is very handy for search and replace and many mundane programming tasks that require text manipulation. I bought RegexBuddy because I am doing a lot of work with XSL, stylesheets for XML. Unfortunately, there are many occasions when XSL is not sophisticated enough to pull data from a RSS or XML feed. It is often necessary to do additional string parsing using JavaScript. One of the more useful features of JavaScript is its support for regular expressions. RegexBuddy is great for creating complicated regular expressions and testing them against sample data. It will even generate some of the JavaScript code you need to use regular expressions. RegexBuddy is only $29.95 so I found it affordable.

I need to write some JavaScript functions for my XSL stylesheet I’m developing for the YouTube user RSS feed. This XML feed is using RSS 2.0 with the xmlns:media extension. The description tag has been causing me a lot of grief because it breaks the design principles of XML. The description tag actually contains 5 pieces of information; the video thumbnail, the video description, the author, the keywords or tags, and the date added. All of this information is provided as HTML within a <![CDATA[...]]>. CDATA sections instruct the XML processor that the content included in a section is not markup and should not be parsed. This makes it very difficult to extract the video description.

So far I have written the JavaScript function to strip out the newlines in the HTML, because regular expressions don’t work well on multiline text, and the function to trim the description. I’ve also come up with a good regular expression to find the text contained within the first paragraph HTML tags <p></p> which surround the video description. However, I am still having problems with the XSL which needs to pass the description element to my JavaScript function and then return a string I'll use within a title tag attribute as a tooltip. When you mouse over the video title I want to display the video description.

Posted in General | Leave a comment