Tuesday, December 02, 2008

Thursday, November 27, 2008

Publish Source code in Blogger

In the blogger,Click on Layout tab ->Edit HTML and put following things Before </head>

<link href='http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js'/>


2. put following things Before </body>

<script language="javascript">
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>


3. Convert your code using any WYSISYG editor (Paste in editor and copy html view of editor)

OR

Copy your code in notepad and replace all < in &lt; etc.

4. Put your updated code between:
<pre name="code" class="Cpp">
….My code here…
</pre>

SharePoint workflow development links from various sites.

Introductory material - things you should know before opening Visual Studio :

SharePoint Workflow - Workflow Basics (Training course)

SharePoint Workflows - How to collect feedback for a file (Training Course)

Introduction to workflows - Windows SharePoint Services (Introductory article)

Intermediate and advanced resources

MSDN - Delivering Modular SharePoint workflow functionality (Part 1 of 2)

MSDN - Delivering Modular SharePoint workflow functionality (Part 2 of 2)

SharePoint Workflow Resource Center - here you will find technical articles, developer documentation, multimedia presentations, blog entries, and download content to support the Workflow functionality in Office SharePoint Server 2007.

Developer introduction to Workflows for Windows SharePoint Services 3.0 and SharePoint Server 2007
MSDN Magazine - Build workflows to capture data and create documents

Developing workflow solutions with SharePoint Server 2007 and Windows Workflow Foundation

MSDN - Visual How to - Guide to SharePoint sequential workflows with Visual Studio 2008

MSDN - Visual How to - Building an Expense Report Approval Workflow for SharePoint Server 2007 using Visual Studio 2008


MSDN - Visual How to - Building simple custom approval workflows with InfoPath 2007

MSDN - Visual How to - Building state machine document approval for SharePoint Server 2007 using Visual Studio 2008

Get the selected text using Javascript

Sometimes you want to know what text the user has selected with their mouse. The below function is used to get the selected text into text area. Place the follwoing code in the head section of html

function getSelText()
{
var txt = '';
if (window.getSelection)
{
txt = window.getSelection();
}
else if (document.getSelection)
{
txt = document.getSelection();
}
else if (document.selection)
{
txt = document.selection.createRange().text;
}
else
return;
document.aform.selectedtext.value = txt;
}


call this function in the button click event or where ever you want.

<input type="button" value="Get selection" onmousedown="getSelText()"><form name=aform ><textarea name="selectedtext" rows="5" cols="20"></textarea>



Tuesday, November 25, 2008

Automation in Visual Studio 2005 for WSS v3 Feature Development

It is possible to create useful and time-saving tools for automation inside the Visual Studio 2005 IDE. In my development environment I've defined and frequently use tools to add, deploy, upgrade, retract, and delete a WSS Solution Package (wsp). My favorite of these tools is the upgrade operation, as it allows for a quick "build and test" iterative development cycle. Behind the scenes, each of these tools call the appropriate stsadm.exe operation and display the command's result in Visual Studio 2005's Output Window.

Add Solution command to tools menu of Visual Studio 2005:

Command: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE

Arguments: -o addsolution -filename "$(ProjectDir)Package\$(TargetName).wsp"

WSP Solution Deploy Global

Command: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE
Arguments: -o deploysolution -local -allowgacdeployment -allcontenturls -name $(TargetName).wsp

WSP Solution Upgrade

Command: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE
Arguments: -o upgradesolution -local -allowgacdeployment -name $(TargetName).wsp -filename "$(ProjectDir)Package\$(TargetName).wsp"

WSP Solution Retract
Command: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE
Arguments: -o retractsolution -local -allcontenturls -name $(TargetName).wsp


WSP Solution Delete
Command: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE
Arguments: -o deletesolution -name $(TargetName).wsp

Monday, November 24, 2008

Display full image on mouse click and mouse use using javascript and filters

function doImageShow(vImg)
{
if (navigator.product != "Gecko")
document.getElementById('imgCon').filters.item(0).Apply();

document.getElementById('imgShow').setAttribute('src',vImg.src);
document.getElementById('imgShow').setAttribute('alt', 'Click the image to close.');
document.getElementById('imgCon').style.display = "";
var newImg = document.getElementById('imgShow');
if (self.innerWidth)
{
frameWidth = self.innerWidth;
frameHeight = self.innerHeight;
}
else if (document.documentElement &&document.documentElement.clientWidth)
{
frameWidth = document.documentElement.clientWidth;
frameHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
frameWidth = document.body.clientWidth;
frameHeight = document.body.clientHeight;
}
else
{
frameWidth = screen.availWidth;
frameHeight = screen.availHeight;
}
iWidth = newImg.width;
iHeight = newImg.height;
if(iWidth == 0) iWidth = 500;
if(iHeight == 0) iHeight = 500;
imgPosLeft = frameWidth/2 - iWidth/2 + document.body.scrollLeft;
imgPosTop = frameHeight/2 - iHeight/2 + document.body.scrollTop;
document.getElementById('imgCon').style.position = "absolute";
document.getElementById('imgCon').style.left = imgPosLeft;
document.getElementById('imgCon').style.top = imgPosTop;
if (navigator.product != "Gecko")
document.getElementById('imgCon').filters.item(0).Play();
}
function doImageClear()
{//clear the image
document.getElementById('imgShow').removeAttribute('src');
document.getElementById('imgCon').style.display = "none";
}

place the above script in head section of html

Now place one div with syle as none, and one image with fixed width and height.
when you click on the image, the showPic function will call, which will resize your image to big one.


<div id="imgCon" style="display: none; z-index: 100;filter:progid:DXImageTransform.Microsoft.Fade(duration=0.7);
left: 10px; overflow: auto; position: absolute; top: 10px">
<div class="closeLnk" onclick="doImageClear();">
close</div>
<div id="picLibImgHolder">
<img class="imageStyle" class="galleryImg" id="imgShow" style="cursor: pointer" onclick="doImageClear();"
border="0" name="imgShowN"></div>
</div>

<img class="imageStyle" src="/PublishingImages/CFMR.jpg" width='100' height='80' id="imgCF" onclick="javascript:return showPic(this);" />

Expanding image on mouseover

This code project artical is just a javascript, that will help you to animate your image or any display article, like a div from some specified size to another size. Thus enable you to make a dynamic web page were the pictures glows from thumbnail view to a full image.

http://www.codeproject.com/KB/scripting/Expanding_Image_Animator.aspx