Monday, September 27, 2010

Web Dev Network Growth, XML and Road to GeoRSS



Join
The Web Dev Network is growing fast. I created this group on July 1, 2010 and we have members on six continents in eight countries. The Web Dev Network's most recent online meeting's topic was about XML. I am starting a companion post to the last meeting which will lead up to October's meeting about GeoRSS. The companion post will be a re-cap of the online meeting that we had on September 24, 2010.


First we are goinng to start with a very basic block of XML. This block of XML code has three items that make it so that it does have some value.

<?xml version="1.0" encoding="utf-8"?>
<rootElement>
<docElement>Add your content here.</docElement>
</rootElement>

The first line is the XML declaration. It is the first required piece of a well-formed XML document. The second line displays a tag named rootElement. This is the root element of the XML document. All XML documents must have a root element. The root element is basically a container for the rest of your document. The third line is a child element. The child element is where your content of your XML document will. That's if for this now. We will build extend this example in my next post as we continue to build our way to GeoRSS.

Now, as I said, here is a basic example to automate the creation of this document using HTA for a graphical user interface and VBScript.

All you have to do is copy the code into a text editor and save the file as createXml.hta.
Now, if you are not sure how to do this, please comment. My postings will be geared to providing working code and I won't provide step by step instructions, but if the need is there I can back up and help out.

Copy on next line:

<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
'********************************************************************************
'*                                                             
'* HTA Name:    createXml.hta                                    
'* Author:         Chris Sergent                                        
'* Created:        10/5/2010                                        
'* Description:    This HTA dynamically creates an xml skeleton document.
'*                                                    
'********************************************************************************
'*                    HTA DOCUMENTATION                        
'*                                                    
'* Any HTA changes will be documented here with date, change and author.    
'*                                                    
'********************************************************************************
'*Graphical User Interface Section                                
'********************************************************************************
-->        
<head>
<!-- Application Name is the name of the HTA application that would appear in
Windows Task Manager. -->


<!-- Properties that can be set.
    - Border    Type of window borders
                Define the border as thick for a resizable border
                Define the border as thin for a non-resizable window
                
    -WindowState    Default state is normal out of the three possible,
     (Normal, Minimize, Maximize)
    
    For the following properties, use the value yes to display and the value no,
    to not display. All defaults for these properties are yes.
    -Caption
    -MaximizeButton
    -MinimizeButton
    -Scroll
    -ShowInTaskbar
    -SingleInstance    Specifies if multiple instances are allowed to run
    -SysMenu        Determines if the application will display the System menu
    -->


        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        
        <title>HTA XML Skeleton Creator</title><!-- Caption To display On title bar -->
<!--
'********************************************************************************
'*                                                            
'*                        SETTINGS FOR HTA                        
'*                                                            
'********************************************************************************
-->
<!-- Although HTA has defaults, I have entered the defaults in manually, so you
can see the    syntax and change them as you see fit. The settings are divided
into two groups, required or optional. The required information is either a
must have or something that    might be very noticeable if you ignore.
-->
<HTA:APPLICATION>
        <!-- Required -->
        APPLICATIONNAME="Resume Creator"
        SCROLL="yes"
        SINGLEINSTANCE="yes"
        WINDOWSTATE="maximize"
        
        <!-- Optional -->
        Border = "thick" <!-- No default -->
        Caption = "yes"
        MaximizeButton = "yes"
        MinimizeButton = "yes"
        ShowInTaskbar = "yes"
        SysMenu = "yes"
        
</HTA:APPLICATION>
        
    </head>


    
    <script language="VBScript">
'************************************************************************************
'*                                                         
'* Script Name:    Scripts are Object Oriented and are named in each sub.
'* Author:         Chris Sergent                                    
'* Created:        11/8/2007                                        
'* Description:    This script is a starter template for writing scripts in HTA.     
'*                As usual, I have added information that appears to be found
'*                frequently in various authored scripts eliminating the need to
'*                re-type this.    
'*                                                        
'************************************************************************************
'*                    DOCUMENTATION                            
'*                                                        
'* Any script changes will be documented here with date, change and author.
'*
'*    1/23/2009
'*    This script now generates a complete web page with head, title, meta, paragraph,
'*     and body elements.         
'*                                                        
'************************************************************************************
'* Initialization Section                                        
'************************************************************************************
    Option Explicit
'************************************************************************************
'* Declare Constants                                            
'************************************************************************************
    Const ForAppending = 8    'Allows for adding information to a file
    Const ForWriting = 2    'Writes to a file(writes over existing file as well)
    Const ForReading = 1    'Reads a file
    
