Friday, 31 August 2012

List Defination Type in Sharepoint 2010

Type (as shown on the Create Column page)
Field Type
Notes
MSDN Links
Single line of text
Type=”Text”
 
Microsoft.Sharepoint.SPFieldText
Multiple lines of text
Type=”Note”
In the Create Column page, can pick the type of text to allow. To enable the different sub-types, you need to set a couple of other attributes on the field element.
Plain Text
RichText=”FALSE”  (default value)
Rich Text
RichText=”TRUE”
RichTextMode=”Compatible”  (default value)
Enhanced Text
RichText=”TRUE”
RichTextMode=”FullHtml”
In addition, you can also set the number of lines to display using the NumLine attribute.
Further Information on MSDN:
Microsoft.Sharepoint.SPFieldMultiLineText
Choice (menu to choose from)
Single Choice
Type=”Choice”
Multi-Choice
Type=”MultiChoice"
Pick the display format for the Choice and Multi-Choice types, respectively:
Drop-Down Menu or Combo Box
Format=”Dropdowns”
Radio Buttons or Check Boxes
Format=”RadioButtons”
Define the options a user can pick from using the Choices element. Below is a skeleton to explain this.
<Field Name=”MyOptions” Type=……>
  <CHOICES>
     <CHOICE>Option 1</CHOICE>
     <CHOICE>Option 2</CHOICE>
  </CHOICES>
</Field>
If you would like to give the user an option to add their own value, set the attribute FillInChoice=”TRUE”.
Microsoft.Sharepoint.SPFieldChoice
Microsoft.Sharepoint.SPFieldMultiChoice
Number
Type=”Integer”
This field type also lets you define:
Minimum Value (0 for example)
Min=”0”
Maximum Value (100 for example)
Max=”100”
Decimal Places (Default is Automatic, example 2 decimal places)
Decimals=”2”
Show as Percentage (Default is False)
Percentage=”FALSE”
Microsoft.SharePoint.SPFieldNumber
Currency
Type=”Currency”
This field type also lets you define:
Minimum Value (0 for example)
Min=”0”
Maximum Value (100 for example)
Max=”100”
Decimal Places (Default is Automatic, example 2 decimal places)
Decimals=”2”
Currency Format
This sets the display format of the currency.
LCID=”3081”
3081 sets the format English – Australian. For a complete list of Locales, see the MSDN link in the next column.
Microsoft.Sharepoint.SPFieldCurrency
Date and Time
Type=”DateTime”
This field also lets you define:
Date and Time Format
Show the date only:
Format=”DateOnly”
Show the date and time:
Format=”DateTime”
Microsoft.Sharepoint.SPFieldDateTime
Yes/No
Type=”Boolean”
When setting the default value, you need to use the binary values:
No/False = 0
Yes/True = 1
Microsoft.Sharepoint.SPFieldBoolean
Person or Group
Single User or Group
Type=”User”
Multiple Users or Groups
Type=”MultiUser”
This field also lets you define:
Allow multiple selections 
Set the Type to MultUser and the attribute Mult=”TRUE”
Allow selection of
People Only
UserSelectionMode=”PeopleOnly”
People and Groups
UserSelectionMode=”PeopleAndGroups”
Choose from
If you want to limit the option list to a SharePoint Group, use the UserSelectionScope attribute. Set it to the ID of the SharePoint group (Integer value). For example, UserSelectionScope=”3”.
Show field
Set the name of the field from the User’s profile properties that you want to display. For example, show the user’s name property:
ShowField=”Name”
If you would also like to show presence (Office Communicator integration required):
Presence=”TRUE”
Microsoft.Sharepoint.SPFieldUser
Hyperlink or Picture
Type=”URL”
You can display the URL as a Hyperlink or Picture. Use the Format attribute to pick which one:
Hyperlink
Format=”Hyperlink”
Picture
Format=”Image”
Microsoft.Sharepoint.SPFieldUrl

Friday, 24 August 2012

How to Configure Default Settings for Lync 2010 Meetings

Out of the box, all Lync meetings have the following default properties:
  • All meetings are public meetings
  • Users are allowed to create public meetings
  • The conference ID and the meeting link remain consistent each time the meeting is held
  • Anonymous (unauthenticated) users can attend meetings automatically
  • Users dialing in over a public switched telephone network (PSTN) phone line are automatically admitted to a meeting
  • All members of the company hosting the Lync meeting are designated as presenters when they join a meeting
  • Attendees are not announced as the enter or leave a meeting
While most of these settings can be configured individually using the Lync client (see above), you may find it better to configure these default settings on the Lync server.

With a public meeting (the default) the conference ID and the meeting link remain consistent each time the meeting is held.  That means if you schedule back-to-back meetings, folks in your second meeting might call in early and end up on the first meeting.  If you don’t enable entry announcements, then you're really in for some surprises!

