Friday, May 31, 2013

Watson bucket parameters

 

Anybody help to understand , what this means in ULS logs ?

------>

05/29/2013 08:22:02.49 w3wp.exe (0x1D38) 0x0DD4 SharePoint Server Unified Logging Service c91s Monitorable Watson bucket parameters: SharePoint Server 2010, ULSException14, 81eed5e0 "web content management", 0e00129b "14.0.4763.0", e9185677 "system.web", 0200c627 "2.0.50727.0", 4ef6c43b "sun dec 25 01:35:39 2011", 00002164 "00002164", 00000083 "00000083", 454b2bb9 "httpexception", 386e3162 "8n1b" 47e538f0-8fa3-4d3b-8010-1988b2590981

Sunday, April 21, 2013

Sunday, April 14, 2013

Create Variation Hierarchies with Machine Translation Enabled

Prerequisites

Before we start creating variations in SP 2013 and test machine translations, below mentioned two Managed services must be present:
•          Machine Translation Service
•          User Profile Service Application
You can use configuration wizard on home page of central admin (http://centralAdmin/configurationwizards.aspx) to create all services.
• Application pool account used for machine translation service must have full control on User profile services. This application pool account must have permissions on http://servername/TargetSiteCollectionPath/Translation%20Status/
• Download latest certificates from https://corp.sts.microsoft.com/Onboard/CertRenewal.html and install on SharePoint farm.
• Visit https://www.microsoft.com ( run as administrator) > Page properties > Certificates > Install certificates on the SharePoint Farm








Create Variations in SharePoint 2013


Create   publishing portal from central admin (http://centraladmin/_admin/createsite.aspx)






Create Hierarchies

  1. Visit In site settings of root for site collection and go to Variation Labels (http://servername/sites/var/_layouts/15/VariationLabels.aspx) :

  2. Create  root variation label :







3. Create a target / child variation label :







Please make sure you have allowed machine translations for this target:









4. Now click on link to create Variation hierarchy   :







5. Either wait for Variations Create Hierarchies Job Definition and Variations Propagate Sites and Lists Timer Job to run as scheduled or run them manually. You can verify   what actions these jobs are taking @ http://servername/sites/var/VariationLogs/AllItems.aspx

6. After variations are created http://servername/sites/var/_layouts/15/VariationLabels.aspx looks like :






Machine translation



Create page on root variation






Publish and approve this page.

Manually run Variations Propagate Page Job Definition or let this job run as scheduled.

Visit Variation Logs (http://servername/sites/var/VariationLogs/AllItems.aspx) to verify page is being propagated to target variation.


Submit page for Translation on Target Variation


Visit the test page and click on machine translation tab :





Output:







Publish and Approve the page after required edits.

You may also like:

SharePoint 2013 features overview

Thursday, March 14, 2013

Refiners in SharePoint 2013 Search

We will try to understand how refiners work in SharePoint 2013 here.

Refiner webpart passes a Jason object in url .



1. Go to view all site content ( http://servername/sites/var/_layouts/15/viewlsts.aspx)

2. Create a Custom List similar to mentioned below :




Column TermSetColumnPOC ( Allow multiple values) is linked to a termset withTerms :

Term1 , Term2 , Term3 , Term4 , Term5 ,Term6 , Term7 , Term8 ,Term9

I want my search result page to display results  when "Term8"  is present in column TermSetColumnPOC or NormalColumnPOC  . I will also provide a filter , which will hide the results which don't have "Term8"  present in column TermSetColumnPOC .

2. Populate data in custom List :



Searching "Term1" should give items hk1 , hk4 , hk7, hk9

Searching "Term8" should give hk1, hk6,hk8

Now applying Refiner on "TermSetColumnPOC" equal to value  "Term8"  should give only hk1,hk8

3. Create a Content Source under Search administration in central admin which contain only your test web application to be crawled . This is not a mandate , but will expedite this process of testing refiners , as you will drastically reduce crawling time.

Run a full crawl on this search content source.



4.   Search Service application > Search Schema

Create a managed property "TermSetColumnPOCManaged" as mentioned below











5. Run full crawl  again.



6. After this crawl is over , you can test refiners in your search center . I don't want one so , I will create my own simple page.

7.  Enable site collection feature "Search Server Web Parts and Templates"





8.  Create a simple web part page and insert below mentioned webpart on page

Search Box , Search results , Refinement



9. Under Webpart properties of refinement  webpart choose TermSetColumnPOCManaged as one of the available refiners.



10 . Publish and approve this page .

11.  Type "Term1"  in search box or Type url   http://......./search1.aspx#k=Term1



11.1 Type "Term8"  in search box or Type url   http://......./search1.aspx#k=Term8



11.2 Type "Term8"  in search box and Click on "Term8"   in Refiners

( use url decode to understand what is being passed in url )

or

http://......./search1.aspx#Default={"k":"Term8","r":[{"n":"TermSetColumnPOCManaged","t":["\"ǂǂ5465726d38\""],"o":"and","k":false,"m":null}]}

( here equivalent json object is passed as parameter )

or

http://......./search1.aspx#Default={"k":"Term8","r":[{"n":"TermSetColumnPOCManaged","t":["\"Term8\""],"o":"and","k":false,"m":null}]}

( here equivalent json object is passed as parameter  but with Term display value )



11.3 search "TermSetColumnPOCManaged:Term8"  or 

type url  http://......./search1.aspx#k=TermSetColumnPOCManaged:Term8





Another example of JASON with Refiners and Search core result webpart :

On the same page Search "Term1" , and in Refiners , select "Term1"



or type url :

http://......./search1.aspx#Default={"k":"Term1","r":[{"n":"TermSetColumnPOCManaged","t":["\"Term1\""],"o":"and","k":false,"m":null}]}

The result in both ways :





One more example of jason with Search result page :

On the same page Search "Term1" , and in Refiners , select "Term9"

or type url :

http://......./search1.aspx#Default={"k":"Term1","r":[{"n":"TermSetColumnPOCManaged","t":["\"Term9\""],"o":"and","k":false,"m":null}]}

Result both ways comes to be :





You may also like:

SharePoint 2013 features overview

Friday, February 8, 2013

Asynchronous call to WebService / WCF using JQuery

In one of the implementations, we had to do asynchronous calls to multiple SharePoint Lists for better UI and user experience.

For better performance and managed solution, we exposed a custom web service which takes care of all the data manipulations and returns desired result set / exposes methods to do required operations.

Here is a Proof of concept code snippet which might be helpful to you to call web services using JQuery.Ajax  :

$.ajax({
// type: Type, //GET or POST or PUT or DELETE verb
url: Uri, // Location of the service
// data: Data, //Data sent to server
dataType: DataType, //Expected data format from server
cache: false, // no-cache
success: function (msg) {//On Successfull service call
ServiceSucceeded(msg);
},
error: ServiceFailed// When Service call fails
});

Full Sample Code :
asynchronous-call-to-web-service_1

Saturday, January 12, 2013

finding features in a content database in SharePoint 2010 using PowerShell or tools

Sometimes we have a feature id and we want to know the places where it is active, even as a dummy one. Below mentioned script might be helpful.

http://get-spscripts.com/2011/06/removing-features-from-content-database.html

or

http://featureadmin.codeplex.com/downloads/get/290833

or

http://archive.msdn.microsoft.com/WssAnalyzeFeatures

 

Tuesday, January 8, 2013

SharePoint 2010 Enterprise Search | SharePoint Crawl ExceptionalBehaviour

Security Issues to be taken care while configuring SharePoint Search for Public facing Portals - SharePoint
When search crawler [SPSCrawl.asmx and sitedata.asmx ] comes to a SharePoint site , how it gets to know whether it's a SharePoint site or a normal site ?

There is a custom header defined by Microsoft on SharePoint web applications : Name : MicrosoftSharePointTeamServices ; Value like : 14.0.0.4762

It tells crawler to dig to the item levels in SharePoint Lists , treat target as SharePoint Site.....



What if this custom header is removed on target ? :--> Search crawler will crawl up to list level only . If we use fiddler, while crawling site collection you could observe , there is no call made to SPSCrawl.asmx and sitedata.asmx by the crawler. This web application will no more be treated as SharePoint Website by Search crawl.
Now to make your site secure , you want that hackers may not get these custom headers , but search crawlers need it .
There is a way out , let your search crawl be targeted to a different web application than the public facing one !!!! And on public facing website use <clear /> under http response headers to hide from external world internal server information.

You may also like:

my website does not work well with newly released version


Question : what is arpirowupdater.hxx ?

Tuesday, November 20, 2012

display hide content on page using JQuery

On page load , 1st div which is "div1"  is enabled , rest are hidden . On further link clicks , respective divs , as defined by class of list element  , are enabled , rest divs are disabled

jQuery(function () {

$('#nav a').click(function () {

var myClassLinked = $(this).parent().attr('class');

$('#container > :not(#' + myClassLinked + ')').hide();

$('#' + myClassLinked ).fadeIn(); }); });

$(document).ready(function () {

$('#container > :not(#' + 'div1' + ')').hide();

$('#' + 'div1').fadeIn();

});

Full example code

Sunday, October 14, 2012

feature activation code using powershell does not pick appsettings values

This is a  very common scenario where , our deployment guides tend to be useless with automation just because features are activated well using UI in settings of site/site collection  , but fail using powershell.

Here is the solution to this :


using (SPWeb web = properties.Feature.Parent as SPWeb)
{
SPWebApplication webApp = web.Site.WebApplication;
Configuration config = WebConfigurationManager.OpenWebConfiguration("/", webApp.Name);
// App settings are retrieved this way
config.AppSettings.Settings["someAppSettingKey"].Value;


// Connection string settings are retrieved this way
config.ConnectionStrings.ConnectionStrings["someDBConnectionString"].ConnectionString
web.Site.Dispose();
}


 

Reference :

Read web.config on FeatureActivated event while activating Feature using PowerShell

 

Wednesday, October 10, 2012

Get Dependent files from HTML response

Hi

I am getting response of a page like :

System.Net.HttpWebRequest  request  ...

request.Credentials...

request.Method = ...

request.UserAgent =..

(System.Net.HttpWebResponse)request.GetResponse();

receiveStream = response.GetResponseStream();

readStream = new StreamReader(receiveStream, Encoding.UTF8);

string pageContent = readStream.ReadToEnd();

Now out of this string pageContent    , I want to extract all sub request and make them a hit.   Is there something better than html agility pack for this ?

Reply 1 By http://social.msdn.microsoft.com/profile/joel%20engineer/?ws=usercard-mini

I usually read it into an htmlDocument Class and the use either GetElementByID or GetElementsByTagname()

 

 

 

string pageContent;

webBrowser1.Document.Write(pageContent);

 




jdweng

 

Reply 2 


You should try http://htmlagilitypack.codeplex.com/

I am searching something better dear.

Tuesday, September 25, 2012

Dummy Workflow References

Hi

 


    •  For my Document Library WorkflowAssociations.Count  is zero.

    • For this document Library EnableModeration  is false.

    •  Still I can see column in the document Library named "Approval Status".  (internal name   "_ModerationStatus")



When I try to set  EnableModeration  true for this document library , I get exception.

Seems to be some time in the past workflow was enabled on this list / enablemoderation was true . But setting these to negative did not remove Approval Status column.

How I can fix this document library without deletion , so that  future workflows enabled or enablemoderation=true should not give exception ?

Monday, August 6, 2012

User Policy to restrict Form Authentication Users from visitingapplication pages like viewlsts.aspx

• On web application management ( e.g. http://ServerName:CentralAdminPort/_admin/WebApplicationList.aspx) page under central admin , go to Permission Policy :


• Mark the check box which says deny users to view application pages and save.

• Output is :

• Now go to user policies tab for main web application and click on add user :


• Select the zone on which public main application is deployed :

• Under people picker type "ASP.NET Membership provider name" , Permissions : Deny System Pages and click finish :

• Output is like :

Now access few application pages and lists directly to verify with a form authentication user .


Alternative approach and suggestions are welcome under comments section.

Friday, August 3, 2012

0x80070057 sharepoint variations

On page http://ServerName/_Layouts/VariationLogs.aspx , when I ran Timer Job "Variations Create Hierarchies Job Definition" , I was getting the error ( Under Failures column) :

The Variations Create Hierarchies job failed with the following error message: <nativehr>0x80070057</nativehr><nativestack></nativestack>.

I was getting below mentioned errors in ULS logs :

Process : OWSTimer.exe
Area : Web Content Management
Category : Site Management
Level : Unexpected




CreateVariationHierarchiesJob catches Exception. System.ArgumentException: <nativehr>0x80070057</nativehr><nativestack></nativestack> at
Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl) at Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb web) at
Microsoft.SharePoint.Publishing.PublishingPage.get_Layout() at Microsoft.SharePoint.Publishing.PublishingPage.set_Layout(PageLayout value) at
Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.CreateVariantPage(PublishingPage sourcePage, PublishingWeb targetArea, String destPageWebRelativeUrl, String pageLayoutName, String title, String
description, Boolean copyResources, Boolean enforceMajorVersion, SPWeb& webToClose, PageLayout[] targetAreaAvailablePageLayouts) at Microsoft.SharePoint.Publishing.PublishingPage.CreateVariationInner
(VariationLabel varlabel, String pageLayoutName, String destPageName, String title, String description, Boolean copyResources, Boolean overrideStopUpdate, Boolean isCreateHierarchies, Boolean
enforceMajorVersion, Boolean skipIdentityTargetConflictChecks, Boolean stopAutoSpawnAfterDelete, Boolean sendNotificationEmail, LongRunningOperationJob lroLogger, PublishingWeb targetArea, PageLayout[]
targetAreaAvailablePageLayouts, Hashtable variationPageLayoutTable) at Microsoft.SharePoint.Publishing.PublishingPage.CreateVariationAuto(CachedVariationSettings variationSettings, VariationLabel
varlabel, Boolean isCreateHierarchies, Boolean enforceMajorVersion, Boolean skipIdentityTargetConflictChecks, LongRunningOperationJob lroLogger, PublishingWeb targetArea, PageLayout[]
targetAreaAvailablePageLayouts, Hashtable variationPageLayoutTable) at Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass3e.<CreateVariationsDeepForCurrentPages>b__38(SPListItem item) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessItem(SPListItem item, Boolean fIncludeFolderItems, MonitoredScopeWrapper monitoredScopeWrapper, ItemProcessor itemProcessor, ItemProcessorErrorCallout
errorCallout) at Microsoft.Office.Server.Utilities.ContentIterator.ProcessItems(SPListItemCollection items, Boolean fIncludeFolderItems, Boolean fIterateInReverseOrder, MonitoredScopeWrapper
monitoredScopeWrapper, ItemProcessor itemProcessor, ItemProcessorErrorCallout errorCallout) at Microsoft.Office.Server.Utilities.ContentIterator.ProcessItems(SPListItemCollection items, Boolean
fIncludeFolderItems, Boolean fIterateInReverseOrder, ItemProcessor itemProcessor, ItemProcessorErrorCallout errorCallout) at
Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass3e.<CreateVariationsDeepForCurrentPages>b__37(SPListItemCollection items) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessListItems(SPList list, SPQuery query, ItemsProcessor itemsProcessor, ItemsProcessorErrorCallout errorCallout) at
Microsoft.Office.Server.Utilities.ContentIterator.ProcessListItems(SPList list, String strQuery, UInt32 rowLimit, Boolean fRecursive, SPFolder folder, ItemsProcessor itemsProcessor,
ItemsProcessorErrorCallout errorCallout) at Microsoft.Office.Server.Utilities.ContentIterator.ProcessListItems(SPList list, String strQuery, UInt32 rowLimit, Boolean fRecursive, ItemsProcessor
itemsProcessor, ItemsProcessorErrorCallout errorCallout) at Microsoft.SharePoint.Publishing.PublishingWeb.CreateVariationsDeepForCurrentPages(CachedVariationSettings variationSettings, VariationLabel
varlabel, Boolean isCreateHierarchies, LongRunningOperationJob lroLogger, List`1 errors, Hashtable variationPageLayoutTable) at
Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass34.<CreateVariationsDeepForChildPages>b__30(SPWeb web) at Microsoft.Office.Server.Utilities.CultureUtility.RunWithCultureScope
(CodeToRunWithCultureScope code) at Microsoft.Office.Server.Utilities.ContentIterator.ProcessSite(SPSite site, Boolean fSetThreadCulture, WebProcessor webProcessor, WebProcessorErrorCallout errorCallout)
at Microsoft.Office.Server.Utilities.ContentIterator.ProcessSite(SPSite site, WebProcessor webProcessor, WebProcessorErrorCallout errorCallout) at
Microsoft.SharePoint.Publishing.PublishingWeb.<>c__DisplayClass34.<CreateVariationsDeepForChildPages>b__2f(SPSite rootSite) at Microsoft.Office.Server.Utilities.TimerJobUtility.ProcessSite(SPSite site,
SiteProcessor siteProcessor) at Microsoft.SharePoint.Publishing.PublishingWeb.CreateVariationsDeepForChildPages(CachedVariationSettings variationSettings, VariationLabel varlabel, Boolean
isCreateHierarchies, LongRunningOperationJob lroLogger, List`1 errors, Hashtable variationPageLayoutTable) at Microsoft.SharePoint.Publishing.PublishingWeb.CreateVariationsDeepForChildren
(CachedVariationSettings variationSettings, PublishingWeb sourceParentPubWeb, VariationLabel varlabel, Boolean isCreateHierarchies, LongRunningOperationJob lroLogger, List`1 errors) at
Microsoft.SharePoint.Publishing.PublishingWeb.CreateVariationsDeep(CachedVariationSettings variationSettings, ReadOnlyCollection`1 varLabels, Boolean isCreateHierarchies, Boolean recurse,
LongRunningOperationJob lroLogger, List`1 errors) at Microsoft.SharePoint.Publishing.Internal.CreateVariationHierarchiesJobDefinition.PerformVariationsSpawn(SPWorkItem workItem, SPWeb currentWeb,
CachedVariationSettings variationSettings)





Process : OWSTimer.exe
Area : Web Content Management
Category : Site Management
Level : Unexpected



PublishingWeb::CreateVariationsDeepForCurrentPages caught Exception at item 'Pages/Folder1/Folder2/PageName.aspx' with : <nativehr>0x80070057</nativehr><nativestack></nativestack>







Process : OWSTimer.exe
Area : Web Content Management
Category : Publishing
Level : Monitorable




GetFileFromUrl: ArgumentException when attempting get file Url http://OldServerName/_catalogs/masterpage/PageLayoutFileName.aspx <nativehr>0x80070057</nativehr><nativestack></nativestack> at
Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl) at Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb web)





Process : OWSTimer.exe
Area : SharePoint Foundation
Category : General
Level : High



<nativehr>0x80070057</nativehr><nativestack></nativestack>





Process : OWSTimer.exe
Area : Web Content Management
Category : Site Management
Level : Unexpected




PublishingWeb::CreateVariationsDeepForChildPages() caught Exception at web 'http://NewServerName/es-LA/Subsite1' with : <nativehr>0x80070057</nativehr><nativestack></nativestack>





Process : OWSTimer.exe
Area : Web Content Management
Category : Site Management
Level : Unexpected




DeploymentWrapper::CreateVariantPage() on sourcePage = 'Pages/Folder1/Folder2/PageName.aspx', targetWeb = 'http://NewServerName/es-LA/Subsite1' catches an unexpected exception: System.ArgumentException:
<nativehr>0x80070057</nativehr><nativestack></nativestack> at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId,
Int32& plType, Object& pvarFileOrFolder) at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object&
pvarFileOrFolder) at Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl) at Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb web) at
Microsoft.SharePoint.Publishing.PublishingPage.get_Layout() at Microsoft.SharePoint.Publishing.PublishingPage.set_Layout(PageLayout value) at
Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.CreateVariantPage(PublishingPage sourcePage, PublishingWeb targetArea, String destPageWebRelativeUrl, String pageLayoutName, String title, String
description, Boolean copyResources, Boolean enforceMajorVersion, SPWeb& webToClose, PageLayout[] targetAreaAvailablePageLayouts).





Possible Reason :

1. You have recently moved your content db from an old server , the display names for page layouts seems to be updated ( even on mouse hover) but internally older server name is being referred.
2. Even after updating page layout via object model , publishing cache is not flushed.
Possible Resolution:

1.

For all the Publishing pages under source variation , update property "PublishingPageLayout" to http://NewServerName/_catalogs/masterpage/PageLayoutFileName.aspx [ old value
http://OldServerName/_catalogs/masterpage/PageLayoutFileName.aspx ]
page.ListItem.Properties["PublishingPageLayout"] = newPageLayout;

2. Flush object cache at http://ServerName/_Layouts/objectcachesettings.aspx
3. IISRESET
4. Restart owstimer.exe
5. Under http://ServerName/_Layouts/VariationLabels.aspx again schedule create Hierarchies.
6. Have a cup of tea.
7. Start the Timerjob 'Variations Create Hierarchies Job Definition’ manually or wait for the schedule.
8. Keep an eye on http://ServerName/_Layouts/VariationLogs.aspx

Thursday, August 2, 2012

Access "Pages" Library for Chinese Locale

Hi

My site collection has 5 language variations.

 

Except Chinese version I am able to access Pages Library Like :

web.Lists["Pages"] or web.Lists.TryGetList("Pages")  .

 

But for Chinese sub site :

  1. If I Iterate   web.Lists   collection  using foreach loop , there is a list present whose SPList.Title is "Pages" . For this list Under SPList.SchemaXml , Title is Title="頁面"

  2. web.Lists["Pages"] gives error: List 'Pages' does not exist at site with URL 'XXXXXXXXXXXXXXXXXXXXXXXXX' AND  web.Lists.TryGetList("Pages")   gives null .

  3. But web.Lists["頁面"]  returns the right SPList object


Is it like , SharePoint API's to retrieve a list by name refer to  SchemaXml   rather than SPList.Title , while retrieving a list internally ?

 

 

 

Reply 1 by http://social.technet.microsoft.com/profile/ivan%20vagunin/?ws=usercard-mini

Hi!

I would propose to use SPWeb.GetList function - it returns list by url (eg web.GetList("/myweb/Pages") and url usually the same for all locales.

http://msdn.microsoft.com/ru-ru/library/microsoft.sharepoint.spweb.getlist(v=office.12).aspx

reply 2 By http://social.technet.microsoft.com/profile/aseem%20sood/?ws=usercard-mini

All the options that I can come up with are:

 

  1. Web.GetList(<Url from SharePoint Resource File>) Preferred over the others for Intranet

  2. PublishingWeb.PagesList (Coz it was specifically mentioned for Pages Library)

  3. SPWeb.GetListsOfType ( with 850 for Pages Library. If it does not work then 101-Document Library and Loop through)

  4. Guid LibraryPagesId = PublishingWeb.GetPagesListId(web); SPList psgeslib = web.Lists[LibraryPagesId];


Also, just wanted to add Web.GetList(URL) is normally a better performing approach than Web.Lists[ID/TITLE].

Thanks,

Aseem Sood

Monday, July 9, 2012

SharePoint 2010 | Content Deployment using Path and Jobs from Central Admin | Errors

Hi

We have a staging source and target production.  For 1st migration on blank site collection :

1. Even if we migrate content to a blank site collections we get many warnings like :

a.

[WebFeature] [Publishing]   Warning: Provisioning did not succeed. Details: Failed to create the 'Images' library. OriginalException: The feature failed to activate because a list at 'PublishingImages' already exists in this site.  Delete or rename the list and try activating the feature again.

b.

Warning: Provisioning did not succeed. Details: Failed to create the 'Images' library. OriginalException: The feature failed to activate because a list at 'PublishingImages' already exists in this site.  Delete or rename the list and try activating the feature again.

c.

Warning: User or group 19 cannot be resolved.

 

 Can we use a backup of staging as target instead of blank . What else than initial migration failure should I aspect as drawback in this ?

 

2.

Content deployment deploys the most recent major and minor versions of a content item. For example, if version 2.7 of a Web page is being deployed, the most recent major version (2.0) of the page, and the most recent minor version (2.7), will be deployed to the destination site.

Is it possible to limit the migration to last major version only ?

  1. We have started with blank site collection using powershell. Still getting the error in point one.

  2. I refer to http://centralAdmin/_admin/Deployment.aspx in this problem statements above.


Reply 1 By http://social.technet.microsoft.com/profile/jason%20warren/?ws=usercard-mini

Microsoft's Stefan Goßner has a great post about content deployment that I recommend you review.

 

In the section about the requirements for a successfuly content deployment, he recommends using an empty site collection for the destination and not a site collection with the Blank Site template (STS#1):
3) Use an empty site collection as the destination of your content deployment job

As already discussed in Part 5 content deployment will fail if the destination database contains conflicting content. To avoid this it is required that the initial deployment is done into an empty site collection.

Be aware that the only way to create an empty site collection is to use the following STSADM command:

STSADM.EXE -o createsite -url <url-to-site-collection> -ownerlogin domain\user -owneremail <email-address>

Using the "Blank Site" template will NOT create an empty site collection! It will actually create a site collection with content. You can see the difference if you create a site collection using both methods and then inspect the content of the created sites using SharePoint designer.

I personally recommed to always use the STSADM command with the syntax above to ensure that you really have an empty site collection as destination.

Impact: If the site collection has been created using a different method or already contains data the content deployment job will fail.

How to resolve: Deploy into an empty site collection

For your second question, content deployment will deploy the latest published version. If you don't want a minor version to be deployed (it's a draft, perhaps), simply do not publish it.




 

JASON WARREN

Infrastructure Specialist



 


 Reply 2 By http://social.technet.microsoft.com/profile/neal%20mcfee%20%5Bmct%5D/?ws=usercard-mini

To create a site collection that does not have a template (an empty site template) you omit the -template parameter in the New-SPSite cmdlet.

If you create a blank site using the STS#0, this will not work for the task you are trying to complete.

 

 

Try deleting the target site collection and recreating it using New-SPSite but do not specify the template.

Then re-run your publishing job.




If this helps you then please mark the post as helpful.
If this answers your question then mark it as the answer.
If another contributor in the thread answers your question then please do the right thing.
And as always most answers for SharePoint are based on "It depends"

 

Sunday, July 1, 2012

VariationsFixupTool

variationsfixuptool is used to correct variations system data
on publishing sites or pages.If you want to analyze the actual site structure
and the data stored in the relationships list this tool may be good one.

Syntax

stsadm -o variationsfixuptool

   -url <source variation site URL>

   [-scan]

   [-recurse]

   [-label]

   [-fix]

   [-spawn]

   [-showrunningjobs]


Parameters


Parameter name Value Required? Description
url A valid URL, such as http://server_name Yes The URL of a site in source variation where variations system data is being analyzed or corrected.
scan <none> No Analyzes the variations hierarchy and report findings.
This parameter provides functionality that cannot be accessed using the Central Administration Web site.
For each Site/Page, it reports:
  • If the source site is marked as being in the source variation hierarchy (SPWeb.AllProperties["__InSourceHierarchy"] == True ?). If the site is marked as being in the source hierarchy means that the page is part of the source hierarchy.
  • The Variation Group Id of the source site or page (SPWeb.AllProperties["Variation Group Id"] or PublishingPage.ListItem[FieldId.VariationGroupId])
  • Which peers are registered in the relationships list with same Variation Group Id
  • If a variation peer exists in the configured labels (default is all spawned labels) by first checking if a peer is configured in the relationships list with the same variation group ID for the given label. If no peer can be found using the relationships list we try to lookup the peer using the default URL that would be used when creating a variant in the given label
  • The variation group id of the variation peers in the target labels (SPWeb.AllProperties["Variation Group Id"] or PublishingPage.ListItem[FieldId.VariationGroupId])
  • If the source site/page is configured in the relationships list
  • In addition the command reports the variation labels used for the peer check (default is all spawned labels).
  • The tool will not identify any issues - it is required to analyze the report in detail and interpret it in order to find problems.
recurse <none> No Scan or fix all subsites of the site specified by the url parameter.
label A valid label name, such as "English" No Name of the label of the variation target.
fix <none> No Corrects invalid variations system data that are found. If the recurse parameter is used, fixes are done recursively for all subsites.
This parameter provides functionality that cannot be accessed using the Central Administration Web site.Fix mode will not create missing variation peers.
The following issues are automatically fixed:
  • Missing Variation Group ID on source site or source page
  • Missing relationships list entry for source or target page or site
  • Missing Variation Group ID on target site or target page
  • Different Variation Group ID in source site/page and target site/page (source ID will win)
spawn <none> No Creates new site variations on the source variation site specified by the url parameter for all target variations labels. If the recurse parameter is used, variations for subsites and pages are also created.
This parameter equivalent to the New Variation Site user interface setting that is located on the Site Content and Structure page.
This operation mode cannot be used to spawn pages in already spawned sites.
The command initiates the site spawn operation by creating a scheduled work item for the SpawnSiteJobDefinition timerjob. The spawn will be performed as soon as the timerjob runs.
The difference between the scheduled work item created by the CPVAreaEventReceiver and the Variationsfixuptool is that the tool has the option to create a workitem, which only spawns the site to one specific variation rather than to all spawned variation labels.
A common use scenario is to configure the source variation label with the Hierarchy Creation option to create only the root site and not the complete hierarchy and later to spawn the hierarchy or parts of the hierarchy from the source label using the STSADM command.
In MOSS 2007, this command was a major benefit compared to the automatic hierarchy creation in the UI, as it was the only way to force the creation in OWSTIMER rather than W3WP.
With SharePoint 2010 where all actions are already in OWSTIMER the benefit of using the STSADM command rather than the UI is rather limited.
showrunningjobs <none> No Displays current status of Variations Propagate Page Job Definition and Variations Propagate Site Job Definition timer jobs that are located on the Timer Job Status page of the SharePoint Central Administration Web site. But this does not provide information about Variations Create Hierarchies Job Definition , Variations Create Page Job Definition and Variations Create Site Job Definition.You only get to know about Variations Propagate Page Job Definition and Variations Propagate Site Job Definition.
Example :
stsadm -o variationsfixuptool -scan -url http://server/sites/pub/vhome/source -recurse > C:\report1.html

Source of information :

SharePoint Variations – The complete Guide – Part 11 – Variations Fixup Tool (blogs.technet.com/b/stefan_gossner/archive/2011/11/28/sharepoint-variations-the-complete-guide-part-11-variations-fixup-tool.aspx)

Use the variationsfixuptool operation (SharePoint Server 2010) [technet.microsoft.com/en-us/library/dd789633(v=office.14).aspx]

You may also like:

Cannot create Variation site because the parent Publishing web cannot…


0x80070057 sharepoint variations


Access “Pages” Library for Chinese Locale