Programmatic List Update

Jul 15, 2009 at 4:10 PM

It appears that if I edit a list item programmatically, the update event does not fire for SLAM! ?

Developer
Jul 15, 2009 at 4:26 PM

It does.  Are you calling update in the context of SharePoint?  SLAM events run so long as any SharePoint events are running.  The only difference is that SLAM needs to be able to find its configuration, which is not a problem unless you are doing updates in a console app or any other non-SharePoint context.  In those cases you need to direct the executing process to the slam config.

Jul 15, 2009 at 4:48 PM
Edited Jul 15, 2009 at 5:36 PM

Brian -

Update: NOT A BUG. It's my configuration...I am still testing, but I will update this post when I am done in case anyone else has a similar setup to my own.

Jul 15, 2009 at 5:40 PM

Ok, here's the deal, I have mulitple zones in SP...for various authentications. I setup and configured the default site...initialized the whole deal. I figured once I initialized I was good to go.

But I neglected to copy the slam.config to my other zones. Sure Slam worked without this on my default zone and it looks like there is no need to reinitialize the component for each zone...but I did need the config in each web site. When my automated app updated the list items it was using another zone for authentication.

In short, copied the slam.config file over to all zones, restarted iis, and everything is working!

 

Developer
Jul 15, 2009 at 6:27 PM

This is a pretty common set up for our applications as well.  What you might consider doing is, instead of managing separate copies of the slam.config for each zone, pick a single location for your slam.config and point to it in each zone's web.config.  Here is an example of the key to add.

<add key="AWS.SLAM.ConfigurationManager.Config" value="C:\Inetpub\wwwroot\wss\CommonFiles\slam.config" />

Happy Slamming!

Jul 18, 2009 at 1:12 AM

Yes, just tried that and you're right, that is a better solution.  Thanks!

While we are on the topic of slam.config file placement...I have noticed the following Error in Windows event viewer several times during the day...Note that I AM running Reporting Services in Sharepoint integrated mode..but I have no idea why SLAM is looking for a home there...? If it means anything, I am SLAMMING a Doc Library that contains RS reports...but it's just a list, right? Seems to be no harm done and I still sync, but the error is odd.

System.TypeInitializationException: The type initializer for 'AWS.SLAM.ComponentService' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not find file 'C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\slam.config'.

 

Jul 24, 2009 at 11:34 PM

Hi Brian,

We just installed SLAM and everything works great except that when update our SharePoint list, the corresponding database table is NOT updated.  We have to manualy click the "Synchronize" button in order to propagate any data changes.  We only have one SharePoint site, and the "slam.config" file in the directory looks like this:

 

<?xml version="1.0" encoding="utf-8" ?>

<Configuration>

<ConnectionStrings Default="SLAM">

<add Name="SLAM" ConnectionString="Data Source=database; Initial Catalog=AssetDB; User Id=User; Password=XX" />

</ConnectionStrings>

 

<DataMapping DataSchema="SLAM">

<List Site="IMS" Name="Owners" ActivationOrder="1" >

<Fields>

<Field Name="ID" SqlType="int" SPType="Integer" Required="true" />

<Field Name="UserName" SqlType="varchar(255)" SPType="Text" Required="true" />

</Fields>

</List>

</DataMapping>

</Configuration>

 

 

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <ConnectionStrings Default="SLAM">
    <add Name="SLAM" ConnectionString="Data Source=IDEA-02; Initial Catalog=AssetDB; User Id=AssetDBService; Password=Passw0rd" />
  </ConnectionStrings>
  <DataMapping DataSchema="SLAM">
    <List Site="IMS" Name="Owners" ActivationOrder="1" >
      <Fields>
        <Field Name="ID" SqlType="int" SPType="Integer" Required="true" />
        <Field Name="UserName" SqlType="varchar(255)" SPType="Text" Required="true" />
      </Fields>
    </List>
  </DataMapping>
</Configuration>

 

 

