Tuesday, September 29, 2009

Error: Cannot make a cache safe URL for "createsilverlghtobjects.js", file not found

Error:
Cannot make a cache safe URL for "createsilverlghtobjects.js", file not found.

Reason:
You may not copied the "createsilverlghtobjects.js" into "_layouts" folder. You may be modified the "_Layouts" site path to some other location, instead of default location like 
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS_10002\".

But silverlight application will look into the physical path of "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033" folder.

Answer:
So, put that  "createsilverlghtobjects.js" file or someother required files into "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033" folder. 

Friday, September 25, 2009

How To: Integrating Silverlight User Control with SharePoint WebPart (MOSS 2007)

Silverlight with MOSS 2007
Developing a webpart may be very simple. Likewise, Developing a Silverlight application also will be very simple. But, If you are going to integrate both areas, that will be difficult little. Here, I am going to tell you that what are necessary steps that needs to be followed, while integrating the MOSS & SILVERLIGHT.

OK. See the steps below. (I assumes that you are familier with creating SharePoint webpart & creating sivlerlight Web applications.)

1. Whenever you are creating Silverlight applications, you can see a "Silverlight.js" file in your "Web" folder. For example, if your application name is "HelloWorld", your visual studio will create another folder with the name of "HelloWorld_web" or "HelloWorldWeb". Within this folder, you can see a file "SilverLight.js". Copy this file and paste it into "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033". (Note: you should paste that file, only into this folder. Else, you will get an error".

2.  Create an Silverlight application and generate a XAP file.

3. Go to "c:\Inetpub\wwwroot\wss\VirtualDirectories\7070" and create a folder named "ClientBin" and give permission to Read & Write (for everyone). 

4. Go to IIS 

5. Go to Your SharePoint portal and make the "ClientBin" folder as a Virtual Directory.

6. Copy the Silverlight Application DLL & XAP file into this ClientBin folder.

7. Modify the Web.Config file to integrate the Silverlight. You can download a sample web.config file in the "download" section of http://www.codeplex.com/SL4SP

8. Create a Webpart. You can use WSPBuilder to create a Webpart. You can download a WSPBuilder from http://www.codeplex.com/wspbuilder

9. Add 2 references in WSP Project (System.Web.Extensions & System.Web.Silverlight)

10. In the WebpartCode, you must inherit the below 2 namespaces.
a. using System.Web.UI.SilverlightControls;
b. using System.Web.UI.WebControls;

11. Write a code to call the XAP file within the "CreateChildControls" method like. 
Silverlight sl = new Silverlight(); 
sl.ID = "MYSL"; 
sl.Source = "/ClientBin/SenSLMOSS.xap"; 
sl.Height = Unit.Pixel(420); 
sl.Width = Unit.Pixel(420); 
this.Controls.Add(sl);

12. "ScriptManager" code also should be placed inside the WebPart code. See the sample code below and this code should be inside the "OnLoad" method, like,

  protected override void OnLoad(EventArgs e) 
{
 if (!_error) 
try
 { 
base.OnLoad(e); 
ScriptManager sm = ScriptManager.GetCurrent(this.Page); 
if (sm == null) 
sm = new ScriptManager(); 
Controls.AddAt(0, sm); 
this.EnsureChildControls(); 
}
 catch (Exception ex) 
HandleException(ex); 
}


13.  Add & Deploy the WSP Webpart using stsadm command. 
(stsam -o addsolution -filename "C:\SLMOSSWebPart.wsp")

14. Create a "WebPart page and insert this webpart into that newly created page.

15. You will see an amazing SilverLight Page.

Thats  it...

Error: Could not complete the operation due to error 80000012

Reason: 

While integrating the Silverlight XAP files into MOSS 2007 webpart, you will get this error. Because, your given path may not be in correct format.


Answer:
You may have mentioned the XAP file path like "\ClientBin\HelloWorld.xap".
Instead, use like "/ClientBin/HelloWorld.xap"




Tuesday, August 25, 2009

Microsoft SharePoint Workspace 2010 download

Microsoft SharePoint Workspace 2010 download is locked due to over response. So, we are expecting the beta release at any time. 

However, As per their blogs, I am listing some of the key points of SharePoint Workspace 2010:

1.  Groove will be known as SharePoint Workspace Manager.
2.  SharePoint Server 2010 will be 64 bit only.
3.  IE 6.0 will not be supported.
4.  SharePoint Workspace Manager and OneNote will be a part of the Office 2010 ProPlus SKU.
5.  Migration should be smoother from 2007 to 2010 than 2003 to 2007.
6.  2010 will support silverlight controls effectively.
7.  Now, you can Insert/Delete data through BDC.
8.  Faceted search has been introduced.


I will update this post, If there is any latest news about Microsoft SharePoint Workspace 2010.


Monday, August 24, 2009

Error: HTTP 404: File Not Found in MOSS 2007 (SharePoint)

Error:  

HTTP 404: File Not Found. 

(Or)

SharePoint site can not be opened in SharePoint Designer.

Reason:

Usually this error will occur due to the below reasons:
1. If the portal is not attached with "Central Administration" portal.  i.e. The portal will be running        in IIS. But the Portal site may not be created in "Central Admin". 
2. The Port may not be associated with SSP.
3. Identity of the IIS application pool may be different. or the Application Pool Identity password may be changed. 

Solution:
1. Create a new "Web application" in the same port with the previous credentials & with the same database name through the "Application Management".  And don't create "Site Collection". (This is applicable, if the problem is due to Reason 1")

2. Associate the Port (Web application) with SSP, if the reason is 2.

3. Go to IIS and open the properties of the Application pool for this specific port and update the username,password in the "Identity" tab.

Important: 
Don't forget to restart the IIS. Else, your master pages will not take effect in the "Application pages".

Thursday, August 20, 2009

Hiding Menu in DispForm.aspx (MOSS 2007)

Sometimes, you may struggle to hide the "Menu Toolbar" which is displaying in the top of the Display Form page.



You may tried to hide by editing the page in SP Designer & writing Java Scripts. But they will not reflect in page. Because, you may forgot to add the "Push" method.

OK. So, here is an sample script, that will hide the "Menu Toolbar" from the DispForm.aspx.

<script language="javascript" type="text/javascript">
function check()
{
var elements=document.body.getElementsByTagName("a");
for (var index=0; index <>
{
if(elements[index].title.toLowerCase()=="edit item")
elements[index].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none";
}
}  
var elements=document.body.getElementsByTagName("td");
for (var index=0; index <>
{
if(elements[index].innerText.toLowerCase()=="itemworkspaceurl")
elements[index].parentNode.style.display="none";
}
}  
}
_spBodyOnLoadFunctionNames.push("check()");
</script>


Once you have applied this script, final screen will be like,




That's It...

Wednesday, August 19, 2009

System.Security.Policy.PolicyException: Required permissions cannot be acquired.

ErrorSystem.Security.Policy.PolicyException: Required permissions cannot be acquired.

Reason:
The Trust level may be Mimimal.

Solution:
1.  Go  to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config
2.  Open "Web.Config"
3.  Find <trust level="WSS_Mimimal" originurl=""></trust>
4.  Replace by <trust level="Full" originurl=".*"></trust>
5.  Save and Exit
6.  Open your Sharepoint Website web.Config.
7.  Do the steps 3 & 4.
8.  Save and Exit

That's It...