How to remove “Open this webpart page in maintenance view” message

Assume following scenario

1. Add wiki page in wiki page library
2. edit properties of this page, there is an message

“Open this web part page in maintenance view to delete the problem web parts and remove the personal settings.”

at the bottom of the editing property page.

wmm0

this message is usually a false alarm but it can make users annoying. You can remove this message by using JQuery easily.

  1. Integrate the Jquery with your master page.
    http://blogs.msdn.com/b/yojoshi/archive/2010/06/17/using-jquery-with-sharepoint-2010.aspx
  2.  Go to the related Library Settings -> Advanced Settings.
  3. And select “Launch forms in a dialog” option to “no” and click ok.That would provide to open dialog boxes as a page and you can use the ribbon to change edit mode of the editform.aspx page.

    wmm1

  4. Find the item in the library and Click edit Properties
    wmm2
  5. Click Site Actions -> Edit Page while EditForm.aspx in browsing.
    wmm3
  6. Add a “Content Editor” web part to related Document Libraries’ EditForm.aspx
    wmm4
  7. Click HTML-> Edit HTML Source
    wmm5
  8. Type following Script inside of the HTML Source Windows.

    <script type=”text/javascript”>
    $(document).ready(function() {
    $(“a:contains(‘Open Web Part Page’)”).parent().css(‘display’,’none’);
    });
    </script>

    wmm6

  9. Click OK and Save the page. IF everyhing is ok you shouldn’t able to see the WebPartMaintenace Message like below.

    wmm7

  10.  Go to the related Library Settings -> Advanced Settings.
  11.  And select “Launch forms in a dialog” option to “YES” for revert back and click ok

How to send Real Meeting Requests from Sharepoint 2010 – Part4 Usage

How to send Real Meeting Requests from Sharepoint 2010 – Part4 Usage:

Here is the links for How to send Real Meeting Request From Sharepoint 2010 Series:
http://blog.bugrapostaci.com/2012/02/17/how-to-send-real-meeting-request-from-sharepoint-2010-part-1/
http://blog.bugrapostaci.com/2012/02/17/how-to-send-real-meeting-request-from-sharepoint-2010-part-2/
http://blog.bugrapostaci.com/2012/02/17/how-to-send-real-meeting-request-from-sharepoint-2010-part-3-deployment/
http://blog.bugrapostaci.com/2012/02/17/how-to-send-real-meeting-requests-from-sharepoint-2010-part4-usage/

1) Open a sharepoint calendar

2) Add new Event

Meeting Requests can only be send through from a Meeting Workspace in this project.So you have to select checkbox of workspace.

3) Create a new Meeting Workspace or Select an existing Meeting WorkSpace

If you have already a created Meeting WorkSpace select that one.

4) The Meeting Workspace home page opens automatically.

5) Add Manage Meeting Requests Web Part  to default page

6) Add needed attendess

7)Return to home page of Meeting Site

8) Send a meeting Request form Manage Meeting Request Web Part

If you able to send a meeting request successfully the gui has changes and information message shown that confirm your Meeting Request has been sent successfully.
There is only 4 feature implemented in this project.

  • Send Meeting Request
  • ReSend Meeting Request
  • Refresh Attendees Status
  • Cancel Meeting

9) Check Your Outlook and Clients for confirmation .

Update for MyMasters Solution -16th Nov 2011

Hi Everyone recently i uploaded a new version (1.1) of MyMasters solution.

the solution now covering fallowing questions’ answers :

* How to deploy a custom wellcome page to Personal Site ?
* How to add custom webparts to a page ?
* How to use XsltListViewWebPart and add a document library as a webpart ?

You can download new version from CodePlex site of MyMasters solution:
http://mymasters.codeplex.com/

Please visit related post about MyMasters:
http://blog.bugrapostaci.com/2011/10/24/attach-custom-master-page-to-personal-site-with-featurestabling-for-sharepoint-2010/