With a private meeting, the conference ID and meeting link change from meeting to meeting.  To change your default meeting type to private, execute the following command in the Lync Management Shell (LMS):
Set-CsMeetingConfiguration -AssignedConferenceTypeByDefault $false
To configure anonymous (unauthenticated) users to be placed in the lobby, rather than automatically join a meeting, execute the following command.  These users remain on hold in the lobby until a presenter admits them to the meeting.
Set-CsMeetingConfiguration -AdmitAnonymousUsersByDefault $false
To place PSTN users in the lobby, rather than automatically join the meeting, run this command:
Set-CsMeetingConfiguration -PstnCallersBypassLobby $false
Presenter settings can be configured using the following command and appropriate switch:
Set-CsMeetingConfiguration -DesignateAsPresenter <None|Company|Everyone>
If you want to configure all meetings to automatically announce when attendees enter or exit meetings by default, execute the following command:
Set-CSDialinConferencingConfiguration -EntryExitAnnouncementsEnabledByDefault $true
Using these commands you should be able to configure the default settings for your company meetings just the way you want.

Monday, 20 August 2012

Retrive List Item in sharepoint 2010 Using Silverlight Control


private void itemRetrive()
        {
            string siteUrl = "http://Site";

            clientContext = new ClientContext(siteUrl);
            oList = clientContext.Web.Lists.GetByTitle("Demo");
            ListItemCollectionPosition itemPosition = null;
         
                CamlQuery camlQuery = new CamlQuery();
                camlQuery.ListItemCollectionPosition = itemPosition;
                camlQuery.ViewXml =
                @"<View>
                    <ViewFields>
                      <FieldRef Name='Title'/>
                      <FieldRef Name='Name'/>
                    </ViewFields>
                    <RowLimit>10</RowLimit>
                  </View>";
                listItems = oList.GetItems(camlQuery);

                clientContext.Load(oList);
                clientContext.Load(listItems);
                clientContext.ExecuteQueryAsync(QuerySucceeded, QueryFailed);
           
           
        }
        private void QuerySucceeded(object sender, ClientRequestSucceededEventArgs args)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                foreach (ListItem listItem in listItems)
                {
                    listBox1.Items.Add(listItem["Title"].ToString());
                }
            });

        }

        private void QueryFailed(object sender, ClientRequestFailedEventArgs args)
        {
            Dispatcher.BeginInvoke(() =>
            {
                MessageBox.Show("");
            });

        }

Add List Item in Sharepont 2010 Using Silverlight Control


private void addListItem()
        {
            string siteUrl = "http://Site";

            ClientContext clientContext = new ClientContext(siteUrl);
            List oList = clientContext.Web.Lists.GetByTitle("Demo");

            ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
            ListItem oListItem = oList.AddItem(itemCreateInfo);
            oListItem["Title"] = textBox1.Text.ToString();
            oListItem["Name"] = textBox2.Text.ToString();

            oListItem.Update();
            clientContext.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed);
        }

        private void onQuerySucceeded(object sender, ClientRequestSucceededEventArgs args)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                MessageBox.Show("Item Succesfully Add......");
            });
         
        }

        private void onQueryFailed(object sender, ClientRequestFailedEventArgs args)
        {
            Dispatcher.BeginInvoke(() =>
            {
                MessageBox.Show("Item Not Succesfully Add......");
            });
         
        }

Friday, 10 August 2012

Here is code for retrive all user from particular site collection


using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
using System.Collections;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using System.Drawing;
namespace AllUsersWebPart
{
[Guid("bb4dddf0-9923-43b9-a835-210735416ddf")]
public class AllUsers : System.Web.UI.WebControls.WebParts.WebPart
{
Label lblName;
Label lblgroups;
Table tblAllUsers;
public AllUsers()
{}
protected override void CreateChildControls()
{
base.CreateChildControls();
tblAllUsers = new Table();
lblgroups = new Label();
lblName = new Label();
CreateHeaderRow(); // Will Add a header Row to the Table.
using (SPSite SPSite = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb SPWeb = SPSite.OpenWeb(SPContext.Current.Web.ID))
{
SPUserCollection AllSPWebUsers = SPContext.Current.Web.AllUsers;
SPGroupCollection AllSPWebGroups = SPContext.Current.Web.Groups;
//Iterate through each group in the current site.
foreach (SPGroup grp in AllSPWebGroups)
{
SPUserCollection UsersInGroup = grp.Users;
foreach (SPUser user in UsersInGroup)
{
lblName.Text = user.Name;
foreach (SPGroup usergrp in user.Groups)
{
lblgroups.Text = usergrp.Name;
}
AddToTable(lblName.Text, lblgroups.Text);
}
}}}
this.Controls.Add(tblAllUsers);
}
// Adding users to the Output Table.
protected void AddToTable(string UserName, string grp)
{
TableRow r = new TableRow();
TableCell CellName = new TableCell();
CellName.Text = UserName;
r.Cells.Add(CellName);
TableCell CellPermissions = new TableCell();
CellPermissions.Text = grp;
r.Cells.Add(CellPermissions);
tblAllUsers.Rows.Add(r);
}
// Create a Header Row for the Output table.
protected void CreateHeaderRow()
{
TableHeaderRow headerRow = new TableHeaderRow();
headerRow.BackColor = System.Drawing.Color.LightBlue;
TableHeaderCell headerTableCell1 = new TableHeaderCell();
TableHeaderCell headerTableCell2 = new TableHeaderCell();
headerTableCell1.Text = “User Name”;
headerTableCell1.Scope = TableHeaderScope.Column;
headerTableCell2.Text = “Group”;
headerTableCell2.Scope = TableHeaderScope.Column;
headerRow.Cells.Add(headerTableCell1);
headerRow.Cells.Add(headerTableCell2);
tblAllUsers.Rows.AddAt(0, headerRow);
}
}}

