Showing posts with label feature. Show all posts
Showing posts with label feature. Show all posts

April 19, 2007

MOSS: Approval and Collect Feedback workflows cannot be associated to custom content types

Problem:
When I add a OOB Document Library to a site, Approval and Collect Feedback workflows are automatically visible for the documents. In other words, these workflows are associated with the 0x0101 content type.

When I create a custom document library using a custom content type that is a direct child of 0x0101 content type, these workflows cannot be associated to that content type.

Thoughts:
It doesn't do any good to set the BaseType of your custom content type to 0x0101.

Neither does it help to put a AssociationCategories tag into the ReviewWorkflows feature, trying to associate the OOB workflows to your custom content type.

If you include both your custom content type and 0x0101 content type in your custom Document Library feature's schema.xml, you can see the Workflows menu item in the menu when you hover mouse over a document in your custom list. But still there are no workflows associated.

Workaround:
Associate workflows to content types manually using a browser.

Solution:
Unknown.

March 20, 2007

MOSS: Connect to Outlook missing from my custom tasks list

Problem:
I created a custom tasks list, now "Connect to Outlook" option is missing in Actions menu, Client Integration is enabled.

Workaround:
Your custom task list must have same type as the original MOSS list, i.e., your custom Task list must be of type 107. This doesn't seem to be a requirement with DocLibs, however.

March 19, 2007

MOSS: Creating subsites in site definition

Well, not really, but by using a MOSS 2007 Features you can automatically create sites below the site user just created. Other way to create sites is to use Provisioning.

FeatureEventHandler:
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
    using(SPWeb web = properties.Feature.Parent as SPWeb)
    {
        // Check that subsites do not already exist
        if(web.Webs.Count == 0)
        {
            // Create subsites
            try
            {
                web.Webs.Add("", "SubSite1 Title", "", 1033, "", false, false);
                web.Webs.Add("", "SubSite2 Title", "", 1033, "", false, false);
                web.Webs.Add("", "SubSite3 Title", "", 1033, "", false, false);
            }
            catch(Exception e)
            {
                throw new SPException("Error when trying to create subsites. Error: " +
e.Message);
            }
        }
    }
}

Create new subsite Feature:

<feature id="7F4AA5EF-6A62-4a08-8565-DE39C02839E7"

title="Subsites"

description="Creates subsites for specific sites."

version="1.0.0.0"

hidden="TRUE"

scope="Web"

xmlns="http://schemas.microsoft.com/sharepoint/" receiverassembly="FeatureEventHandler,Version=1.0.0.0,Culture=neutral,PublicKeyToken=60a5c2355dc3549c"

receiverclass="Features.FeatureEventHandler">

</feature>