Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Monday, January 6, 2014

News Slider with multiple data sources for SharePoint (Content Query Webpart).

Project Description

News Slider is built for SharePoint 2007, 2010, 2013 which covers the below technical specifications
Technical Specifications:
  • Built for SharePoint 2007, 2010, 2013
  • Fetch data from multiple libraries (ex: Document Libraries, Pages Libraries)
  • jQuery based rendering
  • Enhanced/ Customized Content Query webpart
  • Responsive
    • Adapt to any screen
  • Touch
    • Swipe support that tracks touch movements on supported devices
  • CSS3 transitions
    • Animations that run smoothly on modern devices
  • Display only specified items
  • Display only published items
  • Display as per your sort order
  • Play/Pause
  • Next/Previous
  • Pause on Hover
Dependancies:
  • jQuery 1.7.1+ 
Download:
https://sharepointnewsslider.codeplex.com/

instructions document is available under downloads tab
 
Screenshots:


Thanks to SlidesJS team for developing a responsive and flexible Slider plugin based on jQuery. Please donate for their hardwork

Thursday, December 30, 2010

Redirect to a Page in custom Site Definition - SharePoint

A Site Definition defines a unique type of Microsoft SharePoint Foundation Web site. There are several site definitions built into SharePoint Foundation. A site definition can include more than one site definition configuration. A SharePoint Foundation Web site is based on particular site definition configuration. For this reason, a site definition may be thought as a family of configurations, although some families contain only one configuration.
  • Site Definitions are the foundations on which all sites and user templates are built.
  • Site Definitions are predefined components needs to be included when a site was created in SharePoint server.
  • Site Definition contains information of Web Part , Lists, Features and navigation bars to be included in the site.

The following are the four site definitions whose configurations can be used to create new Web sites.
  1. STS includes the site definition configurations for, Blank Site, Team Site, and Document Workspace. 
  2. MPS includes the site definition configurations for Basic Meeting Workspace, Blank Meeting Workspace, Decision Meeting Workspace, Social Meeting Workspace, and Multipage Meeting Workspace.
  3. BLOG provides a site definition configuration for blogs.
  4. SGS provides a site definition configuration for Group Work Site.

Requirement:

Redirecting to a custom page, for example like custom settings page, once a new site is created, using custom site definition. This functionality can be also used to have a delayed redirection to site home page, when we perform any site provisioning activities like updating/ modifying the properties of webparts, available on the home page, at runtime.

Solution:

Assuming that the reader has basic idea working with a custom Site Definition in SharePoint, I m explaining in the below solution. All the configuration we are going to make for achieving this functionality will be done in ONET.XML file only, for our custom site definition with the publishing template.

So here in this solution I m using Publishing Site template, as publishing site has a Redirect page layout, which can be used to create a webpage in the pages library, when the template is being applied.

Step 1: Activating "RedirectPageContentTypeBinding" Feature in the WebFeatures section

This is a very important step, as on activating this feature, the Pages library is configured with Redirect Page Content Type. By default when the Pages library is created in Publishing site, Redirect page content type will not be available. So as to bind this content type "RedirectPageContentTypeBinding" has to be activated, which allows us to create a new page using Redirect Page Layout.




Step 2: Creating a Redirect Page in the pages library

Here we are creating new pages in the Pages Library, using the content type based upon our requirement.


















Observe the RedirectURL property, we are explicitly providing the path of default welcome page in the new site going to be created. "~Site" fetches the absolute URL of the site being created, where as "~SiteCollection" fetches the absolute URL of the Site Collection, where the new site is being created.
RedirectURL property can be changed based upon your requirement.

Note: XML folder in your custom Site definition should have the pages above mentioned, along with ONET.XML
Folder structure should be as below:

SiteTemplates
 --- CustomSiteDefinitionName
       ---XML
             ---ONET.XML
             ---Default.aspx
             ---Redirectpage.aspx

Step 3: Specifying Redirect page to open once new site is successfully created