Here is a code sample for above questions :
as you guess CreateWellcomePage function has been calling in Feature Reciever class of MyMasters Feature.

  1. private void CreateWellcomePage(SPFeatureReceiverProperties properties)
  2.         {
  3.             SPSite site = (SPSite)properties.Feature.Parent;
  4.             SPWeb web = site.OpenWeb();
  5.             PublishingSite pSite = new PublishingSite(site); //Get Publishing Site Object
  6.             SPContentType ctype = pSite.ContentTypes[“Welcome Page”]; //Get builtin “Wellcome Page” content type
  7.             PageLayoutCollection pageLayouts = pSite.GetPageLayouts(ctype, true); //Get builtin pagelayouts for this content type
  8.             PageLayout pageLayout = pageLayouts[0]; //Select first one which is BlankWebPartPage pagelayout
  9.             PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(web); //Get Publishing Web.
  10.             PublishingPageCollection pPages = pWeb.GetPublishingPages(); // Get Page Collection
  11.             //TempFile for changing default page
  12.             string tempFileName = “TempFileForChangeWellcomePage.aspx”;
  13.             PublishingPage tempPage = null;
  14.             try
  15.             {
  16.                 //Get if there is an existing wellcome.aspx
  17.                 PublishingPage pPageExist = pPages[pWeb.Url + “/Pages/Wellcome.aspx”];
  18.                 if (pPageExist != null)
  19.                 {
  20.                     //Check wellcome.aspx is default page
  21.                     if (pWeb.DefaultPage.UniqueId == pPageExist.ListItem.File.UniqueId)
  22.                     {
  23.                         //if it is a default page we have to create a template page because the default page is not deleted.
  24.                         //Create a temporary page
  25.                         tempPage = pPages.Add(tempFileName, pageLayout);
  26.                         tempPage.ListItem.File.CheckIn(“Chk”);
  27.                         tempPage.ListItem.File.Publish(“Pub”);
  28.                         //Set this temporary file as default page so we can able to delete existing wellcome.aspx
  29.                         pWeb.DefaultPage = tempPage.ListItem.File;
  30.                         pWeb.Update();
  31.                     }
  32.                     //Delete Existing Wellcome.aspx
  33.                     if (pPageExist.ListItem.File.CheckedOutByUser != null)
  34.                     {
  35.                         pPageExist.ListItem.File.UndoCheckOut();
  36.                     }
  37.                     pPageExist.CheckOut();
  38.                     pPageExist.ListItem.Delete();
  39.                     pWeb.Update();
  40.                 }
  41.             }
  42.             catch(Exception ex)
  43.             {
  44.             }
  45.             //Create a new Wellcome.aspx file
  46.             PublishingPage pPage = pPages.Add(“Wellcome.aspx”, pageLayout);
  47.             SPListItem newpage = pPage.ListItem;
  48.             newpage[“Title”] = “Wellcome to my personal site”;
  49.             //Add need webparts to page.
  50.             using (SPLimitedWebPartManager wpMgr = web.GetLimitedWebPartManager(pPage.Url, PersonalizationScope.Shared))
  51.             {
  52.                 //Get WebPart Catalog
  53.                 SPList webPartCatalog = web.GetCatalog(SPListTemplateType.WebPartCatalog);
  54.                 foreach (SPListItem item in webPartCatalog.Items)
  55.                 {
  56.                     if (item.DisplayName == “LatestBlogPostsPublic”)
  57.                     {
  58.                         string fileName = string.Format(“{0}/{1}”, item.Web.Url, item.File.Url);
  59.                         XmlTextReader reader = new XmlTextReader(new StringReader(item.Web.GetFileAsString(fileName)));
  60.                         string error;
  61.                         System.Web.UI.WebControls.WebParts.WebPart wx = wpMgr.ImportWebPart(reader, out error);
  62.                         wpMgr.AddWebPart(wx, “Header”, Convert.ToInt32(0));
  63.                     }
  64.                 }
  65.                 //Add existing Document Library views
  66.                 SPList SharedDocumentsList = web.Lists[“Shared Documents”];
  67.                 SPView SharedDocumentsListView = SharedDocumentsList.Views[0];
  68.                 SPList PersonalDocumentsList = web.Lists[“Personal Documents”];
  69.                 SPView PersonalDocumentsListView = PersonalDocumentsList.Views[0];
  70.                 XsltListViewWebPart wp = new XsltListViewWebPart();
  71.                 wp.ListId = SharedDocumentsList.ID;
  72.                 wp.Title = “Shared Documents”;
  73.                 wp.ChromeType = PartChromeType.TitleOnly;
  74.                 wp.ViewGuid = SharedDocumentsListView.ID.ToString();
  75.                 wp.XmlDefinition = SharedDocumentsListView.GetViewXml();
  76.                 wpMgr.AddWebPart(wp, “Header”, Convert.ToInt32(1));
  77.                 XsltListViewWebPart wp2 = new XsltListViewWebPart();
  78.                 wp2.ListId = PersonalDocumentsList.ID;
  79.                 wp2.Title = “Personal Documents”;
  80.                 wp2.ChromeType = PartChromeType.TitleOnly;
  81.                 wp2.ViewGuid = PersonalDocumentsListView.ID.ToString();
  82.                 wp2.XmlDefinition = PersonalDocumentsListView.GetViewXml();
  83.                 wpMgr.AddWebPart(wp2, “Header”, Convert.ToInt32(2));
  84.             }
  85.             newpage.File.CheckIn(“Administravily Check in”);
  86.             newpage.File.Publish(“Administravily Published”);
  87.             //set wellcome.aspx as default page.
  88.             pWeb.DefaultPage = newpage.File;
  89.             pWeb.Update();
  90.             //delete if tempfile is exists.
  91.             if (tempPage != null)
  92.             {
  93.                 tempPage.ListItem.Delete();
  94.             }
  95.             pWeb.Update();
  96.         }