You said "SLAM events run so long as any SharePoint events are running" but I am not sure what you meant by this.  Is there something "special" we have to do to ensure events are running?  For SLAM, we have clicked the "Activate" button and gotten the following output:

7/24/2009 4:33:48 PM Information Activation Complete 

7/24/2009 4:33:48 PM Information Processing Owners 

7/24/2009 4:33:48 PM Information Attached Event Handlers for List: IMS - Owners 

7/24/2009 4:33:48 PM Information Activation Initiated 

7/24/2009 4:33:48 PM Information Deactivation Complete 

 

Any ideas?  

 

Thanks in advance...

-Dave

 

Jul 24, 2009 at 11:39 PM

Brian,

 

Sorry for the quick follow-up, we are getting this error in our Application Event Log:

 

 

Error loading and running event receiver AWS.SLAM.ListItemEventManager in AWS.SLAM, Version=1.0.3.0, Culture=neutral, PublicKeyToken=28f8d30936a98765. Additional information is below.
: Requested registry access is not allowed.

Event Type: Error

Event Source: Windows SharePoint Services 3

Event Category: General 

Description:

Error loading and running event receiver AWS.SLAM.ListItemEventManager in AWS.SLAM, Version=1.0.3.0, Culture=neutral, PublicKeyToken=28f8d30936a98765. Additional information is below.

: Requested registry access is not allowed.

 

Have you seen this error before? 

 

Thanks again.

Dave

 

Sep 22, 2009 at 8:30 PM

Brian I am having the same issue as Dave above.  I only have one Sharepoint main site.  Do I still need to add key?  I have users adding records to the list but it is not updating the SQL database.

Thanks!  Otherwise the product is working great so far.  Oh also, I had another question.  With another list, do I just repeat the code for the list I got working?

Perhaps this is in a manual but I did not come across one.

Quanda 

Sep 22, 2009 at 8:42 PM

Brian...NEVERMIND...it is working.  Sorry about that when I came in first thing this morning and refreshed my Crystal Report it didn't look like today's data had moved but I just tested an item and that part is working.  Guess my other question though still stands about multiple lists.

Thanks! Quanda

Developer
Sep 22, 2009 at 10:02 PM

Hi Quanda,

When you are slamming lists, you need to define each one you want to slam in the slam config.  If you have many lists that are all the same type of list, you should build them using a content type.  Then you can just slam that content type and any list that derives from it will be slammed.

Yours,

Allan

Sep 24, 2009 at 2:17 AM
Edited Sep 24, 2009 at 7:28 AM

Hi,

SLAM is working fine through the UI, but I have a console application that is changing a SP List and this is not being SLAMed. I have copied the exe to the same directory as the slam.config file. I have also added an appsetting to the .exe.config file as below but the console app changes are still not getting SLAMed to the DB. Does anybody know how to get this working?

<add key="AWS.SLAM.ConfigurationManager.Config" value="C:\Inetpub\wwwroot\wss\VirtualDirectories\spdev.qic.com.au80\slam.config" />

Thanks

Jan 8, 2010 at 11:31 PM

Allan, with regards to you post about multiple lists do you have an example I can follow?  Sorry code writing is not my strongest suit so I am not sure what it is that I should be doing.  Thanks for any help and direction.

Quanda

Developer
Jan 11, 2010 at 12:46 AM

@sbarbarella, It's not a question of writing code.  If you create a content type and then create your lists based on that content type, you can then slam that content type and any data saved in any list based on that content type will be slammed into the same database table.

Jan 19, 2010 at 5:09 PM
Ok I get now what you are saying.  I guess the thing I am struggling with is two fold.  One, setting up the content type which I am sure I can find a resource online but it has to be in the same table?  What if you want that list's data in a different table...how would you setup your config file to handle that and is it basically just "repeating" in a sense what I have already created for a different list going to a different table?

On Sun, Jan 10, 2010 at 6:46 PM, awellenstein <notifications@codeplex.com> wrote:

From: awellenstein

@sbarbarella, It's not a question of writing code.  If you create a content type and then create your lists based on that content type, you can then slam that content type and any data saved in any list based on that content type will be slammed into the same database table.