Add the below tag in the Configuration Tag, which specifies, a particular page to be executed once the new site is created. Default behaviour without this tag is to open home page of the site.

Deploy the site definition & create a new site based upon the custom template.

Wednesday, November 10, 2010

Folders in SharePoint Pages Library for Publishing Site

SharePoint Publishing site template has Pages Document Library, which is a repository for pages with a flexibility of creating pages based upon Page Layouts. Pages created in this library by default are configured with three content types Pages, Article Page & Welcome Page each having their own fields based upon necessity.

Pages Library is flexible in creating pages with different layouts, based upon the design & requirement, but does not have a provision to create pages in folders & access them as per the sitemap/ breadcrumbs, as we create in a basic document library. We can go to advanced settings of the library & configure for showing "New Folder" under the New Menu, even though when we create a page under the folders, it is saved under root folder of the library which does not meet our purpose.

         So here in this post, I would like to share one of the solution I implemented in our project, which sufficed very well using  Pages Library for creating pages in the folders.

Troubleshooting:
           The process of troubleshooting started from creating a  new page. In the publishing site when we try to create a new page either from menu option under "Site Actions" or from the "New Menu" in library, we are redirected to "CreatePage.aspx" available under layouts virtual directory. So this is the page where we can customize as per our requirement.

Steps to recreate:

Building Custom page for creating a page:
    1. Copy the "CreatePage.aspx" available in the layouts folder of SharePoint 12 hive & place it in the same directory or else in your custom directory and rename with a custom name as "CreatePage_Custom.aspx".
    2. Open the CreatePage_Custom.aspx in designer or visual studio and search for the tag  
      Set the property "Visible=false" as this is the control which holds name of the Pages library.
      Note: Do not delete this tag, there is a reference in the code behind.
    3. Add the below directive to have publishing assembly reference
      <%@ Import Namespace="Microsoft.SharePoint.Publishing" %>
    4. Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePage is the class in the code behind, but the respective methods are not exposed. So the next option is inline coding in the page, where we use custom event of the submit button to have our functilnality to add the page in the Pages library.
      protected void OnCustomSubmit(Object sender, EventArgs e)
      
      {
        string newPageUrl = "";
      
       SPWeb web = SPContext.Current.Web;
      
       PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
      
       PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts();
      
       int layoutItemId = Convert.ToInt32(pageTemplatePicker.SelectedValue);
      
       PageLayout layout = FindLayoutById(layoutItemId,publishingWeb);
      
       string pageName = urlNameTextBox.Text + ".aspx";
      
       PublishingPage newPage = publishingWeb.GetPublishingPages().Add(Request.QueryString["RootFolder"].ToString() + "/" + pageName, layout);
      
       newPageUrl = web.Url + "/" + newPage.Url; // Here you can append the Querystring if you want to show the created page in the Edit Mode.
      
       newPage.Title = titleTextBox.Text;
      
       newPage.Description = descriptionTextBox.Text;
      
       newPage.Update();
      
       Response.Redirect(newPageUrl);
      }
      
      protected PageLayout FindLayoutById(int layoutItemId,PublishingWeb localPublishingweb)
      {
       SPListItem itemById = localPublishingweb.Web.Site.RootWeb.GetCatalog(SPListTemplateType.MasterPageCatalog).Items.GetItemById(layoutItemId);
      
       if (itemById == null)
      
       {
      
        return null;
      
       }
      
       return new PageLayout(itemById);
      }

    5. Refer the server click event to the custom event cretaed above.
       
    6. Creating a custom content type:
      
      
       
        
         
         
         
         
         
         
         
        
        
       
      
    7. Deploy content type to the web application Add this new custom content type to the Pages library from the library settings.
    8. Allow library to display New Folder option in New Menu, for creating sub folders.
    9. Create a page using the new content type available under New Menu.

