Techno Curry

I am an entrepreneur who believes that the true power of GIS is yet to be discovered in every day aspects of life. As one of the primary owners of 39 Degrees North (www.39dn.com) a GIS focused company that strives to be on the bleeding edge of technology , I believe in bringing GIS to the masses at affordable cost and time investments that can help the users to achieve great ROI.

I am also a travel , motorcycle, gardening , outdoors and cooking enthusiast when I find the time in my busy schedule. Cooking being one of my great passions I always find time to do that , I also enjoy having dinner parties where I cook up a storm to feed all my friends.

How to secure your PDF files using ColdFusion

At 39 Degrees North we had a requirement to have PDF files on our website that was only for viewing and not for printing or anything else. I posted this question to the Indiana University web community and had two major suggestions , one was using Adobe Acrobat to secure the files (the cheaper solution costing about 750$ ) and the more expensive LiveCycle services from Adobe. The cheaper solution was good for our purpose. What I did not discover until later on was that ColdFusion can do exactly the same thing that Adobe Acrobat can do using the cfpdf tag and since we already had ColdFusion it was free which is better than  cheap. I wanted to share that code. Its nothing fancy just a page with a form where you can put the directory with the PDF files and the same page processes all the PDF files in that directory and secures it providing only view access.

Heres a sample PDF protected using this method http://egis.39dn.com/eGISClark/PlatsEncrypted/Pleasant_Run.pdf 

<cfsetting requesttimeout="7200"/>
<cfif structKeyExists(form, "directorylocation")>

<cfif directoryExists(form.directorylocation)>
<cfset counter = 0/>
<cfdirectory action="LIST" directory="#form.directorylocation#" name="dirlist" filter="*.pdf">

<cfloop query="dirlist">
<cfset counter = counter + 1/>
<cfoutput>
<cfoutput> #counter#</cfoutput>

</cfoutput>
<cfif isPDFFile(#dirlist.directory#&"\"&#dirlist.name#)>
<cfpdf action = "protect" 
  source = "#dirlist.directory#\#dirlist.name#" 
  newOwnerPassword = "PASSWORDHERE" 
  permissions = "None" 
  encrypt = "AES_128" 
  overwrite = "yes"
  destination= "#dirlist.directory#Encrypted\#dirlist.name#"
  >
</cfif>
</cfloop>
<cfelse>
<cfset error = "Invalid Directory " & form.directorylocation />
<cfabort showerror="#error#">
</cfif>

<cfelse>
<cfform name="InputLocation" action="" method="post">
<cflayout type="vbox" >
<cflayoutarea>
PDF Directory: <cfinput name="directorylocation" type="text" />
</cflayoutarea>
<cflayoutarea>
<cfinput name="submit" type="submit" />
</cflayoutarea>

</cflayout>

</cfform>
</cfif>

Spark Tree with a three state CheckBox

In my last blog post I talked about the Spark Tree from Maxim . When I was looking for a Spark Tree my final objective was to have a Spark Tree with a custom renderer that involved a three state checkbox. A checkbox that could show selected, unselected and "intermediate" states. After googling a bit I decided it was a good exercise to build on from scratch in Spark using Skins. It turned out to be much easier than I thought so I decided Ill share the full sample code here. 

This sample is a Spark Tree from Maxim http://kachurovskiy.com/2010/spark-tree/ that has a Custom Renderer with a 3 state checkbox that indicates when a child element is selected. I have also included a custom class for the Data which controls the child elements and parent elements states. This is just a sample so the code is a bit messy, since I did all the clean up in my main project after I established proof of concept. 

Here is the sample with view source enabled. Spark Tree with Checkbox renderer

Capture

Spark Tree Component

First off thank you to Maxim for posting a really great Spark component. It was when I was trying to wrestle with a custom renderer for an mx tree that I started looking to see if someone had developed a Spark Tree component. Not only did I find a great component but it was free to use. Maxim has created this Spark Tree component by extending the spark List component and made it really easy to integrate into your project. One of my struggles with mx tree was that when you created item renderers that had varying height, the scroll bar would keep jumping around depending on what nodes you had expanded and collapsed. The great thing about the Spark Tree component from Maxim is that it extends the list with and by setting useVirtualLayout to false you can render all the nodes at once eliminating the varying size scrollbar. It is also extremely easy to implement your own itemrenderer by using the DefaultItemRenderer as a template. 

ArcCatalog and opening XLSX files

If you have an .xlsx file you want to use in ArcGIS but do not have Excel 2007 installed, you will need to install the 2007 Office System Driver. It can be downloaded from the Microsoft Download Center. If you do not have any version of Microsoft Excel installed, you must install that driver before you can use either .xls or .xlsx files. If you have Excel 2010 installed, you must still install the driver.

http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en

ArcGIS Sever , lsass.exe , secure map services and proxy service

We run a production ArcGIS server environment with a large number of secure services and we noticed that the lsass.exe process was consuming large amounts of memory increasing in size as much as 4G+ and bringing the server to a stand still.  "lsass.exe" is the Local Security Authentication Server. It verifies the validity of user logons to your PC or server. Lsass generates the process responsible for authenticating users for the Winlogon service. The definition taken from http://www.neuber.com/taskmanager/process/lsass.exe.html . This is a known issue in ArcGIS Server and ESRI has a workaround for this in KB article 37566 http://resources.arcgis.com/content/kbase?fa=articleShow&d=37566 . If you are running a proxy service for your secure services however, the proxy service fails as soon as you implement this workaround. The problem is that you are turning off impersonation for your SOAP and REST services and by doing this , ArcGIS Server cannot access the role database (SQL Server aspnet) credentials anymore. The solution is very simple , you have to grant the ArcGIS Web Services account in step 1 of the workaround in the article , access to the aspnet db so that the particular account can access the role store. And wallah, your proxy service is good to go again.

HTTPS Data access from HTTP content

In order to access HTTPS data (requests) from HTTP pages (or Flash movies i.e. swfs ) set the cross domain policy as such.

<cross-domain-policy>
<allow-access-from domain="*" secure="false"/>
</cross-domain-policy>

The domain in the example is specified as * but you can restrict the domain as needed.

 

Adobe artilce with a detailed cross domain file specification http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html

Missing scales in the Navigation Slider in ArcGIS Flex

One of the most frustrating things that we faced while adding multiple cached services to the Map component is that we found that sometimes we were not able to see the larger scales of map services even though we knew that they existed. And after much experimentation by one of my co-worker we discovered that the Navigation Slider picks up the scales from the first service that is added to the map. So if you add the service with the largest scales first you will be able to get the correct scales on the Navigation Slider . In fact its not just the navigation slider but the whole map refuses to go the larger scales with a service with a lowest lower scale is added first.
Hope this is helpful to someone else!

Flex Remoting with ColdFusion over SSL

When I was implementing SSL for all my Flex web applications , the problem that I found was regardless of what I did from the Flex application, the remoting was always being accessed via http and not https as I meant it to be. Here is a good article describing the problem and the possible solutions from Joshua Curtiss http://blog.crankybit.com/flex-remoting-over-ssl/

Facebook Privacy Scanner

HTTP Utility from Flex Pasta

Useful utility class that uses External Interface to get HTTP parameters

http://www.flexpasta.com/index.php/2008/03/15/getting-url-parameters-host-name-port-in-flex-actionscript/