'************************************************************************************
'* Define Variables                                            
'************************************************************************************
    'Path Variables
    Dim strTemplate    'Template File Location
    Dim strDocument    'Documenting the Log File
    
    'WMI Variables
    Dim objWMIService, objOSItem, objCSItem
    Dim colCSItems
    Dim strComputer
    strComputer = "."
    Dim strUserName
    strUserName = "HKCU\Software\Microsoft\Windows\" &_
                "CurrentVersion\Explorer\Logon User Name"


    
    'FSO Variables
    Dim objFSO        'File System Object
    Dim objFile        'File Object
    Dim objTSO        'Temporary System Object
    Dim objFolder 'Folder Object
    objFolder = "C:\Templates\"
    
    'Window Variables
    Dim intLeft, intTop, inthorizontal, intVertical
    
    'GUI Objects
    Dim strTemplateName 'Path of Template
    Dim txtTemplateName
    Dim txtTitle
    Dim txtHead


        
    
'************************************************************************************
'* Set the Values for the Variables                                    
'************************************************************************************
    'Set up an instance of the WshShell object
    'Common Variable Values


    'WMI Values
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" _
        & strComputer & "\root\cimv2")
    


    Set colCSItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
                                        
    'FSO Values
    Set objFSO = CreateObject("Scripting.FileSystemObject")




    
'************************************************************************************
'* Main Processing Section                                        
'************************************************************************************
'Events


Sub Window_Onload
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colCSItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
For Each objOSItem in colCSItems
intHorizontal = objOSItem.ScreenWidth
intVertical = objOSItem.ScreenHeight
Next
intLeft = (intHorizontal - 800) / 2
intTop = (intVertical - 600) / 2
    



End Sub


    'Check to see if a template already exists. The application will not overwrite
    'an existing template with the same name.
    Sub CreateTemplate
         TemplateCheck()
    End Sub
    
'************************************************************************************
'* Procedure Section                                            
'************************************************************************************
    Function TemplateCheck()
strTemplate = objFolder & txtTemplateOutput.value
        

Msgbox strTemplate
If objFSO.FileExists(strTemplate) Then
Msgbox "Document Exists"
         Exit Function
    

        


        Else
         If Not objFSO.FolderExists(objFolder) Then
         objFSO.CreateFolder(objFolder)
         End If
         strTemplate = objFolder & txtTemplateOutput.value
                objFSO.CreateTextFile(strTemplate)
             Set objFile = objFSO.OpenTextFile(strTemplate, ForWriting)
                
                 objFile.WriteLine "<?xml version=" & """1.0""" & " encoding=" & """utf-8""" & "?>" & vbcrlf & _
                                        "<rootElement>" & vbcrlf & _
                                        "<docElement>" & vbcrlf & _
                                        "Add your content here." & vbcrlf & _
                                        "</" & "docElement>" & vbcrlf & _
                                        "</rootElement>"
                 objFile.Close()
         MsgBox strTemplate & " Created"
        End If
    End Function
    
    
</script>
<!--
'************************************************************************************
'* HTA GUI Section
'************************************************************************************
-->
<body>
Enter a title (Example:skeleton.xml)<br />
<input id="txtTemplateName" type="text" value="skeleton.xml" name="txtTemplateOutput" style="width: 336px"/><br />


    <br />
    
    <input type="button" value="Create Template" name="run_button" onClick="CreateTemplate">
<p>


<span id = "DataArea"></span>
</p>
</body>
</html>
<!--
'************************************************************************************
'* Nothing To See Here - Please Move Along
'************************************************************************************
-->

Don't copy this line or any after this one.

Later this week, we will finish the XML document and start an XSD. Next up, I will add a Python example that creates the same XML file. This may seem simple now, but we will be building on this in multiple languages, scripting and code.
Do you have any cool code you would like to share with us?

Wednesday, September 8, 2010

Web Dev Network - My Accidental International Group


Before reading this, you should be aware terms may be used that will not be explained, but the group I reference will do just that. If you want to know more about the Dev Meet Up hosted by ESRI coming to Decatur, you should read Part I.

With so many resources online, in an effort to tame the beast of information; resources have been created such as twitter, LinkedIn, Facebook and more. There have even tools to bring those resources together like Tweetdeck. But with all of the resources and integration tools that highway of information can still become a blur.

The benefit of connecting to the world allows for access to a great deal of information. Unfortunately there is a lot of bad, outdated, incorrect, and copied or you pick problems that you have run into. The negatives of increased information access will quickly become visible if you are a programmer like me. But there are other options.

