Wednesday, December 3, 2014

Creating blog or team site in Publishing site

    
​By default the Publishing portal limits what site templates you can use to create sub sites.  You can 

override this setting. 

In the site that you want to be the parent site for the Blog

Go to SiteSettings > Page Layouts and Site Template Settings.  In the Subsite Templates section of 

the page add the Blog (All) template from the left hand list to the Right hand list.  Click OK. 

You will now be able to create a Blog as a subsite to the current site.  These settings can be 

configured on each site or you can apply a setting from any upper level site throughout the hierarchy.

Monday, October 6, 2014

Read error on file when saving list as template

Today I’ll talk about a problem that may occur when you try to create a list template.


It may happen that you have this error message


Read error on file _catalogs/lt/yourtemplatename.stp


This error occurs if you have exceeded the number of allowed lookup for list views (default 8)


To save your template list, you can change the value of the threshold in the central administration:
  • Go to the Central Administration
  • Select your web application
  • In the “General settings” menu click on “Resource Throttling” and increase the “List View Lookup Threshold” field
Hope this helps

Monday, August 4, 2014

using the exchange web service API from c#

This week I had been looking at the exchange web service API and how we can inspect Emails within Exchange.


If you need to read emails from an inbox then you can very easily and quickly by using the exchange web service API which you can download from here.


I was looking for a way to check unread messages and download its attachment then mark email as read.


In the following example lets assume we will have emails


Create a reference in your project to Microsoft.Exchange.WebServices.dll which you will be able to found in C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll


The following code demonstrates how to achieve this:


using Microsoft.Exchange.WebServices.Data;


 
 
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
                service.Credentials = new WebCredentials("Email Username""Email Password""domain name");
                service.Url = new Uri("https://contoso.com.au/ews/exchange.asmx");
                ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
                Folder inbox = Folder.Bind(service, WellKnownFolderName.Inbox);
 

                // The search filter to get unread email.
                SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
                ItemView view = new ItemView(1000);
 
 
                // Fire the query for the unread items.
                // This method call results in a FindItem call to EWS.
                FindItemsResults<Item> unreadMessages = service.FindItems(WellKnownFolderName.Inbox, sf, view);
 
                 foreach (EmailMessage message in unreadMessages)
                {
                    message.Load();
                    Console.Out.WriteLine("*********************  Processing email " + message.Subject + " *********************");
                    foreach (FileAttachment attachment in message.Attachments)
                    {
                        if (attachment is FileAttachment)
                        {
 
                            FileAttachment fileAttachment = attachment as FileAttachment;
                            fileAttachment.Load("c:\\attachements\\" + fileAttachment.Name);
 
                        }
                    }
 
                    message.IsRead = true;
                    message.Update(ConflictResolutionMode.AlwaysOverwrite);
                }

Sunday, June 22, 2014

Adding a custom CSS file to your Visual Web Part

If you would like to add a custom CSS file to a Visual Web Part that allows the styling of the web part to remain consistent no matter where it's installed, you can do so via the following steps:

  1. Using Visual Studio 2010, open your Visual Web Part solution
  2. In Solution Explorer, right-click on the project and select Add -> SharePoint "Layouts" Mapped Folder
  3. Right-click on the newly created Layouts folder and select Add -> New Folder
  4. Edit the name from "NewFolder1" to "1033"
  5. Right-click on the "1033" folder and select Add -> New Folder
  6. Edit the name from "NewFolder1" to "Styles"
  7. Right-click on the "Styles" folder and select Add -> New Folder
  8. Edit the name from "NewFolder1" to the name of your Project (i.e. MyProject in this example)
  9. Right-click on the "MyProject" folder and select Add -> New Item...
  10. Under the Installed Templates section, expand Visual C# and click on Web
  11. Click on the Style Sheet icon, update the name of your style sheet (i.e. Standard.css in this example), and click Add
  12. You may now enter the appropriate style sheet rules in this file and save the changes
During the deployment of your Visual Web Part, the custom style sheet will be deployed directly to the SharePoint farm under the following location on the web front end servers:  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\MyProject.

Now, to reference the style sheet in your Visual Web Part, you may do so via the following steps:
  1. Open your Visual Web Parts .ascx file
  2. After the "<%@ Control" tag, add the following line:  <SharePoint:CssLink ID="cssLink1" runat="server" DefaultUrl="MyProject/Standard.css" />
  3. Save the change
At this point, you will be able to reference the new style sheet within the controls on your .ascx page.

Monday, May 5, 2014

