Archive

Posts Tagged ‘WSP’

GetUserListSchema(): Failed to get the list schema XML for feature

November 20, 2012 2 comments

Olá! Smile

Cenário:

Montando pacotes de deploy para o SharePoint 2010, podemos automatizar toda a criação de fields, listas, contenttypes, etc.

Mas, dependendo da necessidade, é preciso “configurar” os pacotes com ordem de instalação de features e outras variáveis.

Quando criamos ListDefinitions e queremos criar instâncias dessas definições, usando o ListInstance no pacote, precisamos de uma pequena configuração adicional caso a ListInstance esteja em uma feature diferente da feature que está o ListDenifition.

Se não realizar essa configurações opcional (que está logo mais abaixo, na seção “Solução”), o erro abaixo é apresentado.

ERRO:

“<nativehr>0x81072101</nativehr><nativestack></nativestack>Não é possível concluir esta ação. Tente novamente.”

E nos LOGS do SharePoint (ULS), encontramos erros com um pouco mais de detalhes:

“GetUserListSchema(): Failed to get the list schema XML for feature…” e

“Failed to find the list schema for FeatureId …, list template ID …. Cannot create list in web … at URL ….”

SOLUÇÃO:

De acordo com os erros, a ListInstance não está conseguindo criar a lista baseado no template especificado (determinado no ListDefinition) por que não o encontra o schema do template.

Se o ListDefinition e o ListInstance estiverem na mesma feature, o SharePoint consegue entender e encontrar o schema. Mas, se estão em features separadas, precisamos informar qual é a feature que possui o ListDefinition, do ListInstance que estamos criando.

No Elements.xml do ListInstance, referencie a feature que tem o ListDefinition:

 

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

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;

<ListInstance Title="Minha Nova Instância"

OnQuickLaunch="TRUE"

TemplateType="10001"

FeatureId="c51f96ee-a686-4dab-8e48-f09d351b3a4f"

Url="Lists/MinhaInstancia"

Description="My List Instance">

</ListInstance>

</Elements>

 

Abraço!

Advertisements

Gerenciando WSPs com PowerShell no SharePoint 2010

January 13, 2011 1 comment

Olá! Smile

Overview:

Como muitos sabem, a ferramenta STSADM (muito utilizada no MOSS 2007 para gerenciar WSPs e todas outras muitas funcionalidades do SharePoint) no SharePoint 2010 é mantida apenas para fins de compatibilidade, tornando-se obsoleta.

Informações sobre o que eu disse acima e muitas outras coisas que mudaram, em: http://technet.microsoft.com/en-us/library/ff607713.aspx – Changes from Windows SharePoint Services 3.0 to SharePoint Foundation 2010.

Trecho do artigo do TechNet sobre o STSADM:

Deprecated features

The following feature is shipped with SharePoint Foundation 2010 but will be removed from subsequent versions.

Stsadm command-line tool

Description: The Stsadm command-line tool has been deprecated.

Reason for change: The Stsadm command-line tool will be superseded by Windows PowerShell 2.0.

Migration path: The Stsadm command-line tool is included to support compatibility with previous product versions. You should use Windows PowerShell 2.0 when performing command-line administrative tasks.

Então, vamos nos atualizar para os comandos mais utilizados. Neste post, vou falar sobre as tarefas de manutenção de Solutions (WSP’s).

SOLUÇÃO:

Este post certamente encadeará outros sobre o mesmo assunto e, na medida do possível, irei “linkar” eles.

Vamos ao que interessa:

Tip: Usem o SharePoint 2010 Management Shell, fica mais fácil do que ficar adicionando Snap-in toda hora.

image

image

STSADM

PowerShell

Adicionando uma solution

Adicionando uma solution

stsadm –o addsolution –filename “C:\ SolutionPackage.wsp”

Add-SPSolution –LiteralPath “C:\SolutionPackage.wsp”

Implantando uma solution (deploy)

Implantando uma solution (deploy)