Getting error of “Unable to display this Web Part” on WSS2.0/SPS2003 after installing MS11-074

September Security Bulletin (MS11-04) is affecting WSS 2.0/SPS2003 ,  After installing security update MS11-074 for Windows SharePoint Services 2.0 / SharePoint Portal Server 2003 (KB 2494007), we are faced with problems with some DataViewWebPart s.
The error message is :
Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as FrontPage. If the problem persists, contact your Web server administrator.”

the problem is cause by The Security Update breaks some XSLT ddwrt functions in the Data View Web Part, for example, ddwrt:FormatDate(string szDate, long lcid, long formatFlag) and ddwrt:FilterLink().

For resolving this issue you ;

1) Upgrade to Windows SharePoint Services 3.0 or Office SharePoint Server 2007.
2. Evaluate how widely the Data View Web Part is used and apply the following workaround if there are very few pages affected:
Remove broken ddwrt functions in the Extensible Stylesheet Language Transformation (XSLT) code of the Data View Web Part.
Here is an example when the broken ddwrt function is
ddwrt:FormatDate(string szDate, long lcid, long formatFlag):

Replace code “ddwrt:FormatDate(string(@someDateField), 1033, 5)” with “@someDateField”. By applying this work around, the Data View will render in browser, however, the formatting of the Date field will be changed as following:

Before the security update, the date is in this format: 9/27/2011 6:21 PM
After above work around, the date is in this format: 2011-09-27T18:21:03

Another example, ddwrt:FilterLink(), this function returns an empty string. Just remove the function, the Data View should render the same way as before.

The above concept can be applied to other ddwrt functions with caution. There are possibilities that removing ddwrt functions will impair the function of XSLT so that the data displayed in Data View is not in the desired format. In those situations, please consider option 1 or 3.

3. Rollback the WSS 2.0/SPS 2003 farm to a state prior to installing the above Security Update. A backup of the farm/content databases before the security update is required for this to be successful.