Sign up for a social network account; I like to call them Pro Networks as it relates to the main purpose as to why I use them. My twitter account is basically made up of people that I follow in the field of GIS and programmers. When you want to interact with your peers, your tweet can be swept away by the tweet fleet. These are people that post so much you may miss most of the posts that you follow. Again, we narrowed the internet information, but it is still not effective. What is the best way to share information that is quality? There is a way to do that too.

People. Meet the people behind the icon. At conferences, training, and professional meetings; we have the chance to talk to our peers. There is also a chance for us to present to many at one location. So, we have a solution for acquiring good information. But where are the people in your own area and professional field. So, here we are good information without the ease of locating our peers or mass information that may be bad that makes our peers more visible. Which do you pick? By accident, it has become very clear. The one you pick is - both. We will look at that in just a moment as I will bring all of this together, but I have to add one more piece.
I am a web developer, programmer, gadget geek. If it's tech, I want to learn. But as a web developer in GIS, there is another dynamic. GIS is not all I use for my development. What happens when you go outside the scope of support for any organization? And welcome to the gray area of programming, the neutral zone of support. When support steps back, it's time for us to step up. Remember how you are told to write efficient code. How valuable is efficient support?

As a web developer and I am including mobile, we all have to resolve the issue of finding the starting line. The more you integrate, new starting lines pop up and then you stop in the middle of the race and ask; what am I supposed to do now? In web development, there is something call the separation of content, presentation and functionality. Now these three areas can actually be broken down even further. So we are now in a new area, but a very similar concept. Now we need to know all of the pieces of web development, but we also need to know the details. If you try combining this with professional interaction and are either confused or frustrated and want to stop reading - WAIT! What if there was a way to resolve these issues and someone was attempting to offer genuine help. Well I am. Now that I have gone through a few issues that you may have run into, I know there are more. But I think we can work together and knock these barriers down. Let me tell you about the Web Dev Network - My Accidental International Group.

The Web Dev Network is nothing I ever considered starting. I have a lot of ideas, good and bad alike, but this one came to me out of a series of events. And yes, Needs - Mother of Invention.

All I really wanted to do was Meet Up with my peers to discuss programming and there is one happening in the city I work. We are having a GIS Dev Meet Up. The great part about this is that it has a narrow focus to maximize content quality for GIS development and it's in my geographic areas. But there is the other issue; I think there should be more events like this in other areas. For this to ever happen, I depend on the developer community. As far as the meeting for brainstorming on code that I wanted to have, I posted it on Twitter so others in Illinois could come to the meeting. After posting, I was asked if the meeting could be online. With the idea that it could be accomplished and not necessarily having the resources, I said yes. Fortunately, USGS came to my rescue and with the help of Shelley Silch of the Geospatial Liaison for Illinois in Urbana; we had our first online meeting in May 2010. Shelley connected us from Urbana and I presented from Decatur. The meeting was live with screen sharing and "hot screen" sharing and the opportunity for the group to communicate just like you would at any meeting. Not only that. Audio and screen recordings were made for others that may not have had a chance to attend.

To announce meetings, I initially started announcing on twitter and Lone GIS Pro; a group on Google and e-mailing. If you don't have a GIS team and you want to be connected to your peers, you may be interested in Lone GIS Pro. Please let me know if you are. But as far as notifying others of meetings, I needed a better way for sharing. I joined several groups with areas of focus that I am interested in individually, but to get the word out, I started the group Web Dev Network. This would help me get the word to the attendees from several states. But I received requests to join the group from Canada and countries in Europe and Asia. With the opportunity to remove one barrier, the Web Dev Network became international. Wait a second. Now this will just become one of those groups that as it grows individuals will disappear and activity will do the same.

My goal is for the Web Dev Network to be the largest small group that facilitates sharing knowledge among professionals. This way we can become part of a group and work together to make it grow, and this should facilitate the visibility of our peers in our own geographical regions. As the group grows, it would help to have volunteers to take the lead at the various levels to maintain the local level person to person interaction. Please let me know if you are a member of the Web Dev Network and you are interested in helping. Together we can grow as small team of professionals while filling a need in the pool of knowledge with integrity.

With that, I know where I want to grow with this group. If you would like to grow this way too, please join us and we will grow together.

Thanks.

Hope to share with you soon.

Chris

Monday, September 6, 2010

GIS - Removing The Barriers Of Geography To Open The Corridors Of Knowledge

With ESRI, hosting Dev Meet Ups across the country, I wanted to share why these little events are huge opportunities. An invaluable resource that any developer can acquire is connecting with knowledgeable developers in their field. Unfortunately, there are usually barriers that prevent some developers from accessing them. But even the developers that have access to what is needed to attend events, there is another roadblock that must be addressed. Which events are the best? What event will help me grow in my field and meet others that would be of value to my gowth? There are many questions that can be asked, but the point is; nobody can go to everything and travelling can have a negative impact on the time for which anyone has to gain knowledge.