Read the full discussion online.

To add a post to this discussion, reply to this email (SLAM@discussions.codeplex.com)

To start a new discussion for this project, email SLAM@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Think Before You Print
Contact me at Google Voice:   (319) 853-8060
Developer
Jan 19, 2010 at 5:25 PM

Sorry, I'm not sure I'm following what you're trying to accomplish.  Can you give a more specific/detailed use case?

Jan 19, 2010 at 5:37 PM
Sure, I am currently slamming one list in my SP site.  I now have another list with different fields, information, etc...totally unrelated to that list I am currently slamming.  You said "slam the content type" but that that would slam the list and add it to the table.  The same existing table that I am currently using for the slam I have working?
 
I want to slam that second list and have it's results go into a different table.  Perhaps seeing my config will help...maybe I have that setup wrong even though it is working.  See the tag DataMapping DataSchema, I was thinking that perhaps I duplicated that below but with the SP list and SQL table referenced for the other table I want to slam.  I'm sorry I seem obtuse when it comes to understanding this and that's what I meant by my coding skills are not that great.  In essense, I suppose I just don't understand SLAM and SP as well as I should.  So I am just looking for direction to head the right way so that I can SLAM more and more lists since it is working fantastically.  We use Crystal Reports in house and so far SLAM is the only thing that has gotten me to be able to report on the list data with minimal code writing as I am most familiar with CR.  I REALLY appreciate the help.
 
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <ConnectionStrings Default="SLAM">
    <add Name="SLAM" ConnectionString="Database=SLAM;Data Source=IA01_REPORTS;User Id=username;Password=password" />
  </ConnectionStrings>
  <DataMapping DataSchema="SLAM">
    <List Site="RetailSales/Branches" Name="AE Sign In" ActivationOrder="1">
      <Fields>
        <Field Name="Status" SqlType="varchar(15)" SPType="Text" Required="true"></Field>
        <Field Name="Created By" SqlType="varchar(50)" SPType="Text" Required="true"></Field>
        <Field Name="FSR SignUp Timestamp" SqlType="DateTime" SPType="Date and Time" Required="true"></Field>
        <Field Name="First Name" SqlType="varchar(40)" SPType="Text" Required="true"></Field>
        <Field Name="Last Name" SqlType="varchar(40)" SPType="Text" Required="true"></Field>
        <Field Name="Contact Number" SqlType="varchar(12)" SPType="Text" Required="true"></Field>
        <Field Name="Appt?" SqlType="varchar(20)" SPType="Text" Required="true"></Field>
        <Field Name="Purpose of Visit" SqlType="varchar(50)" SPType="Text" Required="true"></Field>
        <Field Name="Branch" SqlType="varchar(25)" SPType="Text" Required="true"></Field>
        <Field Name="AE" SqlType="varchar(50)" SPType="Text" Required="true"></Field>
        <Field Name="AE PickUp Timestamp" SqlType="DateTime" SPType="Date and Time" Required="true"></Field>
        <Field Name="AE Complete Timestamp" SqlType="DateTime" SPType="Date and Time" Required="true"></Field>
      </Fields>
    </List>
  </DataMapping>
</Configuration>


On Tue, Jan 19, 2010 at 11:25 AM, awellenstein <notifications@codeplex.com> wrote:

From: awellenstein

Sorry, I'm not sure I'm following what you're trying to accomplish.  Can you give a more specific/detailed use case?

Read the full discussion online.

To add a post to this discussion, reply to this email (SLAM@discussions.codeplex.com)

To start a new discussion for this project, email SLAM@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Think Before You Print
Contact me at Google Voice:   (319) 853-8060
Developer
Jan 19, 2010 at 7:03 PM

Gotcha.  I misunderstood your earlier question about "multiple lists".  It's very easy, just add another list node to your slam config mapping the second list and then reactivate slam.  For details on the slam config see:  http://slam.codeplex.com/wikipage?title=config%20file

Yours,

Allan