stsadm –o deploysolution –name SolutionPackage.wsp –url http://webapplication –allowgacdeployment –immediate

Install-SPSolution –Identity SolutionPackage.wsp –WebApplication http://webapplication –GACDeployment

Atualizando uma solution existente (upgrade)

Atualizando uma solution existente (upgrade)

stsadm –o upgradesolution –name SolutionPackage.wsp –filename “C:\SolutionPackage.wsp” –immediate

Update-SPSolution –Identity Solution.wsp –LiteralPath “C:\SolutionPackage.wsp” –GacDeployment

Retract da solution

Retract da solution

stsadm –o retractsolution –name SolutionPackage.wsp –url http://webapplication –immediate

Uninstall-SPSolution –Identity SolutionPackage.wsp –WebApplication http://webapplication

Apagando uma solution

Apagando uma solution

stsadm –o deletesolution –name SolutionPackage.wsp

Remove-SPSolution –Identity SolutionPackage.wsp

Uma lista completa com um de-para de comandos aqui: http://technet.microsoft.com/en-us/library/ff621084.aspx – Stsadm to Windows PowerShell mapping (SharePoint Server 2010).

Stsadm operation

Windows PowerShell cmdlet

Activatefeature

Enable-SPFeature

Activateformtemplate

Enable-SPInfoPathFormTemplate

Addalternatedomain

New-SPAlternateUrl

Addcontentdb

Mount-SPContentDatabase

New-SPContentDatabase

Adddataconnectionfile

Install-SPDataConnectionFile

Add-ecsfiletrustedlocation

New-SPExcelFileLocation

Add-ecssafedataprovider

New-SPExcelDataProvider

Add-ecstrusteddataconnectionlibrary

New-SPExcelDataConnectionLibrary

Add-ecsuserdefinedfunction

New-SPExcelUserDefinedFunction

Addexemptuseragent

Add-SPInfoPathUserAgent

Addpath

New-SPManagedPath

Addpermissionpolicy

None

Addsolution

Add-SPSolution

Addtemplate

Install-SPWebTemplate

Adduser

New-SPUser

Addwppack

Install-SPWebPartPack

Addzoneurl

New-SPAlternateUrl

Allowuserformwebserviceproxy

Set-SPInfoPathWebServiceProxy

Use the AllowForUserForms and Identity parameters.

Allowwebserviceproxy

Set-SPInfoPathWebServiceProxy

Use the AllowWebServiceProxy and Identity parameters.

Authentication

Set-SPWebApplication

Use the AuthenticationMethod or AuthenticationProvider parameters.

Backup

Backup-SPConfigurationDatabase

Backup-SPFarm

Backup-SPSite

Backuphistory

Get-SPBackupHistory

Binddrservice

None

Blockedfilelist

None

Canceldeployment

None

Changepermissionpolicy

None

Copyappbincontent

None

Createadminvs

New-SPCentralAdministration

Creategroup

None

Createsite

New-SPSite

Createsiteinnewdb

New-SPSite Use the ContentDatabase parameter.

New-SPContentDatabase

Createweb

New-SPWeb

Databaserepair

None

Deactivatefeature

Disable-SPFeature

Deactivateformtemplate

Disable-SPInfoPathFormTemplate

Deleteadminvs

None

Deletealternatedomain

Remove-SPAlternateUrl

Deleteconfigdb

Remove-SPConfigurationDatabase

Deletecontentdb

Dismount-SPContentDatabase

Deletegroup

None

Deletepath

Remove-SPManagedPath

Deletepermissionpolicy

None

Deletesite

Remove-SPSite

Deletesolution

Remove-SPSolution

Deletetemplate

Uninstall-SPWebTemplate

Deleteuser

Remove-SPUser

Deleteweb

Remove-SPWeb

Deletewppack

Uninstall-SPWebPartPack

Deletezoneurl

Remove-SPAlternateUrl

Deploysolution

Install-SPSolution