Reference:
If there is a requirement to create a page from the menu item under Site Actions, please refer to this post.
http://blogs.msdn.com/b/syedi/archive/2008/07/18/why-should-one-save-publishing-pages-in-pages-list-always-in-moss-bend-it.aspx

Saturday, July 3, 2010

SharePoint 2010 Virtual Machine for Evaluation

Virtual Machine running Microsoft SharePoint Server 2010, OCS, Web Applications, FAST Search, Project Server, Project Pro Plus 2010, Visio, Project, SQL Server 2008 R2 and Exchange Server 2010 were published by Microsoft. This download contains a two Windows Server 2008 R2 Hyper-V Virtual Machine set for evaluating and demonstrating Office 2010, SharePoint 2010 and Project Server 2010 – including ECM and PerformancePoint Services

Active directory has been preconfigured with over 200 “demo” users with metadata in an organizational structure. All of these user profiles have been imported and indexed for search within SharePoint Server 2010.

SharePoint Server 2010 has been configured in a “Complete” farm using the default SQL Server 2008 R2 instance. A default site has been created using the Team Site template at http://intranet.contoso.com/ and a FAST Search Center at http://intranet.contoso.com/search/

Get it from: http://go.microsoft.com/?linkid=9728417

Virtual machine “a” contains the following pre-configured software:
  1. Windows Server 2008 R2 Standard Evaluation Edition x64, running as an Active Directory Domain Controller for the “CONTOSO.COM” domain with DNS and WINS
  2. Microsoft SQL Server 2008 R2 Enterprise Edition with Analysis, Notification, and Reporting Services
  3. Microsoft Office Communication Server 2007 R2
  4. Microsoft Visual Studio 2010
  5. Microsoft SharePoint Server 2010 Enterprise Edition
  6. Microsoft Office Web Applications
  7. Microsoft FAST Search for SharePoint 2010
  8. Microsoft Project Server 2010
  9. Microsoft Office Professional Plus 2010
  10. Microsoft Visio 2010
  11. Microsoft Project 2010
  12. Microsoft Office Communicator 2007 R2
Virtual machine “b” contains the following pre-configured software:
  1. Windows Server 2008 R2 Standard Evaluation Edition x64, joined to the “CONTOSO.COM” domain
  2. Microsoft Exchange Server 2010

SharePoint 2010 Virtual Labs

We know SharePoint 2010 is a very advanced product in terms of features, capabilities and infrastructure etc. In this scenarios setting up an environment for ourselves is a difficult process atleaset to evaluate the product.

Eventhough now we can install SharePoint 2010 in Windows 7 & Server 2008 they need to be X-64 bit. Upgrading our machines accordingly might involve some investment. So now we have a Virtual labs provided by Microsoft to evaluate the features listed below.


It's our turn to to explore and update to new technologies provided by SharePoint 2010.
 
Test drive SharePoint 2010 in a Virtual lab. Take part and see how Microsoft Office SharePoint Server supports all intranet, extranet, and Web applications across an enterprise within one integrated platform.

Virtual labs cover the following:
  • MSDN Virtual Lab: Client Object Model
  • MSDN Virtual Lab: Customizing MySites
  • MSDN Virtual Lab: Designing Lists and Schemas 
  • MSDN Virtual Lab: Developing a BCS External Content Type with Visual Studio 2010 
  • MSDN Virtual Lab: Developing a Sandboxed Solution with Web Parts 
  • MSDN Virtual Lab: Developing a Visual Web Part in Visual Studio 2010 
  • MSDN Virtual Lab: Developing Business Intelligence Applications 
  • MSDN Virtual Lab: Enterprise Content Management 
  • MSDN Virtual Lab: Getting Started with SharePoint 2010 
  • MSDN Virtual Lab: LINQ to SharePoint 2010 
  • MSDN Virtual Lab: SharePoint 2010 User Interface Advancements 
  • MSDN Virtual Lab: Visual Studio SharePoint Tools 
  • MSDN Virtual Lab: WorkflowMSDN Virtual Lab: Workflow