RE: default content type
Its any changes but in my example below - I was setting the value of a text field. It isn't reproducible on new documents, just documents uploaded previously. I might look at writing a power shell script to set the column and see if that fixes it. From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Tuesday, 14 June 2011 12:11 PM To: ozMOSS Subject: RE: default content type Changes to metadata are changing the content type? What sort of changes? Are you referring to choice columns or something? Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Maxine Harwood Sent: Tuesday, 14 June 2011 11:45 AM To: ozMOSS Subject: default content type Is this the expected behaviour? SharePoint standard 2010. I have a library with multiple content types. Whenever an existing document that was based on the default content type has metadata modified, the content type is also modified?? It occurs regardless of how the metadata is changed - i.e. via the properties window or a workflow (Nintex). As an example , I have a document that was uploaded with the default content type of ABC. The default content type has recently been changed to XYZ. Any changes to the document now change the content type to XYZ. Any suggestions on how to work around this? ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
RE: sharepoint search server express 2010
Yeah my understanding is that you can add a WFE, but the search service will only ever be one server. Assuming that's true, and given that many orgs who would invest in a multi-server farm would likely buy standard, there is little disincentive to not to Search server express. I have foundation clients running it (and used the previous version also) One warning - a client of mine really did a number on his farm with a botched install of Office Web Apps on it. From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Brian Farnhill Sent: Tuesday, 14 June 2011 9:25 AM To: ozMOSS Subject: RE: sharepoint search server express 2010 I believe you can still separate SQL, the limitation is around having only a single application server. Check out this document on TechNet for more info on the differences and choosing between the full and express versions of Search Server http://technet.microsoft.com/en-us/library/ee808898.aspx Description: Description: avatarpic-l Brian Farnhill Solutions Architect, Extelligent Design | SharePoint Server MVP phone: 0408 289 303 | twitter: http://twitter.com/BrianFarnhill @BrianFarnhill | blog: http://blog.brianfarnhill.com/ blog.brianfarnhill.com | xbox: http://live.xbox.com/en-AU/MyXbox/Profile?gamertag=Noble+Downfall Noble Downfall image001.png___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
RE: SharePoint 2010 books
Then I retract my email. Seems there's no need to promote wowebooks as Google is doing this much better than anyone possibly could. ;o) Sent from my Windows 7 Phone -Original Message- From: Ajay Sent: Tuesday, 14 June 2011 1:23 PM To: ozMOSS Subject: Re: SharePoint 2010 books Interesting thing is if in search sometimes this wowebook comes in search results even on top of Amazon and mostly very near to it. On Tue, Jun 14, 2011 at 2:48 PM, Paul Noone paul.no...@ceosyd.catholic.edu.au wrote: Thanks Victor. Didn’t realise these were pirate copies. I thought the download link was to view an extract. So naïve! J *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Victor Isakov *Sent:* Friday, 10 June 2011 8:18 PM *To:* ozMOSS *Subject:* RE: SharePoint 2010 books Hi Rinaldo, I'm sorry, but do you think it's appropriate to promote websites that pirate eBooks? We all know the reality of these websites existing but perhaps they should not be promoted. Writing books is a 6 - 18 month exercise, for not a lot of revenue. And people pirating ebooks does not help on the slightest. So you will see less books being written, especially good books by MVPs and such, because it's simply not worth their time. And the industry suffers as a result. My AUD $0.02... Sent from my Windows 7 Phone -- *From: *Rinaldo De Paolis *Sent: *Friday, 10 June 2011 6:06 PM *To: *ozMOSS *Subject: *RE: SharePoint 2010 books Try http://www.wowebook.com/sharepoint * * *Rinaldo De Paolis* */IM rina...@connectedsystems.com ( +61 8 9227 0416 ( +61 4 5107 6211 [image: Description: cid:image002.jpg@01C76545.12AE9A90] [image: Description: MSGoldPartner] *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Jason Taylor *Sent:* Friday, 13 May 2011 9:57 AM *To:* ozMOSS *Subject:* RE: SharePoint 2010 books I use safaribooksonline.com. You pay a monthly subscription and get access to a good selection of SharePoint titles as long as you don't mind reading on the screen. *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Nigel Hertz *Sent:* Friday, 13 May 2011 11:10 AM *To:* ozMOSS *Subject:* RE: SharePoint 2010 books I use Wrox' SharePoint 2010 Administrationhttp://www.wrox.com/WileyCDA/WroxTitle/Professional-SharePoint-2010-Administration.productCd-047051.html and SharePoint 2010 Developmenthttp://www.wrox.com/WileyCDA/WroxTitle/Professional-SharePoint-2010-Development.productCd-0470529423.html - main ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss [The entire original message is not included.] ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
RE: SharePoint 2010 books
At least they're free... I know of some websites that charge per pirated eBook that you download, or have an annual fee to download as many pirated eBooks as you like. This is what I find a bit reprehensible. I don't really care about wowebooks... Sent from my Windows 7 Phone -Original Message- From: Paul Noone Sent: Tuesday, 14 June 2011 12:48 PM To: ozMOSS Subject: RE: SharePoint 2010 books Thanks Victor. Didn't realise these were pirate copies. I thought the download link was to view an extract. So naïve! :) From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Victor Isakov Sent: Friday, 10 June 2011 8:18 PM To: ozMOSS Subject: RE: SharePoint 2010 books Hi Rinaldo, I'm sorry, but do you think it's appropriate to promote websites that pirate eBooks? We all know the reality of these websites existing but perhaps they should not be promoted. Writing books is a 6 - 18 month exercise, for not a lot of revenue. And people pirating ebooks does not help on the slightest. So you will see less books being written, especially good books by MVPs and such, because it's simply not worth their time. And the industry suffers as a result. My AUD $0.02... Sent from my Windows 7 Phone From: Rinaldo De Paolis Sent: Friday, 10 June 2011 6:06 PM To: ozMOSS Subject: RE: SharePoint 2010 books Try http://www.wowebook.com/sharepoint Rinaldo De Paolis */IM rina...@connectedsystems.commailto:rina...@connectedsystems.com * +61 8 9227 0416 * +61 4 5107 6211 [cid:image001.jpg@01CC2788.60EF6900] [cid:image002.jpg@01CC2788.60EF6900] From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Jason Taylor Sent: Friday, 13 May 2011 9:57 AM To: ozMOSS Subject: RE: SharePoint 2010 books I use safaribooksonline.com. You pay a monthly subscription and get access to a good selection of SharePoint titles as long as you don't mind reading on the screen. From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Nigel Hertz Sent: Friday, 13 May 2011 11:10 AM To: ozMOSS Subject: RE: SharePoint 2010 books I use Wrox' SharePoint 2010 Administrationhttp://www.wrox.com/WileyCDA/WroxTitle/Professional-SharePoint-2010-Administration.productCd-047051.html and SharePoint 2010 Developmenthttp://www.wrox.com/WileyCDA/WroxTitle/Professional-SharePoint-2010-Development.productCd-0470529423.html - main ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
SPWebCollection Add Method
Hi all, I'm trying to provision a subsite using this method and am stuck on the nLCID parameter. The API states a 32-bit GUID is required but I can't find one! :) I want to inherit from the parent Site which uses English-AU but am not sure if I'm getting it properly. Will the following work? if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { //Inherit LCID from parent uint webLCID = SPSite.Language; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add(AboutUs, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } Kind regards, Paul Noone --- Online Developer/SharePoint Administrator Infrastructure Team, ICT Catholic Education Office, Sydney p: (02) 9568 8461 f: (02) 9568 8483 e: paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au w: http://www.ceosyd.catholic.edu.au/ ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
RE: SPWebCollection Add Method
OK. Almost there using siteCollection.RootWeb.Locale but now I'm having trouble with converting the value. The following will build without error but just looks plain wrong. Does anyone know what type of field I'm dealing with? //Inherit LCID from parent string LCID = siteCollection.RootWeb.Locale.ToString(); uint webLCID = Convert.ToUInt32(LCID); Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Wednesday, 15 June 2011 11:13 AM To: ozMOSS (ozmoss@ozmoss.com) Subject: SPWebCollection Add Method Hi all, I'm trying to provision a subsite using this method and am stuck on the nLCID parameter. The API states a 32-bit GUID is required but I can't find one! :) I want to inherit from the parent Site which uses English-AU but am not sure if I'm getting it properly. Will the following work? if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { //Inherit LCID from parent uint webLCID = SPSite.Language; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add(AboutUs, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } Kind regards, Paul Noone --- Online Developer/SharePoint Administrator Infrastructure Team, ICT Catholic Education Office, Sydney p: (02) 9568 8461 f: (02) 9568 8483 e: paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au w: http://www.ceosyd.catholic.edu.au/ ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
Re: SPWebCollection Add Method
SPWeb.Locale returns a CultureInfohttp://msdn.microsoft.com/EN-US/library/kx54z3k7object, so you should be able to pass the LCIDhttp://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcidproperty from this straight into the add method. eg: siteCollection.Add(foo, foo, bar, siteCollection.RootWeb.Locale.LCID); On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone paul.no...@ceosyd.catholic.edu.au wrote: OK. Almost there using siteCollection.RootWeb.Locale but now I’m having trouble with converting the value. The following will build without error but just looks plain wrong. Does anyone know what type of field I’m dealing with? //Inherit LCID from parent string LCID = siteCollection.RootWeb.Locale.ToString(); uint webLCID = Convert.ToUInt32(LCID); Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team *CEO Sydney* *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Paul Noone *Sent:* Wednesday, 15 June 2011 11:13 AM *To:* ozMOSS (ozmoss@ozmoss.com) *Subject:* SPWebCollection Add Method Hi all, I’m trying to provision a subsite using this method and am stuck on the * nLCID* parameter. The API states a 32-bit GUID is required but I can’t find one! J I want to inherit from the parent Site which uses English-AU but am not sure if I’m getting it properly. Will the following work? if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { //Inherit LCID from parent uint webLCID = SPSite.Language; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add( AboutUs, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } Kind regards, Paul Noone --- Online Developer/SharePoint Administrator Infrastructure Team, ICT Catholic Education Office, Sydney p: (02) 9568 8461 f: (02) 9568 8483 e: paul.no...@ceosyd.catholic.edu.au w: http://www.ceosyd.catholic.edu.au/ ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
RE: SPWebCollection Add Method
I tried using it directly first time round which is how I wound up stuck with messy conversions. :) Error 1The best overloaded method match for 'Microsoft.SharePoint.SPWebCollection.Add(string, string, string, uint, string, bool, bool)' has some invalid arguments Error 2Argument '4': cannot convert from 'int' to 'uint' Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 12:15 PM To: ozMOSS Subject: Re: SPWebCollection Add Method SPWeb.Locale returns a CultureInfohttp://msdn.microsoft.com/EN-US/library/kx54z3k7 object, so you should be able to pass the LCIDhttp://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcid property from this straight into the add method. eg: siteCollection.Add(foo, foo, bar, siteCollection.RootWeb.Locale.LCID); On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au wrote: OK. Almost there using siteCollection.RootWeb.Locale but now I'm having trouble with converting the value. The following will build without error but just looks plain wrong. Does anyone know what type of field I'm dealing with? //Inherit LCID from parent string LCID = siteCollection.RootWeb.Locale.ToString(); uint webLCID = Convert.ToUInt32(LCID); Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Wednesday, 15 June 2011 11:13 AM To: ozMOSS (ozmoss@ozmoss.commailto:ozmoss@ozmoss.com) Subject: SPWebCollection Add Method Hi all, I'm trying to provision a subsite using this method and am stuck on the nLCID parameter. The API states a 32-bit GUID is required but I can't find one! :) I want to inherit from the parent Site which uses English-AU but am not sure if I'm getting it properly. Will the following work? if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { //Inherit LCID from parent uint webLCID = SPSite.Language; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add(AboutUs, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } Kind regards, Paul Noone --- Online Developer/SharePoint Administrator Infrastructure Team, ICT Catholic Education Office, Sydney p: (02) 9568 8461 f: (02) 9568 8483 e: paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au w: http://www.ceosyd.catholic.edu.au/ ___ ozmoss mailing list ozmoss@ozmoss.commailto:ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
Re: SPWebCollection Add Method
Oh, of course. Sorry for missing that the LCID is explicitly unsigned in the Add method :-). You should be able to use Convert.ToUInt32 on the LCID property, instead of trying to convert to ToString() representation of the Locale. Cheers, Joe. On Wed, Jun 15, 2011 at 12:20 PM, Paul Noone paul.no...@ceosyd.catholic.edu.au wrote: I tried using it directly first time round which is how I wound up stuck with messy conversions. J *Error 1*The best overloaded method match for 'Microsoft.SharePoint.SPWebCollection.Add(string, string, string, uint, string, bool, bool)' has some invalid arguments *Error 2*Argument '4': cannot convert from 'int' to 'uint' Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team *CEO Sydney* *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Joseph Clark *Sent:* Wednesday, 15 June 2011 12:15 PM *To:* ozMOSS *Subject:* Re: SPWebCollection Add Method SPWeb.Locale returns a CultureInfohttp://msdn.microsoft.com/EN-US/library/kx54z3k7object, so you should be able to pass the LCIDhttp://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcidproperty from this straight into the add method. eg: siteCollection.Add(foo, foo, bar, siteCollection.RootWeb.Locale.LCID); On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone paul.no...@ceosyd.catholic.edu.au wrote: OK. Almost there using siteCollection.RootWeb.Locale but now I’m having trouble with converting the value. The following will build without error but just looks plain wrong. Does anyone know what type of field I’m dealing with? //Inherit LCID from parent string LCID = siteCollection.RootWeb.Locale.ToString(); uint webLCID = Convert.ToUInt32(LCID); Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team *CEO Sydney* *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Paul Noone *Sent:* Wednesday, 15 June 2011 11:13 AM *To:* ozMOSS (ozmoss@ozmoss.com) *Subject:* SPWebCollection Add Method Hi all, I’m trying to provision a subsite using this method and am stuck on the * nLCID* parameter. The API states a 32-bit GUID is required but I can’t find one! J I want to inherit from the parent Site which uses English-AU but am not sure if I’m getting it properly. Will the following work? if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { //Inherit LCID from parent uint webLCID = SPSite.Language; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add( AboutUs, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } Kind regards, Paul Noone --- Online Developer/SharePoint Administrator Infrastructure Team, ICT Catholic Education Office, Sydney p: (02) 9568 8461 f: (02) 9568 8483 e: paul.no...@ceosyd.catholic.edu.au w: http://www.ceosyd.catholic.edu.au/ ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
RE: SPWebCollection Add Method
Thanks Joe. The following works nicely. :) //Inherit LCID from parent uint webLCID = Convert.ToUInt32(siteCollection.RootWeb.Locale.LCID); Now I have one more small problem. The Web site address /AboutUs is already in use. Which is true, if you're talking about the web application root site collection. However, I only want to get the parent site of the web I'm trying to create. Looks like I'm heading too high up the hierarchy. I'm currently creating the parent at a managed path teams/newsite. And want the subsite to be created at teams/newsite/AboutUs. Can I do this without having to use explicit paths? From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 12:26 PM To: ozMOSS Subject: Re: SPWebCollection Add Method Oh, of course. Sorry for missing that the LCID is explicitly unsigned in the Add method :-). You should be able to use Convert.ToUInt32 on the LCID property, instead of trying to convert to ToString() representation of the Locale. Cheers, Joe. On Wed, Jun 15, 2011 at 12:20 PM, Paul Noone paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au wrote: I tried using it directly first time round which is how I wound up stuck with messy conversions. :) Error 1The best overloaded method match for 'Microsoft.SharePoint.SPWebCollection.Add(string, string, string, uint, string, bool, bool)' has some invalid arguments Error 2Argument '4': cannot convert from 'int' to 'uint' Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 12:15 PM To: ozMOSS Subject: Re: SPWebCollection Add Method SPWeb.Locale returns a CultureInfohttp://msdn.microsoft.com/EN-US/library/kx54z3k7 object, so you should be able to pass the LCIDhttp://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcid property from this straight into the add method. eg: siteCollection.Add(foo, foo, bar, siteCollection.RootWeb.Locale.LCID); On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au wrote: OK. Almost there using siteCollection.RootWeb.Locale but now I'm having trouble with converting the value. The following will build without error but just looks plain wrong. Does anyone know what type of field I'm dealing with? //Inherit LCID from parent string LCID = siteCollection.RootWeb.Locale.ToString(); uint webLCID = Convert.ToUInt32(LCID); Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Wednesday, 15 June 2011 11:13 AM To: ozMOSS (ozmoss@ozmoss.commailto:ozmoss@ozmoss.com) Subject: SPWebCollection Add Method Hi all, I'm trying to provision a subsite using this method and am stuck on the nLCID parameter. The API states a 32-bit GUID is required but I can't find one! :) I want to inherit from the parent Site which uses English-AU but am not sure if I'm getting it properly. Will the following work? if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { //Inherit LCID from parent uint webLCID = SPSite.Language; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add(AboutUs, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } Kind regards, Paul Noone --- Online Developer/SharePoint Administrator Infrastructure Team, ICT Catholic Education Office, Sydney p: (02) 9568 8461 f: (02) 9568 8483 e: paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au w: http://www.ceosyd.catholic.edu.au/ ___ ozmoss mailing list ozmoss@ozmoss.commailto:ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss ___ ozmoss mailing list ozmoss@ozmoss.commailto:ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss ___ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
RE: SPWebCollection Add Method
I think I should be using the ServerRelativeUrl property of SPWeb but am not sure how. I've tried to append the parent site path to the new web's name and now get this bizarre error: /AboutUs contains leading or trailing slash, which is invalid Maybe I should just give up and do this via the template XML but this seemed so much more elegant. Code variation below: private void CreateSubsites(PublishingWeb currentPublishingSite) { if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { // Inherit LCID from parent uint webLCID = Convert.ToUInt32(siteCollection.RootWeb.Locale.LCID); // Get parent web relative URL string parentWeb = siteCollection.ServerRelativeUtl; string webUrl = parentWeb + AboutUs; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add(webUrl, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } } From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Wednesday, 15 June 2011 12:43 PM To: ozMOSS Subject: RE: SPWebCollection Add Method Thanks Joe. The following works nicely. :) //Inherit LCID from parent uint webLCID = Convert.ToUInt32(siteCollection.RootWeb.Locale.LCID); Now I have one more small problem. The Web site address /AboutUs is already in use. Which is true, if you're talking about the web application root site collection. However, I only want to get the parent site of the web I'm trying to create. Looks like I'm heading too high up the hierarchy. I'm currently creating the parent at a managed path teams/newsite. And want the subsite to be created at teams/newsite/AboutUs. Can I do this without having to use explicit paths? From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 12:26 PM To: ozMOSS Subject: Re: SPWebCollection Add Method Oh, of course. Sorry for missing that the LCID is explicitly unsigned in the Add method :-). You should be able to use Convert.ToUInt32 on the LCID property, instead of trying to convert to ToString() representation of the Locale. Cheers, Joe. On Wed, Jun 15, 2011 at 12:20 PM, Paul Noone paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au wrote: I tried using it directly first time round which is how I wound up stuck with messy conversions. :) Error 1The best overloaded method match for 'Microsoft.SharePoint.SPWebCollection.Add(string, string, string, uint, string, bool, bool)' has some invalid arguments Error 2Argument '4': cannot convert from 'int' to 'uint' Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 12:15 PM To: ozMOSS Subject: Re: SPWebCollection Add Method SPWeb.Locale returns a CultureInfohttp://msdn.microsoft.com/EN-US/library/kx54z3k7 object, so you should be able to pass the LCIDhttp://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcid property from this straight into the add method. eg: siteCollection.Add(foo, foo, bar, siteCollection.RootWeb.Locale.LCID); On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au wrote: OK. Almost there using siteCollection.RootWeb.Locale but now I'm having trouble with converting the value. The following will build without error but just looks plain wrong. Does anyone know what type of field I'm dealing with? //Inherit LCID from parent string LCID = siteCollection.RootWeb.Locale.ToString(); uint webLCID = Convert.ToUInt32(LCID); Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Wednesday, 15 June 2011 11:13 AM To: ozMOSS (ozmoss@ozmoss.commailto:ozmoss@ozmoss.com) Subject: SPWebCollection Add Method Hi all, I'm trying to provision a subsite using this method and am stuck on the nLCID parameter. The API states a 32-bit GUID is required but I can't find one! :) I want to inherit from the parent Site which uses English-AU but am not sure if I'm getting it properly. Will the following work? if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { //Inherit LCID from parent uint
Re: SPWebCollection Add Method
Hey Paul, It looks like you are generating the Server Relative URL for your new site relative to the site collection's root web, when your intent is to actually create the new site as a child of the 'current' site? If so, I think the problem is that: string parentWeb = siteCollection.ServerRelativeUtl; should be: string parentWeb = SPContext.Current.Web.ServerRelativeUrl; The site collection's relative URL will always be the relative URL of the top-level site, rather than the URL of the 'current' site. Joe. On Wed, Jun 15, 2011 at 2:14 PM, Paul Noone paul.no...@ceosyd.catholic.edu.au wrote: I think I should be using the ServerRelativeUrl property of SPWeb but am not sure how. I’ve tried to append the parent site path to the new web’s name and now get this bizarre error: /AboutUs contains leading or trailing slash, which is invalid Maybe I should just give up and do this via the template XML but this seemed so much more elegant. Code variation below: private void CreateSubsites(PublishingWeb currentPublishingSite) { if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { // Inherit LCID from parent uint webLCID = Convert.ToUInt32(siteCollection.RootWeb.Locale.LCID); // Get parent web relative URL string parentWeb = siteCollection.ServerRelativeUtl; string webUrl = parentWeb + AboutUs; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add( webUrl, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } } *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Paul Noone *Sent:* Wednesday, 15 June 2011 12:43 PM *To:* ozMOSS *Subject:* RE: SPWebCollection Add Method Thanks Joe. The following works nicely. J //Inherit LCID from parent uint webLCID = Convert.ToUInt32(siteCollection.RootWeb.Locale.LCID); Now I have one more small problem. The Web site address /AboutUs is already in use. Which is true, if you’re talking about the *web application root* site collection. However, I only want to get the *parent site of the web* I’m trying to create. Looks like I’m heading too high up the hierarchy. I’m currently creating the parent at a managed path “teams/newsite”. And want the subsite to be created at “teams/newsite/AboutUs”. Can I do this without having to use explicit paths? *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Joseph Clark *Sent:* Wednesday, 15 June 2011 12:26 PM *To:* ozMOSS *Subject:* Re: SPWebCollection Add Method Oh, of course. Sorry for missing that the LCID is explicitly unsigned in the Add method :-). You should be able to use Convert.ToUInt32 on the LCID property, instead of trying to convert to ToString() representation of the Locale. Cheers, Joe. On Wed, Jun 15, 2011 at 12:20 PM, Paul Noone paul.no...@ceosyd.catholic.edu.au wrote: I tried using it directly first time round which is how I wound up stuck with messy conversions. J *Error 1*The best overloaded method match for 'Microsoft.SharePoint.SPWebCollection.Add(string, string, string, uint, string, bool, bool)' has some invalid arguments *Error 2*Argument '4': cannot convert from 'int' to 'uint' Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team *CEO Sydney* *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Joseph Clark *Sent:* Wednesday, 15 June 2011 12:15 PM *To:* ozMOSS *Subject:* Re: SPWebCollection Add Method SPWeb.Locale returns a CultureInfohttp://msdn.microsoft.com/EN-US/library/kx54z3k7object, so you should be able to pass the LCIDhttp://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcidproperty from this straight into the add method. eg: siteCollection.Add(foo, foo, bar, siteCollection.RootWeb.Locale.LCID); On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone paul.no...@ceosyd.catholic.edu.au wrote: OK. Almost there using siteCollection.RootWeb.Locale but now I’m having trouble with converting the value. The following will build without error but just looks plain wrong. Does anyone know what type of field I’m dealing with? //Inherit LCID from parent string LCID = siteCollection.RootWeb.Locale.ToString(); uint webLCID = Convert.ToUInt32(LCID); Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team *CEO Sydney* *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On Behalf Of *Paul Noone *Sent:* Wednesday, 15 June 2011 11:13 AM
RE: SPWebCollection Add Method
Yah. That's exactly what I'm doing. I just don't know how to undo it. :) That also explains the trailing slash remark. sitecollection was already defined and I figured it would use the current site, not the web app root. Very strange as it works in other contexts in the same receiver. I tried your suggestion but came up with the same error. Giving up now. :( From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 2:21 PM To: ozMOSS Subject: Re: SPWebCollection Add Method Hey Paul, It looks like you are generating the Server Relative URL for your new site relative to the site collection's root web, when your intent is to actually create the new site as a child of the 'current' site? If so, I think the problem is that: string parentWeb = siteCollection.ServerRelativeUtl; should be: string parentWeb = SPContext.Current.Web.ServerRelativeUrl; The site collection's relative URL will always be the relative URL of the top-level site, rather than the URL of the 'current' site. Joe. On Wed, Jun 15, 2011 at 2:14 PM, Paul Noone paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au wrote: I think I should be using the ServerRelativeUrl property of SPWeb but am not sure how. I've tried to append the parent site path to the new web's name and now get this bizarre error: /AboutUs contains leading or trailing slash, which is invalid Maybe I should just give up and do this via the template XML but this seemed so much more elegant. Code variation below: private void CreateSubsites(PublishingWeb currentPublishingSite) { if (currentPublishingSite.IsRoot) { using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = siteCollection.OpenWeb()) { // Inherit LCID from parent uint webLCID = Convert.ToUInt32(siteCollection.RootWeb.Locale.LCID); // Get parent web relative URL string parentWeb = siteCollection.ServerRelativeUtl; string webUrl = parentWeb + AboutUs; // webUrl, Title, Description, LCID, Template, UniquePerms, bConvertIfThere using (SPWeb newSite = siteCollection.RootWeb.Webs.Add(webUrl, About Us, More information about this site., webLCID, _siteTemplateNamePrefix, false, false)) { // Perform additional customisations here } } } } } From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Wednesday, 15 June 2011 12:43 PM To: ozMOSS Subject: RE: SPWebCollection Add Method Thanks Joe. The following works nicely. :) //Inherit LCID from parent uint webLCID = Convert.ToUInt32(siteCollection.RootWeb.Locale.LCID); Now I have one more small problem. The Web site address /AboutUs is already in use. Which is true, if you're talking about the web application root site collection. However, I only want to get the parent site of the web I'm trying to create. Looks like I'm heading too high up the hierarchy. I'm currently creating the parent at a managed path teams/newsite. And want the subsite to be created at teams/newsite/AboutUs. Can I do this without having to use explicit paths? From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 12:26 PM To: ozMOSS Subject: Re: SPWebCollection Add Method Oh, of course. Sorry for missing that the LCID is explicitly unsigned in the Add method :-). You should be able to use Convert.ToUInt32 on the LCID property, instead of trying to convert to ToString() representation of the Locale. Cheers, Joe. On Wed, Jun 15, 2011 at 12:20 PM, Paul Noone paul.no...@ceosyd.catholic.edu.aumailto:paul.no...@ceosyd.catholic.edu.au wrote: I tried using it directly first time round which is how I wound up stuck with messy conversions. :) Error 1The best overloaded method match for 'Microsoft.SharePoint.SPWebCollection.Add(string, string, string, uint, string, bool, bool)' has some invalid arguments Error 2Argument '4': cannot convert from 'int' to 'uint' Regards, Paul -- Online Developer/SharePoint Administrator, ICT Infrastructure Team CEO Sydney From: ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.commailto:ozmoss-boun...@ozmoss.com] On Behalf Of Joseph Clark Sent: Wednesday, 15 June 2011 12:15 PM To: ozMOSS Subject: Re: SPWebCollection Add Method SPWeb.Locale returns a CultureInfohttp://msdn.microsoft.com/EN-US/library/kx54z3k7 object, so you should be able to pass the LCIDhttp://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcid property from this straight into the add method. eg: siteCollection.Add(foo, foo, bar, siteCollection.RootWeb.Locale.LCID); On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone