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

SharePoint list or site templates too large for import / export... use STSADM

I love MOSS! But there are some workarounds that you always need to look into if you want your portal to be happy!

Imagine you spent hours on customizing a site that you want to reuse as a template to create new sites. But you hit a dead-end.

Issue 1:
The maximum DEFAULT size permitted by SharePoint for a list or site to be saved as a template is 10MB. Even though I have received the message unexpectedly on sites as small as 5MB or 6MB.

Anyways the fix for this is to increase the maximum permitted property "max-template-document-size" using STSADM. See command below:

stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000
[Ref: http://blogs.provoke.co.nz/Ari/archive/2007/05/24/increasing-the-maximum-size-of-list-templates.aspx]

You should now be able to export your site template and save it to a local drive on your MOSS box.

Issue 2:
Now it's time to use the newly exported site template just incase you need to create a root site collection (you will need to add it to the available Site Collection templates). Simply use the STSADM command below:

stsadm –o addtemplate –filename c:\exercise.stp –title exercise
[Ref: http://mindsharpblogs.com/kathy/archive/2007/04/10/1685.aspx]

Cheers!

Securing SharePoint application pages (such as AllItems.aspx, etc.) from members within you organization

When "ViewFormPagesLockdown" won't work for you and you still want your AllItems.aspx and other forms secured then you have to write some code.

Let me save you some steps, here is the code for a simple control that you can put at the top of a new master page which is a copy of default.master or any other customized master page you created.

This code will by default redirect anonymous users away from the page and will also only allow specified member groups (that you specify) to access the page.


public class SecureItem: WebControl {
private string mGrantGroups = "";

public string GrantGroups {
get {
return mGrantGroups;
}
set {
mGrantGroups = value;
}
}

private string mRedirPage = "/";

public string RedirPage {
get {
return mRedirPage;
}
set {
mRedirPage = value;
}
}
protected override void OnLoad(EventArgs e) {
string name = Context.User.Identity.Name;
if (name.Trim() == "") Page.Response.Redirect(RedirPage, true);

if (GrantGroups.Trim() == "") return;
string[] grps = GrantGroups.Split(",".ToCharArray());
bool doredir = true;
try {
for (int i = 0; i < grps.Length; i++)
if (grps[i].Trim() != "" && SPContext.Current.Web.IsCurrentUserMemberOfGroup(SPContext.Current.Web.Groups[grps[i].Trim()].ID)) doredir = false;

} catch (Exception ee) {
Page.Response.Write(ee.ToString());
doredir = false;
}
if (doredir) Page.Response.Redirect(RedirPage, true); // has to be outside of try catch
}
}

Your pages are secure now!

Fourth and final release of the MS SharePoint Administration Toolkit

Microsoft announces the fourth (and final) release of the Microsoft SharePoint Administration Toolkit for SharePoint 2007

Why? SharePoint 2010 has some great "features on steriods" in the good old Central Administration. Can't wait to share, check back soon... preparing a complete deployment, screen-shot installation and upgrade to SharePoint 2010!

SK

Maintain scroll position in your custom ASP.NET pages developed for SharePoint

Hello :)

I can recall more than a few instances where I might have developed custom pages to support corporate SharePoint integrated deployments with or without Dynamic Integration (specifically for long scrolling dashboard pages that are customized). And there have been quite a few cases that my friends have discussed with me on the page scrolling annoyance after a postback has occured!

This is a very common behaviour and a very simple issue to resolve since we talk about ASP.NET pages. Obvious, they all have their Page Directives, ain't it?

Include the following tag into your page directive:

<%@ Page ... MaintainScrollPositionOnPostback="true" %>


Simple! Try it...

SharePoint Meeting Workspace error in Meeting Minutes - 'g_instanceID' is not defined

What a fine morning! A happy client, a happy portal... navigate to the meeting workspace and boom! The left navigation that lists meeting dates are not clickable any more... huh?

This problem started occuring when I switched the portal master page to inherit a custom one that looked really nice :) Following the change, all meeting workspace sites would pop-up an annoying javascript error: 'g_instanceID' is not defined

A few verification moves concluded that all meeting workspaces in SharePoint inherit a master page called "mwsdefault.master" that is located in the 12 hive template\global directory. This default meeting workspace master page is static in all meeting workspaces and includes code that is missing in the custom master pages that I built. Error!

To fix this issue:

  • Open you custom master page in SharePoint Designer
  • Copy the missing code from 'mwsdefault.master' into your custom master page at the top along with other register tags. The register Microsoft.SharePoint.Meetings tag prefix that has been copied from my mwsdefault.master is same as yours. So you can copy the one below:

<%@ Register Tagprefix="Meetings" Namespace="Microsoft.SharePoint.Meetings" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

  • After completing the above, copy the Meetings:PropertyBag control into your custom master page. Copy the one below and paste it right after the Body tag.

Save your custom master page, check-in, approve and go live!


Changing SharePoint file upload limit

The default file upload max. limit set by SharePoint during installation is 50MB. Consideribly, this limit should just fit into your agenda unless you want larger files being exchanged on your network. Note that this could affect the performance and availability of network bandwidth to other applications!

I would consider a case when you plan to use SharePoint as your DMS or ECM solution. This could demand for larger files to be uploaded to your portal. In that case, let's have a look at how we can modify this limit:

  1. Navigate to your portal Central Administration > Shared Services Administration.
  2. You will see a list of Web Application associated with your SSP. Click the required web application that needs the modification to its upload limit.
  3. You will navigate to the Web Application General Settings Page. Scroll to the section "Maximum Upload Size" and modify the limit as per your requirement (see screenshot below).

Note: The value for maximum upload size should not exceed 2047 MB


Displaying attachment link in a SharePoint custom list form - "DispForm.aspx" modified

A recent experience of mine while working with SharePoint lists where we required to customize the out-of-the-box list item display form "DispForm.aspx" to present a design-frenzy item view format.

During the modification process, we never assumed that the list item attachments would abruptly dissapear from the display form. All we were looking to do was to display the list item in a good looking format by modifying the XSLT, but the attachments were gone!

Lesson Learnt: Never modify the out-of-the-box list item display form "DispForm.aspx". Create a new one if you need to and call it "DispForm_WhateverYouCallIt.aspx"

Now the attachments that were gone seemed quite easy to be brought back on the page. It needed a SharePoint control AttachmentsField that went missing from the picture. Below is the code that you need to add into the XSLT template dvt_1.rowview (into your custom form) that constructs theDataFormWebPart that SharePoint Designer creates for you when you insert a Custom List Form:


Was that easy? The attachments are now showing in the custom form that you just created. Happy Coding!