Doesn't work in Sharepoint 3.0!

Topics: User Forum
Jun 12, 2007 at 11:43 PM
For those thinking on employing this web part, note that it is incompatible with Sharepoint 3.0. The installer works great, but you won't find reference to the web part anywhere in your sharepoint 3.0 galleries. Looking forward to a 3.0 version. (If I were ambitious I would take the source and do it myself!)
Aug 1, 2007 at 4:48 AM
Bruce,

Hi. We are working on a seperate forums webpart for Sharepoint that should be ready in the next few months. You can find out more info at www.datasprings.com (also a demo will be avaliable soon at sharepointdemo.datasprings.com). The web part will have similar features but has been written (is being written) from scratch, it will fully support and be build for WSS 3.0 and MOSS 2007.

-Chad
Sep 6, 2007 at 12:37 PM
Chadwick, when your Sharepoint Forums Webpart will be avaliable?
Will it be in Codeplex?
Sep 17, 2007 at 11:03 AM
Edited Sep 17, 2007 at 11:03 AM
Bruce,
After install by installer, you can go to install folder ( C:\Program Files\WPPackager\{14aa60ab-2b6b-4254-b45e-0ef7b8b2a201} ) , find SharePointForums-1.2.0.0_Bil Simser.cab and deploy this cab file by tool of wss 3.0
But I have two problem:
- User with Contribute right can't access to webpart
- Buttons as Post, Cancel don't work.
Anyone can help me!
Derek Mai
Nov 12, 2007 at 2:02 PM
I have followed the steps (six of them) provided by knutskaarberg in another post, but I still get access denied when I attempt to have a user with Contribute rights access the webpart. I have even given full permissions to the user for the webpart.
Nov 12, 2007 at 3:24 PM
Hi there tequila , you have to do this to all SPLists:
try
{
ForumApplication.Instance.SpWeb.AllowUnsafeUpdates = true;
SPList list = ForumApplication.Instance.SpWeb.ListslistName;
list.BreakRoleInheritance(true);
list.AnonymousPermMask64 = (SPBasePermissions.ViewListItems | SPBasePermissions.EditListItems | SPBasePermissions.Open | SPBasePermissions.BrowseDirectories
| SPBasePermissions.OpenItems | SPBasePermissions.AddListItems);
list.Update();
}
catch
{

}





tequila00shots wrote:
I have followed the steps (six of them) provided by knutskaarberg in another post, but I still get access denied when I attempt to have a user with Contribute rights access the webpart. I have even given full permissions to the user for the webpart.

Nov 12, 2007 at 3:25 PM
To everyone...
I have this Webpart working on moss2007.
Mail me to stationsolutions@gmail.com if you want the solution.
Nov 26, 2007 at 9:17 PM
First, I get the webpart working with full admin privileges. Then I download the latest source code and recompile. After the bugs are out, I change ListBuilder.cs to this:

***********************************************
using System;
using BilSimser.SharePoint.Common.Data;
using BilSimser.SharePoint.WebParts.Forums.Core.Service.Application;
using Microsoft.SharePoint;

