Showing posts with label folders. Show all posts
Showing posts with label folders. Show all posts

September 27, 2007

MOSS: Populating folders containing items to a list in Site Definition

Problem:
In Site Definition, one can define the default folders or items that are created to a list on a site when the site is created using Lists-List-Data-Rows-Row-Field elements.

How to create folders that contain items, i.e., a hierarchy of folders containing items?

Thoughts:
Cannot be done using current web's feature receivers since the list items do not yet exist when the features are activated.

Workaround:
Create a feature that moves the items into correct folders in the list. Activate this feature programmatically after the site is created.

Solution:
Unknown

April 3, 2007

MOSS: Creating folders to list in ONET.XML

Problem:
One can easily create items to lists in ONET.XML, but how to create folders?

Solution:
Key is to use ContentTypeId and FSObjType.
<Row>
  <Field Name='ContentTypeId'>0x0120</Field>
  <Field Name='FSObjType'>1</Field>
  <Field Name='Title'>folder title</Field>
  <Field Name='LinkTitle'>folder title</Field>
</Row>