Now, we have ESRI Dev Meet Ups for the first time, and for many a barrier of meeting fellow developers and ESRI staff has been removed. Don't be too quick to dismiss such an opportunity as something that may not pertain to you or your organization as some of the good things that can be taken away from events never has been, never is, and never will be advertised. Here are a few.

I have had the opportunity to meet the founder and President of ESRI, Jack Dangermond while taking Developing ArcGIS Server Applications with the Web ADF. If you want to know how I got that chance; I will tell you my secret. I walked up to him and introduced myself. He was having lunch with someone at the campus cafeteria, but I enjoy GIS so much that this was not going to  be an excuse not to meet Jack. I am glad to have had the opportunity to meet him and I know from reputation and experience that the GIS community is very important to Jack and what we have to say. If you have the opportunity to meet him; I encourage it.

My Developing ArcGIS Server Applications with the Web ADF in .NET was taught by Rob Burke, the author of Getting to Know ArcObjects: Programming ArcObjects with VBA. He was helpful during training as well as away and I hope that you get the chance to take one of his classes as well. His presentation and knowledge add quality to the course content that can not be purchased.

During the same time period, I went to the DevSummit and met Jim Barry, ESRI EDN Manager. Well, I introduced myself to him to. I had plenty of questions and ideas. He is very interested in listening to what the developer community has to say and meeting their needs as a whole while the individual is also important, they don't take precedence over the community. And Jim will be at most of the Meet Ups. This alone is an excellent reason for all developers that can; to attend a Meet Up in their area. If you have ideas bring them and talk to Jim about them. If there is something that frustrates you or is just a concern as a developer, don't complain to the world, communicate with Jim and your fellow developers at the Meet Up.

I want to thank the City of Decatur for the opportunities that I have had for training, conferences, and other GIS events of which I have had the chance to attend. Because of these opportunities, this is the third year in a row that I have been formally recognized in the field of GIS.

In 2008,  I was the Grand Prize Winner of the ArcGIS 9.3 Release Candidate Incentive Program which allowed for me to donate the prize, an annual EDN subscription saving the city over $1,000 so that they would not need to purchase the software that I used for development.

In 2009, I was published in GIS Notes and online magazine produced by ILGISA, who is having their fall conference next month on October 20-21 2010.

And this year, ESRI asked me to provide a keynote for developers migrating from the Web ADF, an API that is being deprecated by ESRI. I will talk about migrating to the JavaScript API 2.0 and integrating JavaScript libraries, but I have developed in Silverlight as well.

I will be covering new areas that you will not see on ESRI's website including separating content, presentation, and functionality; unobtrusive JavaScript to allow for development in multiple JavaScript libraries and learn how to make the ScriptManager work with the JSAPI so you can use the AJAX Control Toolkit in the .NET Framework 4.0. In addition, I Beta tested Visual Studio 2010.

Finally, I will be sharing a new custom tool that I have created. You may have or might be using this tool, at this time, but the one I will be sharing  will remove complexity be more powerful than many like it. It will be for both C# and VB.NET in Silverlight and the JSAPI 2.0.

Don't forget while you may have started developing in these new API's, this is a good time to make a connection with developers that work in the API of your choice, allowing you to connect after the Meet Up is over when your application appears to be disconnected or simply breaks and it will.

Want to know what the new tool that I spoke about is? I plan on sharing it exclusively at the ESRI Dev Meet Up in Decatur, Illinois on September 16th! So register now and get the word out.Tweet that!

Talk to you real soon. Or do you want to hear more? If you do, check out Part II and learn about how and why the Web Dev Network was created, and why it even surprised me.

Chris

Sunday, September 5, 2010

Novice To Network Update

The Novice To Network series will have to wait as it would be a little too much content to write about in such a short time before the Dev Meet Up; so there will be a short two part post which will be titled; GIS - Removing The Barriers Of Geography To Open The Corridors Of Knowledge.

Part I is already written and it will be about the Dev Meet Up itself. I'm just tired. But I want to make sure that it still looks good after a good night's sleep.

 Part II will be about the Web Dev Network as I plan on demonstrating how both are related in providing connectivity to the community.

Talk to you soon.

Chris

Friday, September 3, 2010

Drive To Seventy-Five

With the Dev Meet Up just thirteen days away, I will be redirecting my efforts in getting the word out in a different manner in an attempt to reach more GIS developers that may still not have heard of the Meet Up coming to Decatur. The blog series, From Novice To Network came to a quick halt as soon as it began, but the activites that pulled me away from the writing have been resolved, and I will continue writing the series today.