Thursday, December 16, 2010

Using an HTA to launch an .exe (be very afraid)


Turns out you can script a .HTA to launch just about anything. Which likely is why even the BPOS site for my RnD project blocks saving them by default.
The example below will launch an executable with a button click. One use I am considering using this for is to launch some of my legacy .exe code inside of a Share Point Web Part.
Of course if I allow access to HTA's on a production server I am just begging for the script-kiddies to turn my life into a living hell. But if I can get it into a Web Part that cannot be modified expect by me it might be worth trying.
Meanwhile here is the launcher bits for running remote desktop:
'<'INPUT style="background-color:transparent; width:160;height:25"
TYPE="button" VALUE="Terminal Svcs" ID="essctermsvcs">

essctermsvcs.onclick = function runtermsvcs()
{
var shell = new ActiveXObject("WScript.shell");
if (shell)
{
shell.run("mstsc.exe");
}
else
{
alert("Terminal Services Not available");
}
}

OLAP and SASS (get cubic)


After my first class was canceled, they gave me a 10% discount on the next, which is SASS, SQL Analytics and MDX to get into the cube.
At first glance OLAP is very similar to SQL, at which I am an old hand. But the OLAP concept is multi-dimensional cubes with a lot of spreadsheet type functionality.
Here is a code snippet:

SELECT
{ [Measures].[Store Sales] } ON COLUMNS,
{
[Date].[2002],
[Date].[2003] } ON ROWS
FROM Sales
WHERE (
[Store].[USA].[CA] )

That translates into the cube above, with a measurement dimension of sales, two date dimensions for 2002 and 2003, all sliced by the state of California.

This could be an interesting and useful class

Thursday, December 9, 2010

Adventures with IPSec


Looking at how to control access on what MS calls an External Secure Communication Mode for SharePoint and Project Sophia I ran across the improvements made by MS in Windows 7 to IPSec configuration.
First question out of the box is, can I dump the gunky Sonicwall Software VPN that is such a pain?
Second question is what is up with the "Join to your companies Domain" stuff?
When I have the answers, I'll update this post...

Wednesday, December 8, 2010

@Home php equal to an RSS Feed

Is something that I can never remember...

So here: http://essc-home.org/feed.php

Friday, November 19, 2010

Bypassing Validation

To test my IIR Form, I needed to bypass all the Infopath required fields. My method was simple enough, I saved a copy of the form to a local drive as testbeta.xml, and then replaced the input for the webservice with an xmldocument type taht loaded the test form...

xmlDoc := XmlDocument.Create;
xmlDoc.Load('C:\testbeta.xml');
Root := TParticipantRecord.Create;
// Root.LoadFromXML(Root,IIRForm);
Root.LoadFromXML(Root,xmlDoc);

Friday, November 12, 2010

The Roadmap

Big...Huge...Gigantic...

I’ve been asked for an expanded vision for ESSC I.T.

I get the understanding that the gloves are off and we need to push forward under the assumption that the resources can be found, likely using grants and such. Considering the mess that C.A.D.D.I.S and the boys from Oracle left behind it is both exciting and a bit frightening to consider that little old me might be allowed to take a shot where all the old gods failed…

The key, in my own mind, is to decouple the different parts into something far more flexible than tradition allows, balancing the rigor of the ‘reported’ data entry with the ad-hoc nature of InfoPath forms services.

Thursday, November 4, 2010

Drop Dead Drop Downs



When consuming a dataset created from a table with a key and description, by selecting at the top element and splitting the value and display, we can get a return value in the xmlDocument to post the foreign key and bind the joins together.

In this case the segment of xml is like:




->editregion
id->1
Desc->North Los Angeles
vpid->1227
vpname->Kolenda, Kathleen
vpstring->Kolenda, Kathleen
->/editregion


Then if the default value is -1, the value returned can be handled by determining if the result sent is a -1, in which case the source for VPName is the value (or in this case the VP’s Employee ID Number). What is funky is that the VPName will be the Display Name rather than the value if it’s an edit but if left untouched the VPName will be the Display Value. My solution is to load the table with a VPString field that doesn’t show and has the original name so that if they don’t match I know to use the VPName field but if they do I can use the VPID field.

With this code segment to load the repeating group in the main data section, I can get around the funkyness…


function LoadESSCRegions()
{ // Get the list of Services. var
regions = Document.GetDOM("AsRegionsList").selectNodes("//REGIONS");

// If nothing was found, then return; there will be no items to
insert.
if(regions == null)
{

XDocument.UI.Alert("Error-> Unable to load Regions List");
return;
}

var reg;

while
(reg = regions.nextNode())
{
var row =
XDocument.DOM.selectSingleNode("//my:myFields/my:RegionsTable/my:EditRegions");
row = row.cloneNode(true);
row.selectSingleNode("my:ESSCRegion_ID").text
= reg.selectSingleNode("ESSCRegion_ID").text;
row.selectSingleNode("my:RegionDescription").text =
reg.selectSingleNode("Description").text;
row.selectSingleNode("my:RegionIsActive").text =
reg.selectSingleNode("IsActive").text;
if (reg.selectSingleNode("RVP") ==
null)
row.selectSingleNode("my:RVPID").text = "-1"
else
row.selectSingleNode("my:RVPID").text = reg.selectSingleNode("RVP").text;

if (reg.selectSingleNode("NAME") == null)
row.selectSingleNode("my:RVPString").text = ""
else
row.selectSingleNode("my:RVPString").text =
reg.selectSingleNode("NAME").text;

var parent =
XDocument.DOM.selectSingleNode("//my:myFields/my:RegionsTable");
parent.appendChild(row);
}

}