One site collection with multiple sub-sites and the same lists?

Oct 18, 2010 at 8:12 PM

Is it possible to have SLAM working on one site collection with two (or more) subsites, both of which have the same lists?  See the example below:

Site #1: http://sharepoint/sites/test/site1
Lists: Sites and Site Users 

Site #2: http://sharepoint/sites/test/site2
Lists: Sites and Site Users

Here's an example slam.config as well:

  <DataMapping DataSchema="SLAM" SiteCollection="sites/test">
    <List Site="/sites/test/site1" Name="Site Users" ActivationOrder="1" TableName="site1_SiteUsers">
      <Fields>
        <Field Name="Associated Sites" SPType="LookupMulti" AssociatedList="Site Profiles" AssociationName="SiteUsersToSites"></Field>
        <Field Name="First Name" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Middle Initial" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Last Name" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
      </Fields>
    </List>
    <List Site="/sites/test/site1" Name="Site Profiles" ActivationOrder="2" TableName="site1_SiteProfiles">
      <Fields>
        <Field Name="Institution Name" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Site City" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Site State" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Site Zip" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
      </Fields>
    </List>
    <List Site="/sites/test/sites2" Name="Site Users" ActivationOrder="3" TableName="site2_SiteUsers">
      <Fields>
        <Field Name="Associated Sites" SPType="LookupMulti" AssociatedList="Site Profiles" AssociationName="SiteUsersToSites"></Field>
        <Field Name="First Name" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Middle Initial" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Last Name" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
      </Fields>
    </List>
    <List Site="/sites/test/site2" Name="Site Profiles" ActivationOrder="4" TableName="site2_SiteProfiles">
      <Fields>
        <Field Name="Institution Name" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Site City" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Site State" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Site Zip" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
      </Fields>
    </List>
  </DataMapping>
Is this possible to do?  I've been running into the errors described in this post which don't seem to have any resolution posted yet: http://slam.codeplex.com/workitem/5457
Thanks,
Andrew

Developer
Oct 19, 2010 at 1:09 AM

Because SLAM sees these as two separate and distinct lists, when the synchronization runs, SLAM makes sure that only items that exist in the SharePoint list are in the SLAM database so it deletes the data from the first list when it synchronizes the second.

 

Rather than defining the schema for that list in two places, you should be using a content type. Then you SLAM the content type and data from all the different instances will SLAM to the same table.