Thursday, April 25, 2013

Blogs


  http://zimmergren.net/

Sharepoint Metadata Display in treeview

http://zimmergren.net/technical/sp-2010-introduction-to-programmatically-working-with-taxonomies-in-sharepoint-server-2010

Open SharePoint 2010 modal dialog and refresh the parent page from custom form

Objective:
1) Open a SharePoint 2010 popup and refresh the parent page when one closes it.
2) Build a custom form that at “submit event” closes the popup and refreshes the parent page.
Solution:
-          Open a Popup using “Javascript” and “SP.UI.$create_DialogOptions();”
-          Add the method “CloseCallback” using the “dialogReturnValueCallback” property
-          Add some JavaScript code inside the CloseCallback to reload the parent page, like the following example:

<a href="javascript:openModalDialog('form.aspx');">Open My Custom Form</a>

<SharePoint:ScriptLink ID="ScriptLink1" Name="sp.js" runat="server" OnDemand="true" Localizable="false" />

<script type="text/ecmascript">

    var options;
    function openModalDialog() {
        options = SP.UI.$create_DialogOptions();
        options.width = 300;
        options.height = 100;
        options.url = SP.Utilities.Utility.getLayoutsPageUrl('customdialog.htm' );
        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
        SP.UI.ModalDialog.showModalDialog(options);

    }

    function CloseCallback(result, target) {
        location.reload(true);
    }

</script>

Now when you close the popup, the parent page is refreshed.
If one is working with a Custom Form and wants to close the popup and refresh the parent after the Submit,
he could have two (or more) choices:
1) If you have 1 post back only, after the submit, the you can add in the page load the following:
protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                string script = "<script language='javascript'>parent.CloseCallback();</script>";
                if (!this.Page.ClientScript.IsClientScriptBlockRegistered("rKey"))
                    this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "rKey", script);
            }
        }

          2) If your custom form handles more than 1 post back, you can add the following code at one specific submit click event:
Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
Context.Response.Flush();
Context.Response.End();

Monday, April 22, 2013

Links on Programming


GetAllViewUsing Webservice
---------------------------
http://sharepoint.stackexchange.com/questions/6985/how-do-i-get-all-list-views-by-using-a-web-service

using script::
------------
http://www.c-sharpcorner.com/UploadFile/anavijai/get-all-the-views-for-a-particular-list-in-sharepoint-2010-u/

Programmatically set XsltListViewWebPart to use Summary view in SharePoint 2010
----------------------
http://jasonssharepointblog.blogspot.in/2012/09/programmatically-set.html

http://sharepointnadeem.blogspot.in/2012/08/programatically-add-xsltlist-view.html


SPView on ToolProperties:
---------------------------

http://www.sharepointkings.com/2008/08/create-custom-listviewwebpart.html


SPGridView
------------

http://kalaimossblog.blogspot.in/2011/10/binding-spgridview-spview-items.html

http://sharepoint.coultress.com/2008/06/build-spgridview-columns-dynamically.html

SP Default Behaviour
-------------------
http://karinebosch.wordpress.com/sharepoint-controls/the-listviewbyquery-control/

Friday, March 29, 2013

Tuesday, March 19, 2013

Cascadin Dropdown in Sharepoint2010

Down Load Js file from this Link
http://www.c-sharpcorner.com/uploadfile/Roji.Joy/cascading-dropdown-in-share-point-using-jquery/

<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery-1.8.2.js"></script>
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
    relationshipList: "Regions",
    relationshipListParentColumn: "Country",
    relationshipListChildColumn: "Title",
    CAMLQuery: "<Eq><FieldRef Name='Status'/><Value Type='Text'>Active</Value></Eq>",   parentColumn: "Country",
    childColumn: "Region",
    debug: true
  });
  $().SPServices.SPCascadeDropdowns({
    relationshipList: "States",
    relationshipListParentColumn: "Region_x0020_Name",
    relationshipListChildColumn: "Title",
    relationshipListSortColumn: "ID",
    parentColumn: "Region",
    childColumn: "State"
  });
});
</script>


Fore More info ref links..
http://basquang.wordpress.com/2010/09/21/spservices-cascading-drop-down-list-in-sharepoint-2010-list-using-jquery/

 

Monday, February 25, 2013

How To Use Multiline Text Field as Calculated Column in Sharepoint?

Following are the Steps to use Multiline Text Field as Calculated Column: 

1. Create a Single line text column . ex, Newsfeed

2. Create a calculated column using the above single line text column.(and select number as data type if u renders any html output )

3. Delete the Single line text column created on step1.

4. Create the multi line text column with the same name as single line text column has,ex Newsfeed.

Now the multiline text is used as calculated column ..

Note: If U want to display any string as Html rendering y must follow above steps..

Client Object Model Architecture Sharepoint2010

The Architecture of Client Object Model, and understand how it functions,

Image1.png

As can be seen in the above diagram all versions of the Client OM go through the WCF Web Service namedClient.svc. This Web Service is located, along with all other SharePoint Web Services, in the folder [SharePoint Root]\ISAPI. The Client OM is responsible for packaging any requests into XML and calling the Web Server, however, when this call takes place is controlled by the developer as you will see. The response from the Client.svc Web Service is sent as JSON and the Client OM is responsible for transforming this into appropriate objects for use in the environment the call was made from.

   The SharePoint Client Object Model is supported in three environments; .NET managed code, JavaScript and SilverLight.

.NET Managed Code Assemblies