Deploywppack

Install-SPWebPartPack

Disablessc

None

Displaysolution

Get-SPSolution

Editcontentdeploymentpath

Set-SPContentDeploymentPath

Email

None

Enablessc

None

Enumalternatedomains

Get-SPAlternateURL

Enumcontentdbs

Get-SPContentDatabase

Enumdataconnectionfiledependants

Get-SPDataConnectionFileDependent

Enumdataconnectionfiles

Get-SPDataConnectionFile

Enumdeployments

None

Enumexemptuseragents

Get-SPInfoPathUserAgent

Enumformtemplates

Get-SPInfoPathFormTemplate

Enumgroups

None

Enumroles

None

Enumservices

Get-SPServiceInstance

Enumsites

Get-SPSiteAdministration (To run this cmdlet, you must be a member of the Farm Administrators group.)

Get-SPSite (To run this cmdlet, you must be a local administrator on the computer where SharePoint 2010 Products is installed.)

Enumsolutions

Get-SPSolution

Enumsubwebs

Get-SPWeb

Enumtemplates

Get-SPWebTemplate

Enumusers

Get-SPUser

Enumwppacks

Get-SPWebPartPack

Enumzoneurls

Get-SPAlternateURL

Execadmsvcjobs

Start-SPAdminJob

Export

Export-SPWeb

Extendvs

New-SPWebApplication

Extendvsinwebfarm

New-SPWebApplicationExtension

Forcedeletelist

None

Getadminport

Get-SPWebApplication

Use the following syntax:

· Get-SPWebApplication -IncludeCentralAdministration | ? {$_.IsAdministrationWebApplication -eq $true}

Getdataconnectionfileproperty property

Get-SPDataConnectionFile

Use the following syntax:

· Get-SPDataConnectionFile | where {$_.Name -eq “dataConFileName”} | format-list

Getformtemplateproperty property

Get-SPInfoPathFormTemplate

Use the following syntax:

· Get-SPInfoPathFormTemplate | where {$_.DisplayName -eq “formTemplateName”} | format-list

Getosearchsetting

None

Getproperty

Get-SPFarmConfig

Get-SPTimerJob

Disable-SPTimerJob

Enable-SPTimerJob

Set-SPTimerJob

Start-SPTimerJob

Getsitelock

Get-SPSiteAdministration

Getsiteuseraccountdirectorypath

None

Geturlzone

Get-SPAlternateURL

Import

Import-SPWeb

Installfeature

Install-SPFeature

Listlogginglevels

Get-SPLogLevel

Listqueryprocessoroptions

None

Listregisteredsecuritytrimmers

Get-SPEnterpriseSearchSecurityTrimmer

Localupgradestatus

None

Managepermissionpolicylevel

None

Mergecontentdbs

Move-SPSite

Migrateuser

Move-SPUser

Osearch

For the Osearch parameters farmcontactemail, farmperformancelevel, farmserviceaccount, and farmservicepassword, use the Get-SPEnterpriseSearchService and Set-SPEnterpriseSearchService cmdlets.

For the Osearch parameters start and stop, use the Start-SPEnterpriseSearchServiceInstance and Stop-SPEnterpriseSearchServiceInstance cmdlets, respectively.

For the Osearch parameter defaultindexlocation, use the Get-SPEnterpriseSearchServiceInstance and Set-SPEnterpriseSearchServiceInstance cmdlets.

Osearchdiacriticsensitive

Use the Get-SPEnterpriseSearchServiceApplication cmdlet to retrieve the specific Search service application, and then use DiacriticSensitive parameter from the Set-SPEnterpriseSearchServiceApplication cmdlet.

Provisionservice

Start-SPServiceInstance

Quiescefarm

None

Quiescefarmstatus

None

Quiesceformtemplate

Stop-SPInfoPathFormTemplate

Reconvertallformtemplates

Update-SPInfoPathFormTemplate

Refreshdms

None

Refreshsitedms

None

