Posted at 07:20 AM in Enterprise Collaboration | Permalink | Comments (0) | TrackBack (0)
Posted at 06:09 PM in Miscellaneous | Permalink | Comments (0) | TrackBack (0)
I'm not really up for writing a long post about it unless someone cares. Post a comment and let me know. Thanks.
*** UPDATE ***
Posted at 01:21 AM in Enterprise Collaboration | Permalink | Comments (5) | TrackBack (0)
Ballmer said he expected $400 million in revenue from SharePoint, its real-time information product, though he did not specify the timeframe. "SharePoint is the number one product at this point in the history of Microsoft," he said in a presentation to software professionals in Bangalore, India's IT capital. "We expect $400 million revenue from that product line, faster than any other product in Microsoft's history."Reuters Article
Posted at 10:45 PM in Current Affairs, Enterprise Collaboration | Permalink | Comments (0) | TrackBack (0)
I'm sorry that this post doesn't really look all that good when rendered in TypePad's template. Eventually (after my trial) I will upgrade to premium and fix the template. I think that the only part that screws up is the template details and you don't really need that part anyway. If you want it... copy and paste is your friend.
Modification Details:
Let me start by saying that this is something I came up with in about 3 hours and I didn't have much time to think it through and clean it up. There is most definitely room for improvement, this should get you going in the right direction if you want to implement multiple templates on a document library.
The approach that I took is to place an XML file on the server that describes the templates that will be used. I then modify a JavaScript function that the lists use to launch a document library template so that the path of the template to load could be provided. I then use JavaScript to replace the new document button with a drop down hover menu that I borrowed from A List Apart for this demonstration.
Installing Multiple Templates:
I simply dropped the files I wanted to be used as templates in the Forms directory inside of the document library using FrontPage 2003. The folder structure for the document library looks like this:
XML Config Example:
I placed this XML file in the Forms directory inside of the document library. It will be loaded by the JavaScript and used to generate the drop down menu of template options.
1 <?xml version="1.0" encoding="utf-8" ?>
2 <templates>
3 <document title="Template One" url="https://portal/sites/teamsite/Shared Documents/Forms/template_one.doc" />
4 <document title="Template Test" url="https://portal/sites/teamsite/Shared Documents/Forms/template_two.doc" />
5 </templates>
List template modification:
This is the JavaScript function that resides inside of the list template. Since this portion of the demonstration could be kind of confusing I will post the original template and original output as well as the modified template and modified output. This is not the entire list template only the relevant portion. The easiest way to find the portion of the template that needs to be edited is to do a search on: "createnewdocument" inside of FrontPage 2003.
You can either modify the list template directly or you can extract the relevant function for the list that you are working on, modify the function, and paste it in with the rest of your JavaScript. The easiest way to do this is to use the Full Source plugin for Internet Explorer from ThunderMain Ltd.
My recommended approach is that you take the following steps to achieve the desired results:
If you are uninterested you can completely skip the List Template entries and only focus on the output entries as those are all that really matter.
Original List Template:
1 <HTML><![CDATA[
2 function ]]></HTML><GetVar Name="WPQ"/><HTML><![CDATA[createNewDocument()
3 {
4 ]]></HTML><IfEqual><Expr1><ListProperty Select="TemplateUrl"/></Expr1><Expr2><ListUrlDir/><HTML><![CDATA[/Forms/_basicpage.htm]]></HTML></Expr2><Then><HTML><![CDATA[
5 window.location = ]]></HTML><ScriptQuote><HttpVDir/><HTML><![CDATA[/_layouts/1033/bpcf.aspx?List=]]></HTML><List URLEncode="TRUE"/><HTML><![CDATA[&RootFolder=]]></HTML><GetVar Name="RootFolder" URLEncode="TRUE"/><HTML><![CDATA[&RootFolderUrl=]]></HTML><ListProperty Select="RootFolderUrl" URLEncode="TRUE"/></ScriptQuote><HTML><![CDATA[;
6 ]]></HTML></Then><Else><IfEqual><Expr1><ListProperty Select="TemplateUrl"/></Expr1><Expr2><ListUrlDir/><HTML><![CDATA[/Forms/_webpartpage.htm]]></HTML></Expr2><Then><HTML><![CDATA[
7 window.location = ]]></HTML><ScriptQuote><HttpVDir/><HTML><![CDATA[/_layouts/1033/spcf.aspx?List=]]></HTML><List URLEncode="TRUE"/><HTML><![CDATA[&RootFolder=]]></HTML><GetVar Name="RootFolder" URLEncode="TRUE"/><HTML><![CDATA[&RootFolderUrl=]]></HTML><ListProperty Select="RootFolderUrl" URLEncode="TRUE"/></ScriptQuote><HTML><![CDATA[;
8 ]]></HTML></Then><Else><HTML><![CDATA[
9 var strTemplate = ]]></HTML><ScriptQuote><ListProperty Default="Word.Document.8" Select="TemplateUrl"/></ScriptQuote><HTML><![CDATA[;
10 var strSaveLocation = ]]></HTML><ScriptQuote><Switch><Expr><GetVar Name="RootFolder"/></Expr><Case Value=""><ListUrlDir ForInstance="TRUE"/></Case><Default><GetVar Name="RootFolder"/></Default></Switch></ScriptQuote><HTML><![CDATA[;
11 var strProgID = ]]></HTML><ScriptQuote><MapToControl><HTML>|</HTML><GetFileExtension><ListProperty Default=".doc" Select="TemplateUrl"/></GetFileExtension></MapToControl></ScriptQuote><HTML><![CDATA[;
12 createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);
13 ]]></HTML></Else></IfEqual></Else></IfEqual><HTML><![CDATA[
14 }
Original List Output:
1 function WPQ1createNewDocument()
2 {
3 var strTemplate = "Word.Document.8";
4 var strSaveLocation = "https://server/sites/teamsite/Shared Documents";
5 var strProgID = "SharePoint.OpenDocuments";
6 createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);
7 }
Modified List Template:
1 <HTML><![CDATA[
2 function createNewDocument(strTemplate)
3 {
4 ]]></HTML><IfEqual><Expr1><ListProperty Select="TemplateUrl"/></Expr1><Expr2><ListUrlDir/><HTML><![CDATA[/Forms/_basicpage.htm]]></HTML></Expr2><Then><HTML><![CDATA[
5 window.location = ]]></HTML><ScriptQuote><HttpVDir/><HTML><![CDATA[/_layouts/1033/bpcf.aspx?List=]]></HTML><List URLEncode="TRUE"/><HTML><![CDATA[&RootFolder=]]></HTML><GetVar Name="RootFolder" URLEncode="TRUE"/><HTML><![CDATA[&RootFolderUrl=]]></HTML><ListProperty Select="RootFolderUrl" URLEncode="TRUE"/></ScriptQuote><HTML><![CDATA[;
6 ]]></HTML></Then><Else><IfEqual><Expr1><ListProperty Select="TemplateUrl"/></Expr1><Expr2><ListUrlDir/><HTML><![CDATA[/Forms/_webpartpage.htm]]></HTML></Expr2><Then><HTML><![CDATA[
7 window.location = ]]></HTML><ScriptQuote><HttpVDir/><HTML><![CDATA[/_layouts/1033/spcf.aspx?List=]]></HTML><List URLEncode="TRUE"/><HTML><![CDATA[&RootFolder=]]></HTML><GetVar Name="RootFolder" URLEncode="TRUE"/><HTML><![CDATA[&RootFolderUrl=]]></HTML><ListProperty Select="RootFolderUrl" URLEncode="TRUE"/></ScriptQuote><HTML><![CDATA[;
8 ]]></HTML></Then><Else><HTML><![CDATA[
9 var strSaveLocation = ]]></HTML><ScriptQuote><Switch><Expr><GetVar Name="RootFolder"/></Expr><Case Value=""><ListUrlDir ForInstance="TRUE"/></Case><Default><GetVar Name="RootFolder"/></Default></Switch></ScriptQuote><HTML><![CDATA[;
10 var strProgID = ]]></HTML><ScriptQuote><MapToControl><HTML>|</HTML><GetFileExtension><ListProperty Default=".doc" Select="TemplateUrl"/></GetFileExtension></MapToControl></ScriptQuote><HTML><![CDATA[;
11 createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);
12 ]]></HTML></Else></IfEqual></Else></IfEqual><HTML><![CDATA[
13 }
Modified List Output:
2 function createNewDocument(strTemplate)
3 {
4 var strSaveLocation = "https://server/sites/teamsite/Shared Documents";
5 var strProgID = "SharePoint.OpenDocuments";
6 createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);
7 }
JavaScript Details:
This is the JavaScript function that loads the XML file reads the template options and replaces the New Document button with the generated drop down menu. If someone wants to modify this function or any part of this article to work better or be more generalized, I would really appreciate it if you posted your modifications in the comments section. Thanks.
2 var debug = true;
3 var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
4
5 replaceNewDocumentButton = function()
6 {
7 try
8 {
9 if (document.all && document.getElementById)
10 {
11 //GET XML DATA
12 xmlDoc.async="false";
13 xmlDoc.onreadystatechange=verify;
14 xmlDoc.load("templates.xml");
15 xmlObj=xmlDoc.documentElement;
16 var templateNodes = xmlDoc.documentElement.childNodes;
17
18 var linkArray = new Array(templateNodes.length);
19 for(var x = 0; x < templateNodes.length; x ++)
20 {
21 linkArray[x] = "<a href=\"#\" class=\"ms-toolbar\" onclick=\"createNewDocument('" + templateNodes(x).attributes(1).value + "')\">" + templateNodes(x).attributes(0).value + "</a>";
22 }
23
24 //MODIFY CURRENTLY DISPLAYED HTML
25 var newDocIconCell = document.getElementById("diidNewItem").parentElement;
26 newDocIconCell.innerHTML = "";
27 newDocIconCell.innerHTML = "<IMG id=diidNewItem height=16 alt=New src=\"/_layouts/images/newdoc.gif\" width=16 border=0 />";
28 var newDocCell = newDocIconCell.nextSibling;
29 newDocCell.innerHTML = "";
30
31 var newDocCellHtml = "<ul id=\"newDocMenu\"><li><a href=\"#\" class=\"ms-toolbar\">New Document</a><ul>";
32 for(var x = 0; x < linkArray.length; x ++)
33 {
34 newDocCellHtml += "<li>" + linkArray[x] + "</li>";
35 }
36 newDocCellHtml += "</ul></li></ul>";
37 newDocCell.innerHTML = newDocCellHtml;
38
39 //CONVERT MENU UNORDERED LIST
40 navRoot = document.getElementById("newDocMenu");
41 for (x = 0; x < navRoot.childNodes.length; x ++)
42 {
43 node = navRoot.childNodes[x];
44 if(node.nodeName == "LI")
45 {
46 node.onmouseover = function()
47 {
48 this.className += " over";
49 }
50 node.onmouseout = function()
51 {
52 this.className = this.className.replace(" over", "");
53 }
54 }
55 }
56 }
57 }
58 catch(er)
59 {
60 if(debug)
61 {
62 alert(er.description);
63 }
64 else
65 {
66 return;
67 }
68 }
69 }
70
71 function verify()
72 {
73 // 4 Object completely initialized
74 if (xmlDoc.readyState != 4)
75 {
76 return false;
77 }
78 }
79
80 window.onload = replaceNewDocumentButton;
CSS Details:
This is basically all from the A List Apart article mentioned earlier.
83 body {
84 font: normal 11px verdana;
85 }
86
87 ul {
88 margin: 0;
89 padding: 0;
90 list-style: none;
91 width: 100px;
92 }
93
94 ul li {
95 position: relative;
96 }
97
98 ul li ul{
99 width: 125px;
100 border-bottom: 1px solid #ccc;
101 }
102
103 li ul {
104 position: absolute;
105 left: 99px;
106 top: 0;
107 display: none;
108 }
109
110 ul li ul li a, ul li a {
111 display: block;
112 text-decoration: none;
113 background: #E9DEF3;
114 }
115
116 ul li ul li a{
117 padding: 5px;
118 border: 1px solid #ccc;
119 border-bottom: 0;
120 }
121
122 /* Holly Hack. IE Requirement \*/
123 * html ul li { float: left; height: 1%; }
124 * html ul li a { height: 1%; }
125 /* End */
126
127 li:hover ul, li.over ul { display: block; }
Posted at 09:23 PM in Enterprise Collaboration | Permalink | Comments (7) | TrackBack (1)
I really lik CopySourceAsHtml.
Posted at 05:50 AM in Enterprise Collaboration | Permalink
It's 2:31am and I'm just getting to work on what will probably be two more hours of work before I go to bed. I will hopefully find time tomorrow to post details on the specifics of what I am doing right now. I walked around and checked out some of the amazing buildings (casinos) that they have in this city. They are very impressive... I could probably do without all the "personal assistant" brochures being shoved into my face, but other than that it was pretty fun.
I watched a bunch of people play Texas Hold'em and then I decided to go ahead and give it a shot while I was hanging out in Bally's. This was my first time ever being in a casino. I bought in at 80 dollars and I walked away about an hour and a half later with 136 dollars, so all in all I don't think that went to bad, it won't ever make me rich, but atleast it paid for the cab and dinner. I'd like to thank my coworkers for reteaching me how to play poker, it had been years since I played and since I have gotten this job I have played on a pretty regular basis.
Have a good night everyone, what there is left of it.
Posted at 10:38 AM in Miscellaneous | Permalink | Comments (0) | TrackBack (0)
Here is a cool script that I happened upon today. I've made a number of very similar scripts over the years but I havn't bothered to make any this clean. Plus they are inviting other developers to use their script. Check it out, from ESQ Software.
<script src="http://esqsoft.com/tools/expose.js"></script>
<script>expose(window)</script>
It prints out a list of properties for and the value of the property for the passed in object. Neatly displayed in a table, or atleast that's how it's being used on this page.
Posted at 02:54 AM in Web/Tech | Permalink | Comments (0) | TrackBack (0)
Last night at around 8pm I was told that I needed to be in Vegas as early as possible today, which is cool with me. The problem though was that before I made plane reservations I stepped on my laptop screen because I put it on the floor to do something and then forgot about it. I had to rush to my parents house and make reservations for tickets with an arival time a little later than I would have liked. Because I had broken my laptop, I showed up at the office this morning at 8am and had to wait around till 9:15 to get a new laptop and then I had to rush to the airport to catch my plane to Vegas.
The cabs in Vegas only take cash by the way and I didn't have any so I had to find an ATM when I got here, sucked.
So now I'm here and I'm presented with what may be an impossible problem (I don't believe in impossible, but it may difficult given time and budget restraints) that I am determined to solve, but I may be up all night doing it and I'd kind of like to check out the city. So far things are not as easy as they are supposed to be. I'll be posting some detailed SharePoint issues later today and if there is anyone out there than can help I would more than appreciate it. Thanks.
Posted at 11:54 PM in Current Affairs, Miscellaneous | Permalink | Comments (0) | TrackBack (0)
A .NET Wrapper for the Skype API
Direct link to wrapper website.
Thanks carcass!
Posted at 08:10 PM in Realtime Communication | Permalink | Comments (0) | TrackBack (0)