Saturday, September 12, 2015

Event Scheduler

Event Scheduler app, bridges the gap of registering for an event in your organization or client, based on Date and Time, Slots available with email confirmation.
Register for an event, for like a training/ medical camp based on the time slots designated by the Event coordinator.


Event  coordinator can create an event with the info like:
  •    Event Start and End Date Time
  •    Slot Duration
  •    Maximum number of appointments for a slot
  •    Break Time and its duration
  •    Mark it as all day event
  •    Mark it as recurring event
  •    Versioning
Attendees can:
  •   click on the event and register a slot from Ribbon or Context menu
  •   choose from slots available for the selected date
  •   Update or delete the registered slot
  •   View his/her appointments in calendar and list view
  •   Confirmation email on schedule/update/delete
Please donate to come up with more apps and additional features

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

ItemUpdating event only when metadata/properties are changed

1:  if (properties.AfterProperties["vti_sourcecontrolcheckedoutby"] == null && properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] != null)
  
2:  {
  
3:  //This is when the update event is triggered by check-in.
  
4:  }
  
5:  else{
  
6:  //This is triggered by events other than check-in action.
  
7:  if (Convert.ToInt32(properties.AfterProperties["vti_filesize"]) == 0)
  
8:  {
  
9:  }
  
10:  }
  

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.

Thursday, November 11, 2010

PushPin to show or hide DIV and maintain state across pages and Users using JQuery

JQuery has very cool features, providing the wide range of plugins to play around with your webpage. Here in this post I m going to discuss regarding a requirement I had to make use of JQuery to maintain the state of a DIV across pages, as well as across Users logged into the application.

Requirement:

This requirement is to provide interface for searching certain content in the SharePoint List based upon the keywords. This search window/pane should have the capability of toggle, as well as the capability of fixing/pin down (stopping toggle i.e showing the DIV) which should be maintained across the pages in the application untill the user either closes the pane or unfix. Also, this provision should be available as per the User choice, logged in to the application.

Example:
For better understanding we shall consider two user's named User1 & User2. When User1 loggs in to the application and prefers to pin down the DIV after showing DIV by toggle, that DIV should be in open state, in all the pages being traversed, untill preferred to pin up. But this preference should not reflect to User2, as this user might not prefer to search or looking into the DIV.

Challenges:
  1. Maintaining the Open/Close state across all pages based upon the preference to show/hide respectively.
  2. Maintain the Open/Close state based upon the logged in User preference to show/hide respectively.

Solution:
  1. Add Script References for
    JQuery Plugin:
    
    
    Download: http://jquery.com/

    Sessions Plugin:
    Download: http://plugins.jquery.com/node/8213/release

    JSON Plugin:
    
    
    Download: http://www.json.org/json2.js
  2. Create a DIV tag holding all your content as below:
    Note:Styles & images are from JQuery UI Smoothness theme.
  3. Add the below script in the head tag
    $(document).ready(function() {
    
     $.namesession.set("LoggedInUser",$().SPServices.SPGetCurrentUser({fieldName: "UserName", debug: false}));
    
     var SearchWindowStatus= ($.namesession.get('SearchWindowStatus_'+$.namesession.get('LoggedInUser',''), '')!= '')?$.namesession.get('SearchWindowStatus_'+$.namesession.get('LoggedInUser',''), '') :$.namesession.set('SearchWindowStatus_'+$.namesession.get('LoggedInUser',''),false);
    
     if(SearchWindowStatus){
      $('#SearchFund-dialog').show();
      $("a[id$=anchorPinPoint]").children().removeClass('ui-icon-pin-w').addClass('ui-icon-pin-s').attr('title','Keep Search Closed');  
    
     }else{
      $('#SearchFund-dialog').hide();
     }
    
    
    
     $(this).click(function() {
    
       $('#SearchFund-dialog').toggle(); 
     }):
    
    
     $("a[id$=anchorPinPoint]").bind({
    
           mouseover:function() {
          $(this).addClass('ui-state-hover');
         },
         mouseout:function() {
          $(this).removeClass('ui-state-hover');
         },
        
        focus:function() {
         $(this).addClass('ui-state-focus');
         },
        blur:function() {
         $(this).removeClass('ui-state-focus');
         },
        click:function() { 
        
          TogglePinPoint(this)
    
         
         return false;
    
         }
      });
        
     function TogglePinPoint(ctrl)
     {
      if($(ctrl).children().hasClass('ui-icon-pin-w'))
       {
        $(ctrl).children().removeClass('ui-icon-pin-w').addClass('ui-icon-pin-s').attr('title','Keep Search Closed');  
        $.namesession.set('SearchWindowStatus_'+$.namesession.get('LoggedInUser',''),true);
       }else if($(ctrl).children().hasClass('ui-icon-pin-s'))
       {
        $(ctrl).children().removeClass('ui-icon-pin-s').addClass('ui-icon-pin-w').attr('title','Keep Search Open');  
        $.namesession.set('SearchWindowStatus_'+$.namesession.get('LoggedInUser',''),false);
    
      } 
     }
    });
    

Note: Ensure your web.config file is configured for AJAX & JSON
Enable SessionState is set to true in the config file

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