SharePoint 2013 Site Templates Codes for PowerShell



One can easily use the Get-SPWebTemplate command to get a list of all the templates in SharePoint environment. For a quick reference here is the complete list:




Title
Name
Description
Team Site
STS#0
A place to work together with a group of people.
Blank Site
STS#1
A blank site for you to customize based on your requirements.
Document Workspace
STS#2
A site for colleagues to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document.
Central Admin Site
CENTRALADMIN#0
A site for central administration. It provides Web pages and links for application and operations management.
Wiki Site
WIKI#0
A site for a community to brainstorm and share ideas. It provides Web pages that can be quickly edited to record information and then linked together through keywords
Blog
BLOG#0
A site for a person or team to post ideas, observations, and expertise that site visitors can comment on.
App Template
APP#0
A base template for app development. It provides the minimal set of features needed for an app.
App Catalog Site
APPCATALOG#0
A site for sharing apps for SharePoint and Office
Document Center
BDR#0
A site to centrally manage documents in your enterprise.
Developer Site
DEV#0
A site for developers to build, test and publish apps for Office
Academic Library
DOCMARKETPLACESITE#0
The Academic Library template provides a rich view and consumption experience for published content and management. Authors populate metadata and apply rules at the time of publishing, such as description, licensing, and optional rights management (IRM). Visitors of the site can search or browse published titles and add authorized selections to their collection to consume, subject to the rights and rules applied by the author. The site provides an IRM-capable document library, a publishing mechanism for authors to publish documents, detailed views for each document, a check-out mechanism, and related search capabilities.
eDiscovery Center
EDISC#0
A site to manage the preservation, search, and export of content for legal matters and investigations.
eDiscovery Case
EDISC#1
This template creates an eDiscovery case. Users create locations where they can preserve or export data.
(obsolete) Records Center
OFFILE#0
(obsolete) This template creates a site designed for records management. Records managers can configure the routing table to direct incoming files to specific locations. The site also lets you manage whether records can be deleted or modified after they are added to the repository.
Records Center
OFFILE#1
This template creates a site designed for records management. Records managers can configure the routing table to direct incoming files to specific locations. The site also lets you manage whether records can be deleted or modified after they are added to the repository.
Shared Services Administration Site
OSRV#0
This template creates a site for administering shared services
PerformancePoint
PPSMASite#0
A site for presenting PerformancePoint dashboards and scorecards. The site also includes links to PerformancePoint Dashboard Designer and storage for dashboard content such as analytic charts, reports, KPIs, and strategy maps.
Business Intelligence Center
BICenterSite#0
A site for presenting Business Intelligence content in SharePoint.
Publishing Site
CMSPUBLISHING#0
A blank site for expanding your Web site and quickly publishing Web pages. Contributors can work on draft versions of pages and publish them to make them visible to readers. The site includes document and image libraries for storing Web publishing assets.
Publishing Site with Workflow
BLANKINTERNET#2
A site for publishing Web pages on a schedule by using approval workflows. It includes document and image libraries for storing Web publishing assets. By default, only sites with this template can be created under this site.
Site Directory
SPSSITES#0
A site for listing and categorizing important sites in your organization. It includes different views for categorized sites, top sites, and a site map.
Report Center
SPSREPORTCENTER#0
A site for creating, managing, and delivering Web pages, dashboards, and key performance indicators that communicate metrics, goals, and business intelligence information.
Enterprise Search Center
SRCHCEN#0
A site focused on delivering an enterprise-wide search experience. Includes a welcome page with a search box that connects users to four search results page experiences: one for general searches, one for people searches, one for conversation searches, and one for video searches. You can add and customize new results pages to focus on other types of search queries.
Publishing Portal
BLANKINTERNETCONTAINER#0
A starter site hierarchy for an Internet-facing site or a large intranet portal. This site can be customized easily with distinctive branding. It includes a home page, a sample press releases subsite, a Search Center, and a login page. Typically, this site has many more readers than contributors, and it is used to publish Web pages with approval workflows.
Enterprise Wiki
ENTERWIKI#0
A site for publishing knowledge that you capture and want to share across the enterprise. It provides an easy content editing experience in a single location for co-authoring content, discussions, and project management.
Basic Search Center
SRCHCENTERLITE#0
A site focused on delivering a basic search experience. Includes a welcome page with a search box that connects users to a search results page, and an advanced search page. This Search Center will not appear in navigation.
Basic Search Center
SRCHCENTERLITE#1
The Search Center template creates pages dedicated to search. The main welcome page features a simple search box in the center of the page. The template includes a search results and an advanced search page. This Search Center will not appear in navigation.
Visio Process Repository
visprus#0
A site for viewing, sharing, and storing Visio process diagrams. It includes a versioned document library and templates for Basic Flowcharts, Cross-functional Flowcharts, and BPMN diagrams.
Global template
GLOBAL#0
This template is used for initializing a new site.
Team Site
STS#0
A site for teams to quickly organize, author, and share information. It provides a document library, and lists for managing announcements, calendar items, tasks, and discussions.
Blank Site
STS#1
A blank site for you to customize based on your requirements.
Document Workspace
STS#2
A site for colleagues to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document.
Central Admin Site
CENTRALADMIN#0
A site for central administration. It provides Web pages and links for application and operations management.
Wiki Site
WIKI#0
A site for a community to brainstorm and share ideas. It provides Web pages that can be quickly edited to record information and then linked together through keywords
Blog
BLOG#0
A site for a person or team to post ideas, observations, and expertise that site visitors can comment on.
Group Work Site
SGS#0
This template provides a groupware solution that enables teams to create, organize, and share information quickly and easily. It includes Group Calendar, Circulation, Phone-Call Memo, the Document Library and the other basic lists.
Projects Web Database
ACCSRV#5
Create a project tracking database to track multiple projects, and assign tasks to different people.
Document Center
BDR#0
A site to centrally manage documents in your enterprise.
(obsolete) Records Center
OFFILE#0
(obsolete) This template creates a site designed for records management. Records managers can configure the routing table to direct incoming files to specific locations. The site also lets you manage whether records can be deleted or modified after they are added to the repository.
Records Center
OFFILE#1
This template creates a site designed for records management. Records managers can configure the routing table to direct incoming files to specific locations. The site also lets you manage whether records can be deleted or modified after they are added to the repository.
PerformancePoint
PPSMASite#0
A site for presenting PerformancePoint dashboards and scorecards. The site also includes links to PerformancePoint Dashboard Designer and storage for dashboard content such as analytic charts, reports, KPIs, and strategy maps.
Business Intelligence Center
BICenterSite#0
A site for presenting Business Intelligence Center.
SharePoint Portal Server Site
SPS#0
This template is obsolete.
SharePoint Portal Server Personal Space
SPSPERS#0
This web template defines a Personal Space for an individual participating on a SharePoint Portal.
News Site
SPSNEWS#0
This template is obsolete.
Publishing Site
CMSPUBLISHING#0
A blank site for expanding your Web site and quickly publishing Web pages. Contributors can work on draft versions of pages and publish them to make them visible to readers. The site includes document and image libraries for storing Web publishing assets.
Press Releases Site
BLANKINTERNET#1
This template creates the Press Releases subsite for an Internet-facing corporate presence website.
Publishing Site with Workflow
BLANKINTERNET#2
A site for publishing Web pages on a schedule by using approval workflows. It includes document and image libraries for storing Web publishing assets. By default, only sites with this template can be created under this site.
Site Directory
SPSSITES#0
A site for listing and categorizing important sites in your organization. It includes different views for categorized sites, top sites, and a site map.
Report Center
SPSREPORTCENTER#0
A site for creating, managing, and delivering Web pages, dashboards, and key performance indicators that communicate metrics, goals, and business intelligence information.
Collaboration Portal
SPSPORTAL#0
A starter site hierarchy for an intranet divisional portal. It includes a home page, a News site, a Site Directory, a Document Center, and a Search Center with Tabs. Typically, this site has nearly as many contributors as readers and is used to host team sites.
Enterprise Search Center
SRCHCEN#0
A site for delivering the search experience. The welcome page includes a search box with two tabs: one for general searches, and another for searches for information about people. You can add and customize tabs to focus on other search scopes or result types.
Profiles
PROFILES#0
This template creates a profile site that includes page layout with zones
Enterprise Wiki
ENTERWIKI#0
A site for publishing knowledge that you capture and want to share across the enterprise. It provides an easy content editing experience in a single location for co-authoring content, discussions, and project management.
FAST Search Center
SRCHCENTERFAST#0
A site for delivering the FAST search experience. The welcome page includes a search box with two tabs: one for general searches, and another for searches for information about people. You can add and customize tabs to focus on other search scopes or result types.
Visio Process Repository
visprus#0
A site for teams to quickly view, share, and store Visio process diagrams. It provides a versioned document library for storing process diagrams, and lists for managing announcements, tasks, and review discussions.