createweb

Feb 15, 2010 at 5:26 PM

great examples to learn saf,

Please help me resolve one error I am facing while running msbuild example of CreateWeb which I downloaded from codeplex. its giving error: The Saf task failed unexpectedly - Microsoft.Sharepoint.SPException : "http://SimpleSite.uk"  contains illegal chacter ':'.

I passes the url "http://SimpleSite.uk" in the url tag of macrotemplate.

Coordinator
Feb 15, 2010 at 5:46 PM

Hey up Dilraj

Few questions..

1. Can you send me the MSBuild Xml that you are using ?

2. Does http://simplesite.uk exist as site collection ?

Have you specified the simplesite as a Url element in MSBuild ? e.g. <Url>http://simplesite.uk</Url> ??

Cheers

Mark

 

Coordinator
Feb 15, 2010 at 8:18 PM
Edited Feb 15, 2010 at 8:20 PM

Actually - I think there may be something to change here....

If you look at the sample XML 'http://www.collaboris.co.uk/saf/doc/Collaboris.Saf.Actions.Wss.Web.CreateWeb.html' (click on the MSBuild tab) - you will see that there are 2 "Url" elements (one uppercase, one lowercase)

The Upper case "Url" is designed to specify the url that will return the relevant SharePoint Context (SPSite). (This is consistent for all MSBuild actions). This should be the absolute path e.g. http://www.somesite.com.

However, the lower case "url" is the one which describes the url for the new web (and is used by the Action). This should be a relative path to (the Url), not absolute. Can you see if you have these set correctly ?

If this is the problem, I will rename the lower case "url" to "RelativeUrl", bacause I think it's confusing.

BTW. Each Entity (class used for passing parameters to the action, is also documented). In your case please take a look at this : http://www.collaboris.co.uk/saf/doc/Collaboris.Saf.Actions.Wss.Entities.WebInfo.html.

Keep me updated,

Mark

Feb 18, 2010 at 12:28 PM

Hi Mark ,

Thanks for your help, I checked my site it does exists, and the url and URL tag was confusing me. I changed the url tag to relative url but I am still getting the same error. Please view my MSBuild xml as follows

<?xml version="1.0" encoding="utf-8"?>
<!-- Defines a 'SAF Macro' containiing 'Actions' to be run on 'Do' and 'Undo' -->
<!-- Please visit http://www.collaboris.co.uk/Saf/Doc/default.html for more information. -->
<Project DefaultTargets="Do" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask AssemblyName="Collaboris.Saf, Version=2.0.0.0, Culture=neutral, PublicKeyToken=182db3eac6a9e195" TaskName="Collaboris.Saf.Adapters.MSBuild.SAF" />
  <ItemGroup>
    <Macros Include="Collaboris.Saf.Actions.Wss.Web.CreateWeb.macroTemplate">
      <disabledo>false</disabledo>
      <disableundo>false</disableundo>
      <description>New Web created by SAF</description>
      <lcid>1033</lcid>
      <overwrite>true</overwrite>
      <template>STS#0</template>
      <title>New Web title</title>
      <url>Test2</url>
      <useuniqueperms>false</useuniqueperms>
      <webname>Test2</webname>
      <id>{47B640DD-64A9-493b-8445-789FC0D05FF1}</id>
      <stopondoexception>true</stopondoexception>
      <stoponundoexception>true</stoponundoexception>
      <Url>http://simplesite.uk</Url>
      <InstanceId>{{156E17A5-A7BA-4e1f-8A48-1BC341A7C658}}</InstanceId>
    </Macros>
  </ItemGroup>
  <Target Name="Do">
    <SAF MacroPaths="@(Macros)" ProcessMode="Do" ContinueOnError="false" />
  </Target>
  <Target Name="Undo">
    <SAF MacroPaths="@(Macros)" ProcessMode="Undo" ContinueOnError="false" />
  </Target>
</Project>

 

Thanks

Dilraj