Wednesday, 25 July 2012

Sharepoint 2013 Community Site


 SharePoint 2013 we have the new "Community Site". Top create one simply access the "Site Contents" link and then select the link to create a new sub site and choose the community site.
Once it has been created you should get something that looks like this:
As you can see there are great features right here on the home page. The middle of the site contains the aggregation of things that are important to the community site.
New discussions can be created very easily by select the link and completing the following details. Notice the new option "I am asking a question and want to get answers from other members".
Once it is added it renders on the home page with other details and easy to click link to get access to the body of the discussion.
Inline reply can be achieve by accessing the discussion item and then adding your reply using the web part underneath the discussion item.
As an administrator on the right if the actual discussion I can perform the following actions:
Selecting to manage the discussion takes you directly to the hosting list of the discussion where you can see the full details of the item. Plus you also get to use the ribbon bar feature to designate a featured discussion.
You can create categories by using the second link, more importantly you can assign badges to members.
Once set this then adds the simple tag to the user in the site.
Setting the reputation settings allows for you to set what the thresholds are for the users reputation score.
On this page you can also manage the badges that are assigned to the users.
Some base settings can be updated using "Community Settings".
With all the settings for reputation completed you are then able to see the following about the members of the site.

Tuesday, 24 July 2012

Configure Mysite in Sharepoint 2010


Create the My Site Web Application
We begin by first creating a Web Application that will eventually house our My Site Host and subsequent site collections.
Navigate to Central Administration / Application Management / Web Applications
Click New

IIS Web Site: Create a new IIS web site (enter your details as per your requirements)
Create the My Site Host Site Collection
Now that we have successfully created our My Site Web Application, we can now proceed to create our My Site Host Site Collection.  This will be the top level site that will house our individual user’s site collections.
Navigate to Central Administration / Application Management / Create site collections.
Ensure that the recently created My Site Web Application is selected, enter in a Title and click select the My Site Host Template located under the Enterprise Tab.  Lastly, specify your site collection administrators and click OK.



You should then receive confirmation that the top level My Site Host has been successfully created.

Setup My Sites
Now that we have successfully provisioned our My Site Web Application and Top Level Site Collection that will host our My Sites, we can continue to configure our My Site Settings.
Navigate to Central Administration / Application Management / Manage service applications.
Click on User Profiles.
Click on Setup My Sites located under My Site Settings.
image thumb10 Configuring My Site in SharePoint 2010 sharepoint 2010 sharepoint
Enter the details of your Preferred Search Center if you have one setup already.
Enter the URL of your My Site Host that we have just created in the previous step and the personal site location.

Finally, select your Site Naming format, configure your Language Options, Permissions and My Site Email Notifications.

Click OK.
Add our Managed Path
Because we have specified “personal” as our Personal Site Location, we will need to define our managed path against our My Site Web Application.
Navigate to Central Administration / Application Management / Manage Web Applications.
Click on your My Site Web Application and click on Managed Paths from the Ribbon.
image thumb13 Configuring My Site in SharePoint 2010 sharepoint 2010 sharepoint
Add “personal” as a Wildcard inclusion, click Add Path and click OK
image thumb14 Configuring My Site in SharePoint 2010 sharepoint 2010 sharepoint
Enable Self-Service Creation
Our last configuration step provides our users with the privilege to provision their own My Site’s by enabling the Self-Service Creation.
Navigate back to Central Administration / Application Management / Manage Web Applications.
Click on your My Site Web Application and click on Self-Service Site Creation.

Select On and click OK.
image thumb16 Configuring My Site in SharePoint 2010 sharepoint 2010 sharepoint
If I now browse to my My Site URL I will be presented with the following “What’s New” Page.

It is only until I click on “My Content”, that SharePoint will proceed to create my personal site as per SharePoint 2007.
image thumb18 Configuring My Site in SharePoint 2010 sharepoint 2010 sharepoint
My Content