To use the Client Object Model in .NET Managed code you must add references to two assemblies in your Visual Studio project. Both of these assemblies can be found in [SharePoint Root]\ISAPI folder, which is typically C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\.
Microsoft.SharePoint.Client.dll (282kb)
Microsoft.SharePoint.Client.Runtime.dll (146kb)
As you can see from the indicated sizes these are not large assemblies and won't bloat an application very much. Despite their relatively diminutive size however they pack a great deal of punch, as you will soon see.

Silverlight Assemblies

Just like .NET managed code, to use the SharePoint Client OM from within a Silverlight application you must add two assemblie references. These assemblies are a little trickier to find and are located in the [SharePoint Root]\Templates\Layouts\ClientBin folder.
Microsoft.SharePoint.Client.Silverlight.dll (266kb)
Microsoft.SharePoint.Client.Silverlight.Runtime.dll (142kb)
The location is understandable considering the the Layout folder is mapped to each SharePoint Web Application and the heavy use of Silverlight within SharePoint 2010. You will notice the size of these assemblies is just slightly smaller than their .NET managed code counterparts. Despite this, there is no difference in functionality.

JavaScript code(ECMA Script) 

To make use of the Client OM in JavaScript you must include the SP.js file on the page. The corresponding SP.Runtime.js will be added automatically by SharePoint.

Object Models Comparision :

Server OMClient OM
SPContext ClientContext
SPSite                                   Site
SPWebWeb
SPListList
SPListItemListItem


Tuesday, February 19, 2013

SP 2010: Introduction to programmatically working with Taxonomies in SharePoint Server 2010

http://zimmergren.net/technical/sp-2010-introduction-to-programmatically-working-with-taxonomies-in-sharepoint-server-2010

Cascading dropdown (or) Filtered Values in Lookup Columns in SharePoint

Please see the below link..

http://sharepoint-works.blogspot.in/2012/02/cascading-dropdown-or-filtered-values.html#.USOhOB0_taY

Sunday, February 17, 2013

Hide the Recycle Bin & View all Site content links in SharePoint site?

Here is How in MOSS 2007: Just add the Content Editor Web part and place the below code ( Add it in Master page if you want to apply for all sites) :
<style>
  
.ms-quicklaunchheader{display: none;}
  
.ms-recyclebin{display: none;}
  
</style>
For SharePoint 2010, CSS classes are little different
/*To Hide both */
.s4-specialNavLinkList
{
display:none;
}
  
/* To Hide Recycle bin */
.s4-rcycl
{
display:none;
}
  
/* To Hide "All Site Content" */
#ctl00_PlaceHolderLeftNavBar_PlaceHolderQuickLaunchBottom_PlaceHolderQuickLaunchBottomV4_idNavLinkViewAllV4
{
display:none;
}


Want to Hide View All Site Content / Recycle Bin Links from everyone, except Site Owners?
Yes, You can set the permission string of these links to hide it from all users except the specified in PermissionString property.

Open your master page in SharePoint designer (either MOSS 2007 or SharePoint 2010). 
In Design view select "All Site content Link"
in Tag Properties, Go to PermissionString and Enter the permission string. Say, you want this link to be available only to Site owners, then enter: "FullMask"

Display PDF Icon in SharePoint



By default, SharePoint does not include a PDF icon. So we need to do the below changes to display the PDF icon for PDF files in our SharePoint environment. Here is how:

1. Download an appropriate icon for pdf document types. you can get it from
http://www.adobe.com/misc/linking.html
2. copy the downloaded PDF icon to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\template\images" (Dont forget to set the read, Read & Execute permissions to "Domain users" to that PDF icon file!)
3. Open the docicon.xml from C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\template\xml\docicon.xml
4. Add an entry under     <ByExtension> node:
  
<Mapping Key="pdf" Value="pdficon_small.png"/>

Once done, you will get the PDF icon as per below screen

One Step Access of SharePoint Feature Solution



  •  Add web parts to any page: append  ?PageView=Shared&ToolPaneView=2
  •  Create New Site Content  /_layouts/create.aspx
  •  List Template Gallery: _catalogs/lt/Forms/AllItems.aspx
  •  Master Page Gallery: _catalogs/masterpage/Forms/AllItems.aspx
  •  Manage your Alerts  _layouts/SubEdit.aspx
  •  Manage Site Collection Administrators  /_layouts/mngsiteadmin.aspx
  •  Manage Sites and Workspaces /_layouts/mngsubwebs.aspx
  •  Manage People  /_layouts/people.aspx
  •  Manage User Permissions /_layouts/user.aspx
  •  Modify Navigation  /_layouts/AreaNavigationSettings.aspx
  •  Recycle Bin /_layouts/AdminRecycleBin.aspx
  •  Save Site as Template: _layouts/savetmpl.aspx
  •  Site Settings page: _layouts/settings.aspx
  •  Site Template Gallery : _catalogs/wt/Forms/Common.aspx
  •  Site Column Gallery  /_layouts/mngfield.aspx
  •  Site Content Types /_layouts/mngctype.aspx
  •  Site Content and Structure Manager /_layouts/sitemanager.aspx
  •  Site Usage Summary /_layouts/SpUsageWeb.aspx
  •  User Alerts  /_layouts/sitesubs.aspx
  •  View All Site Content /_layouts/viewlsts.aspx
  •  Web Part Gallery: _catalogs/wp/Forms/AllItems.aspx
  •  Web part maintenance mode:  append ?contents=1 to the URL of the page