paradoxlost.com

paradoxlost development

I ran across this for the first time, and thought it was worth putting together in one spot.  I was trying to deploy a solution into my test environment, which happened to have one web-front-end server offline.  Whether or not that was the cause I have no idea, but the solution decided to sit and wait.  After doing a bit of searching, I came across the canceldeployment command, but either due to
bad luck or the net filter at work, I was unable to find out what the deployment id should be.  So I poked around a bit more and finally found the enumdeployments command.

Putting the pieces together you get:

stsadm –o enumdeployments

This will present some XML spew.  It’s easily readable, so find your solution name and get the job id. Then…

stsadm –o canceldeployment –id <id>

This will nuke the pending operation and put your solution into an error state.  You may then retract, delete, and try again.  This same process works for stuck retractions too.

I’ve been a fan of SharePoint since WSSv2 first came out. Development on the platform
wasn’t all that great though. Things changed in a big way with WSSv3, and had I known
just how easy things had become, I would have started this project a long time ago.

After being introduced to Trac a
few years ago, I immediately set up a site and linked it to my private repository.
Having a wiki and source browser tied together can be immensely useful. The one thing
I’ve always had an issue with regarding Trac is how it supports documents (barely
at all). You can attach them to pages or put them in your repository, that’s it. SharePoint,
however, was designed for document management; it just doesn’t have a way to browse
a source repository. I decided to fix that.

After fetching SharpSvn I
set about figuring out how to get it integrated with SharePoint. Eventually things
came together, and I ended up with this:

wss-svn-browser

That wasn’t enough though. I needed to be able to view those files too, and of course
I wanted syntax highlighting. I don’t remember how I found this,
but it works great. A bit more tinkering and…

wss-svn-file

Just need to do a bit of clean up and finish making the UI seamless with SharePoint.

So a dev buddy popped a question in IRC the other day.  He was trying to host
an ad/offer thing inside of an iframe, but the offer checked for this and redirected
the top page to itself.  He had been wracking his brain trying to work around
this, and it looked like an interesting problem, so I stepped up to the plate.

First we attempted to simply overwrite location.replace with an empty function. 
This seemed to work on IE but did nothing on FF3.  It also became apparent that
this method would fail as a subsequent refresh gave us different javascript that simply
changed the location.href.  FAIL.

I did a bit of googling on the issue and stumbled across a forum post suggesting the
use of onBeforeUnload on the parent page.  I played around with this idea, getting
mixed results, but since there seemed like no other way, I dug a bit deeper. 
I was trying to do this by hand, with no libraries, and decided to bring in a little
help since I didn’t care to handle all the x-browser event nonsense.  I loaded
up prototype.js and reworked my code to use it.  The following emerged:

function
windowUnload(evt) {
var ifr = $(‘ifr’);

if (ifr
== evt.element()) {
evt.stop();
}
}

Event.observe(window, ‘unload’, windowUnload);
$(‘ifr’).observe(‘unload’, windowUnload);

The id ‘ifr’ is the iframe holding the offer/ad.  This also manages to prevent
any unload checks that the embedded page might popup.

Enjoy!

DSOFile .NET

No comments

So I’ve been working with mass archiving Office documents at work lately.  Part
of this process is extracting meta data information from the files such as subject
and author.  Microsoft has had a “sample” component out for a while to accomplish
this:  DSOFile
Using this component brings up COM Interop fun which I like to avoid if possible.

Having a bit of free time on my hands, I set about looking at rewriting DSOFile using
C++/CLI.  This actually turned out to be pretty easy once I figured out how msclr::com::ptr
worked and DSOFileNET was born.

The ASP.NET AJAX UpdateProgress control is rather limited.  It only shows up
for UpdatePanels and then only for one at a time.  This was highly annoying,
since I needed it to display for the CascadingDropDown in particular.  After
a few failed attempts, I found that it is very easy to create your own control that
will work for any and all requests.

The secret for this method is found in Sys.Net.WebRequestManager.  This object
contains two methods:  add_invokingRequest and add_completedRequest.  Using
these two events, we can set a short timeout, and using a ModalPopupExtender, show
a progress alert for every background action.

var
wrm = Sys.Net.WebRequestManager;

wrm.add_invokingRequest(BeginRequest);
wrm.add_completedRequest(EndReqest);

function BeginRequest(sender, args)
{
setTimeout(‘ShowProgress()’, 800);
}

function ShowProgress()
{
//
show the modal


}

function EndRequest(sender, args0
{
//
hide the modal


}

I leave the rest as an exercise for the reader.

Something that I happened upon this week after reading one-to-many post saying that
VSTO Add-ins can’t be installed for all users under Office 2007.  I knew it worked
that way under Office 2003, and they couldn’t have broken compatability that much
in ‘07.  I was determined to find a workable solution to this problem because
the sheer administrative overhead of needing each user to run the install or another
patch mechanism was rediculous.

First, I had to identify the major difference between ‘03 and ‘07 when dealing with
VSTO:  ‘07 supports it natively.  In ‘03 all VSTO Add-ins are loaded via
a generic shim and are essentially regular COM add-ins.  In ‘07 the add-ins are
loaded directly by the Office app, ignoring the shim.  To get around this issue,
you have to cause ‘07 to load your add-in the same way that ‘03 would:  as a
COM-shimmed add-in.  Invoking this behavior is a simple stroke of the delete
key.

Setup your installer as normal, except having all registry entries defined under HKLM
instead of HKCU.  Then navigate to HKLM/Software/Microsoft/Office/[APP]/Addins/[YourAddin]. 
Remove the “Manifest” value from this key.  This value being missing causes ‘07
to load your add-in via the ProgID [YourAddin], which eventually leads it to the VSTO
AddinLoader and your real add-in via the Manifest defined under your CLSID/[GUID]
entry.

There is a downside to this method:  If your add-in crashes, it will take out
all other add-in using the AddinLoader via Office’s disabled list.