Registersecuritytrimmer

New-SPEnterpriseSearchSecurityTrimmer

Registerwsswriter

None

Removedataconnectionfile

Uninstall-SPDataConnectionFile

Remove-ecsfiletrustedlocation

Remove-SPExcelFileLocation

Remove-ecssafedataprovider

Remove-SPExcelDataProvider

Remove-ecstrusteddataconnectionlibrary

Remove-SPExcelDataConnectionLibrary

Remove-ecsuserdefinedfunction

Remove-SPExcelFileLocation

Removedrservice

None

Removeexemptuseragent

Remove-SPInfoPathUserAgent

Removeformtemplate

Uninstall-SPInfoPathFormTemplate

Removesolutiondeploymentlock

None

Renameserver

Rename-SPServer

Renamesite

Set-SPSite

Use the Url parameter.

Renameweb

Set-SPWeb

Use the RelativeUrl parameter.

Restore

Restore-SPFarm

Restore-SPSite

Retractsolution

Uninstall-SPSolution

Retractwppack

None

Runcontentdeploymentjob

Start-SPContentDeploymentJob

Scanforfeatures

Install-SPFeature

Use the Scanforfeatures parameter.

Setadminport

Set-SPCentralAdministration

Setapppassword

None

Setconfigdb

Connect-SPConfigurationDatabase

Setcontentdeploymentjobschedule

Set-SPContentDeploymentJob

Setdataconnectionfileproperty

Set-SPDataConnectionFile

Set-ecsexternaldata

Set-SPExcelFileLocation

Set-ecsloadbalancing

Set-SPExcelServiceApplication

Use the LoadBalancingScheme parameter.

Set-ecsmemoryutilization

Set-SPExcelServiceApplication

Use the MemoryCacheThreshold and PrivateBytesMax parameters.

Set-ecssecurity

Set-SPExcelServiceApplication

Use the CrossDomainAccessAllowed, EncryptedUserConnectionRequired, and FileAccessMethod parameters.

Set-ecssessionmanagement

Set-SPExcelServiceApplication

Use the SessionsPerUserMax and SiteCollectionAnonymousSessionsMax parameters.

Set-ecsworkbookcache

Set-SPExcelServiceApplication

Use the Workbookcache and WorkbookCacheSizeMax parameters.

Setformtemplateproperty

Set-SPInfoPathFormTemplate

Setlogginglevel

Set-SPLogLevel

Setosearchsetting

None

Setproperty

Set-SPFarmConfig

Get-SPTimerJob

Disable-SPTimerJob

Enable-SPTimerJob

Set-SPTimerJob

Start-SPTimerJob

Setqueryprocessoroptions

None

Setsitelock

Set-SPSiteAdministration

Use the LockState parameter.

Setsiteuseraccountdirectorypath

Get-SPSiteSubscription

New-SPSiteSubscription

Remove-SPSiteSubscription

Setworkflowconfig

Set-SPWorkflowConfig

Siteowner

Set-SPSiteAdministration

Syncsolution

Install-SPSolution

Use the Synchronize parameter.

Unextendvs

Remove-SPWebApplication

Uninstallfeature

Uninstall-SPFeature

Unquiescefarm

None

Unquiesceformtemplate

Start-SPInfoPathFormTemplate

Unregistersecuritytrimmer

Remove-SPEnterpriseSearchSecurityTrimmer

Unregisterwsswriter

None

Updateaccountpassword

Set-SPManagedAccount

Updatealerttemplates

None

Updatefarmcredentials

None

Upgrade

None

Upgradeformtemplate

Install-SPInfoPathFormTemplate

Upgradesolution

Update-SPSolution

Upgradetargetwebapplication

None

Uploadformtemplate

Install-SPInfoPathFormTemplate

Userrole

Get-SPUser

Move-SPUser

New-SPUser

Remove-SPUser

Set-SPUser

Verifyformtemplate

Test-SPInfoPathFormTemplate

Abraço!