namespace BilSimser.SharePoint.WebParts.Forums.Core.Service.Builders
{
/// <summary>
/// Summary description for ListBuilder.
/// </summary>
public abstract class ListBuilder
{
protected string listName;
protected bool createDefaultValues = false;

/// <summary>
/// Initializes a new instance of the <see cref="ListBuilder"/> class.
/// </summary>
protected ListBuilder()
{
}

/// <summary>
/// Gets a value indicating whether create default values.
/// </summary>
/// <value><c>true</c> if create default values; otherwise, <c>false</c>.</value>
public bool CreateDefaultValues
{
get { return createDefaultValues; }
}

/// <summary>
/// Gets a value indicating whether the List for
/// this <see cref="ListBuilder"/> exists or not.
/// </summary>
/// <value><c>true</c> if exists; otherwise, <c>false</c>.</value>
public bool ListExists
{
get
{
bool listExists = false;

try
{
Console.WriteLine(ForumApplication.Instance.SpWeb.ListslistName);
listExists = true;
}
catch (Exception)
{
}

return listExists;
}
}

/// <summary>
/// Creates the list.
/// </summary>
public void CreateList()
{
if (!ListExists)
{
InternalCreateList();
}
}

/// <summary>
/// Adds the field to list. Only adds the field if it doesn't already exist.
/// </summary>
/// <param name="fieldName">Name of the field.</param>
/// <param name="fieldType">Type of the field.</param>
/// <param name="isRequired">if set to <c>true</c> is required.</param>
/// <returns></returns>
protected string AddFieldToList(string fieldName, SPFieldType fieldType, bool isRequired)
{
string field = string.Empty;
SPList list = null;

ForumApplication.Instance.SpWeb.AllowUnsafeUpdates = true;
list.BreakRoleInheritance(true);
list.AnonymousPermMask64 = (SPBasePermissions.ViewListItems |
SPBasePermissions.EditListItems | SPBasePermissions.Open |
SPBasePermissions.BrowseDirectories
| SPBasePermissions.OpenItems | SPBasePermissions.AddListItems);

try
{
if (ListExists)
{
list = ForumApplication.Instance.SpWeb.ListslistName;
field = list.FieldsfieldName.ToString();
}
}
catch
{
try
{
field = list.Fields.Add(fieldName, fieldType, isRequired);
}
catch (Exception)
{
}
}

return field;
}

/// <summary>
/// Adds the list values.
/// </summary>
/// <param name="values">The values.</param>
protected void AddListValues(string[] values)
{
SharePointListItem listItem = new SharePointListItem(0, values);
SharePointListProvider provider = new SharePointListProvider(ForumApplication.Instance.SpWeb);
provider.AddListItem(listName, listItem);
}

/// <summary>
/// Creates the SharePoint list and adds it to the SPListCollection.
/// </summary>
/// <returns>The new Guid for the list added.</returns>
private Guid InternalCreateList()
{
ForumApplication.Instance.SpWeb.AllowUnsafeUpdates = true;
SPList list = ForumApplication.Instance.SpWeb.ListslistName;
list.BreakRoleInheritance(true);
list.AnonymousPermMask64 = (SPBasePermissions.ViewListItems |
SPBasePermissions.EditListItems | SPBasePermissions.Open |
SPBasePermissions.BrowseDirectories
| SPBasePermissions.OpenItems | SPBasePermissions.AddListItems);
createDefaultValues = true;
return ForumApplication.Instance.SpWeb.Lists.Add(listName, string.Empty, SPListTemplateType.GenericList);
}

/// <summary>
/// Hides the list.
/// </summary>
public void HideList()
{
ForumApplication.Instance.SpWeb.AllowUnsafeUpdates = true;
SPList list = ForumApplication.Instance.SpWeb.ListslistName;
list.BreakRoleInheritance(true);
list.AnonymousPermMask64 = (SPBasePermissions.ViewListItems | SPBasePermissions.EditListItems | SPBasePermissions.Open | SPBasePermissions.BrowseDirectories
| SPBasePermissions.OpenItems | SPBasePermissions.AddListItems);
list.Hidden = true;
list.Update();
}

// Pure virtual methods to be overridden by child classes
public abstract void AddFields();
public abstract void AddSampleData();
}
}

**********************
I reload the BilSimser.SharePoint.WebParts.Forums.dll into the GAC, upload SharePointForums.dwp (with the new public key token), and change the public key token on the safe control in the web.config. I then receive this error (after an iis reset) "Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe. "

What am I missing so I can run this with contribute rights, instead of admin in Moss 2007?

Thanks

Nov 29, 2007 at 4:06 PM
Scoutmanpt, can you give us more information. Whats the current state of this web part. Does anyone have a simple task list of what has to be done to get it working in moss 2007. I'd really like to use it for an internal project I am working on. Seems much nicer than the ootb forums.

THanks!
Nov 30, 2007 at 5:30 PM
Edited Nov 30, 2007 at 5:31 PM
Got the packaged version to work with Designer permissions. It would be nice to know how to compile the source code, and use it.