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);
}
}}