[mapguide-users] Storing WebLayout in Session Repository

Gunter Becker gunter.becker at CSOGIS.DE
Wed Feb 21 05:42:01 EST 2007


Hi all,

I'm trying to store a modyfied WebLayout in the users "Session-Repository"
with the following code (same as in Devolper's Guide, page 70, "Making
Changes Permanent"):

     // get the XMLDocument as byte-array
     byte[] byteArray = new byte[xmlWebLayout.OuterXml.Length];

     // store the WebLayout in Session-Repository
     MgByteSource byteSource = new MgByteSource(byteArray,
byteArray.Length);
     byteSource.MimeType = MgMimeType.Xml;
     MgResourceIdentifier userWebLayoutId = new
MgResourceIdentifier("Session:" + MgSessionId + @"//Current." +
MgResourceType.WebLayout);
    
resourceService.SetResource(userWebLayoutId,byteSource.GetReader(),null);

When executing the last line of the code I get the error massage:

Argument is null. Exception occurred in method
MgResourceContentManager.AddResource at line 153 in file
c:\build_bond_area\mapguide_open_source\build_3.1\mgdev\server\src\services\resource\ResourceContentManager.cpp

Maybe the null-value for the ResourceHeader isn't correct when storing a
WebLayout. How can I get a ResourceHeader for that Resource. Is it possible
to store a WebLayout in a Session-Repository  at all????

When using the "SetResource"-Operation manually through the "Web Tier Test"
and place current ResourceId and the users Session-Repository and leave the
Header-Textbox blank then it works fine. After that I'm able to get the
AjaxViewer show the modyfied WebLayout.

Hope that somebody can help me out of this.

Thanks in advance,

Gunter
-- 
View this message in context: http://www.nabble.com/Storing-WebLayout-in-Session-Repository-tf3265925s16610.html#a9078585
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list