Está en la página 1de 52

Sharepoint Solutions Framework desde

el principio

El modo adecuado de desplegar un desarrollo


dentro de Sharepoint

Mauricio Grimberg
Agenda
Paquetes de Solución y Características
Cómo crearlos
Cómo desplegarlos mediante Stsadm y PowerShell
cmdlets

Mauricio Grimberg
PAQUETES DE SOLUCIÓN Y
CARACTERÍSTICAS

Mauricio Grimberg
FEATURES (CARACTERÍSTICAS)

Mauricio Grimberg
Cápsulas de funcionalidad
Las Features habilitan el despliegue de
aplicaciones y funciones a un sitio de
SharePoint
Típicamente se instalan como un Paquete de
Solución

Mauricio Grimberg
¿Qué pueden contener?
Content Type Bindings
Content Type Definitions
Delegate Controls
Document Converter
Event Registrations
Feature.xml Files
Feature/Site Template Associations
Field Definitions
List Instances
List Template Files
Modules
Site Definition (Onet.xml) Files
Workflow Definitions
MSDN (http://msdn.microsoft.com/en-us/library/ms414322.aspx )

Mauricio Grimberg
¿Dónde se alojan?
En el front-end web server, cada feature se
encuentra en su propia subcarpeta bajo
%SharePointRoot%\TEMPLATE\FEATURES

Mauricio Grimberg
Ejemplo de nodos de Feature

Mauricio Grimberg
Ejemplo de Feature.xml
<?xml version="1.0"?>
<Feature Id="8C4DD0CB-5A94-44da-9B7F-E9ED49C2B2DC"
Title="Custom Web page"
Description="Este simple ejemplo agrega una página aspx que
incluye un
XmlFormView control" Version="1.0.0.0" Scope="Web"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="Module.xml"/>
</ElementManifests>
</Feature>

Mauricio Grimberg
Ámbitos (Scopes)

Mauricio Grimberg
Archivos son ítems funcionales
Dentro de feature.xml, otro archivo es
referenciado en el nodo ElementManifest
Ejemplo: elements.xml

<?xml version="1.0"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<module name="file" url="" path="">
<file url="XmlFormViewPage.aspx" type="ghostable"> </file>
</module>
</Elements>

Mauricio Grimberg
Ej. de nodos de subarchivos

Mauricio Grimberg
Solution Packages
PAQUETES DE SOLUCIÓN

Mauricio Grimberg
¿Cómo se instala una feature?
Extensiones y personalizaciones requieren
Assemblies
Resource files
Features
Páginas
Definiciones de sitio

Mauricio Grimberg
Desarrolladores + IT Pros
Los Solution Packages habilitan
El transporte
La instalación

Mauricio Grimberg
¿Cómo se instala un paquete?
Mediante archivos de línea de comandos
Stsadm
PowerShell

Mauricio Grimberg
¿Qué es un Solution Package?
Es un archivo
cabinet (CAB)
de extensión
.wsp

Mauricio Grimberg
¿Cómo es internamente?
La estructura
del WSP
define sus
archivos
Un XML
define esa
estructura
Manifest.X
ml.

Mauricio Grimberg
¿Qué puede contener?
Site definitions
Feature definitions completas
Web Part files
Template files and root files
Resource files
Assemblies
Code access security policies

Mauricio Grimberg
Ejemplo de manifest.xml
<Solution SolutionId="4AFC1350-F354-4439-B941-51377E845F2B"
xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureManifests>
<FeatureManifest Location="FeatureLibrary\feature.xml"/>
</FeatureManifests>
<TemplateFiles>
<TemplateFile Location="ControlTemplates\Featurelibraryform.ascx"/>
</TemplateFiles>
<RootFiles>
<!-- These files go into the 12\ directory and can be used for Web services and global resources -->
<RootFile Location="ISAPI\MyWebService.asmx">
</RootFiles>
<Assemblies>
<Assembly DeploymentTarget="GlobalAssemblyCache"
Location="ms.samples.sharepoint.myFeature.dll"/>
</Assemblies>
</Solution>

Mauricio Grimberg
Importantes avances en la versión 2010
CÓMO CREAR SHAREPOINT
SOLUTION PACKAGES Y
FEATURES
Mauricio Grimberg
CREACIÓN DE UN PAQUETE
MEDIANTE VISUAL STUDIO 2010

Mauricio Grimberg
En Visual Studio
Nuevo
Proyecto
Visual
Studio 2010
incluye
plantillas
varias para
SharePoint

Mauricio Grimberg
Sitio de trabajo

Mauricio Grimberg
SharePoint Developer Tools
Cada proyecto de SharePoint es creado con una
Feature y un Package

Mauricio Grimberg
¡Simple!
SDT nos abstrae de cualquier detalle de bajo
nivel
Ni manifest.xml
Ni crear el .wsp Son tareas que
Ni la Feature implícitamente y sin que
necesitemos saberlo realiza
Visual Studio

Mauricio Grimberg
SharePoint Explorer

Mauricio Grimberg
Feature Designer
Modificar
Title
Description
Scope

Mauricio Grimberg
Feature Receiver
Extender una feature
mediante un Feature
Receiver

Mauricio Grimberg
Switch
Puedo editar el XML en el momento que desee
(si me hace falta)

Mauricio Grimberg
Sharepoint Deployment Project Tab

Mauricio Grimberg
Pasos del despliegue
Cada configuración
de deployment
contiene varios
pasos (deployment
steps)

Mauricio Grimberg
Mapped Folders
Se pueden utilizar default mapped folders para
despliegue de archivos: CSS, JavaScript, XSLT,
y Silverlight XAP

Mauricio Grimberg
Propiedades del paquete

Mauricio Grimberg
DESPLIEGUE DE SOLUCIONES
SHAREPOINT VÍA STSADM &
POWERSHELL CMDLETS
Mauricio Grimberg
POWERSHELL

Mauricio Grimberg
.Net Scripting!!
PowerShell conlleva unparadigma
completamente nuevo
Utiliza NET objects como input & output y se
basa en.NET CLR.

Mauricio Grimberg
Agregar una solución vía Windows
PowerShell

Mauricio Grimberg
Cmdlets
Un cmdlet es un sencillo archivo command-line
integrado al shell que ejecuta un determinado
propósito.
PowerShell trae muchísimos built-in cmdlets
De hecho es el Scripting por defecto en 2010
Los cmdlets son instancias de.NET classes
La extensión es .ps1

Mauricio Grimberg
Integrated Scripting Environment
Permite ejecutar
comandos,
escribir, testear, y
depurar scripts en
una WPF
application que
requiere .NET
3.5.

Mauricio Grimberg
Powershell y Sharepoint 2010
SharePoint.ps1
ejecuta el cmdlet
Add-PsSnapin para
cargar los SharePoint
cmdlets. Cambia
también el modelo de
threadinga single para
simplificar el disposal
de objetos

Mauricio Grimberg
DESPLIEGUE A UNA GRANJA DE
UN SOLUTION PACKAGE

Mauricio Grimberg
Upload
Add-SPSolution -LiteralPath C:\MySolution.wsp

Mauricio Grimberg
Deploy
Install-SPSolution -Identity MySolution.wsp –
GACDeployment

Mauricio Grimberg
Uninstall
Uninstall-SPSolution -Identity SolutionName

Mauricio Grimberg
Remove
Remove-SPSolution -Identity SolutionName

Mauricio Grimberg
STSADM

Mauricio Grimberg
Upload
stsadm –o addsolution –filename
C:\MySolution.wsp

Mauricio Grimberg
Deploy
stsadm –o deploysolution –name MySolution.wsp –
immediate –allowGacDeployment -force

Mauricio Grimberg
Uninstall
stsadm -o retractsolution -name MySolution.wsp
-immediate

Mauricio Grimberg
Remove
stsadm -o deletesolution -name MySolution.wsp
-override

Mauricio Grimberg
Mauricio Grimberg
http://www.mossca.org/openxml
mau@mvps.org

Mauricio Grimberg

También podría gustarte