martes, 31 de enero de 2012

Encontrar el ID de template del site actual Sharepoint 2010

Para encontrar el site template para el sitio que estás viendo, sigue estos pasos:

  • Ver el código de la página
  • Buscar la variable ‘g_wsaSiteTemplateId’ variable

El valor de la variable es el site template que se está usando para la creación del site.Ej: g_wsaSiteTemplateId = 'STS#0'; significa que el sitio actual se creó con Team Site Template.

A continuación los ID de los templates:

Renombrar la base de datos del servicio de aplicación PerformancePoint

When creating the PerformancePoint Service Application, there is no way to control the name of the database that is created (Si se tiene instalado el service pack 1), not even when using PowerShell to create the Service Application. The database that gets created is in the form

<Service Application Name>_GUID

which for some reason a good many DBAs are not too keen on!

The database can however be renamed by following these steps:

  • Stop the PerformancePoint service on all SharePoint servers in the farm that are running the service using the ‘services on servers’ area of Central Administration:
    Stopping the PerformancePoint Service

lunes, 30 de enero de 2012

My SharePoint Dev Toolkit



Fiddler

Web Debugging Proxy

2012-01-25-DevToolbelt-04a.png


Notepad ++

Notepad with steroids

2012-01-25-DevToolbelt-05a.png


ILSpy

Open-source .NET assembly browser \ decompiler

2012-01-25-DevToolbelt-06a.png


ULS Viewer

ULSViewer allows users to open a ULS log file and display its contents in a user
friendl

Mostrar usuarios como “Dominio\NombreUsuario” en vez "Nombre para mostrar

In most cases it is the Profile Sync job which is turned off and as a result the synchronization doesn't happen.

But sometimes even the profile sync is on, but SHarePoint 2010 can't update the accounts. In such a case one can - Powershell Command "Set-SPUser".

1) If the problem only appears with a single user, you can update a single account like so:
Set-SPUser -Identity ‘domain\Username’ –Web http://<URL To Site> –SyncFromAD


2) If all (or a lot) of the uesrs you can do it by the following:
Get-SPUser –Web http://<URL to Site> | Set-SPUser –SyncFromAD

The above will reset all users FOR THAT SPECIFIC URL; if you have additional site collections (i.e. Managed Paths), you have to run it on those URL's as well.

Ratings not showing in SharePoint 2010

You can configure ratings on list items that aggregates user selections, however when you select a rating it doesn’t instantly appear.
This is because there are two timer jobs that are set to run hourly that calculates this information:
User Profile Service Application – Social Data Maintenance Job
User Profile Service Application – Social Rating Synchronisation Job

If you want ratings to update more often, you should change the schedule accordingly. you can of course just click “Run Now” to get them updated immediately.

 

Fuente: http://gavinmckay.wordpress.com/

Thoughts on SharePoint Application Pools, Recycling and "JIT Lag"

What are Application Pools?

Application Pools are a .NET construct, and each pool represents an instance of the Common Language Runtime (CLR) executing managed .NET code. Each application pool in IIS hosts one or more web applications, and the recommendation is to stay under 10 pools per server. This recommendation was made in 32-bit days, and other considerations like 32 vs. 64-bit, available RAM, and I/O (bandwidth and disk usage) really take over as you add application pools. 

What happens when an application pool recycles?

Recycling is like rebooting. The process is stopped and started fresh. The CLR reloads, the assemblies in the GAC are re-read, and the application is ready to respond to requests. When the first request comes through the application takes a look at the page (aspx), web service (asmx), or whatever resource was requested, checks whether it was pre-compiled or needs to be JIT-compiled, reads the assemblies required to serve it (and does the same JIT-compilation checks on them).

Why all the JITter? In a nutshell, when you compile an assembly in Visual Studio you're compiling to MSIL (which is processor-agnostic), and not to native machine code (which is processor-specific). This JIT compilation is why the first request to a page takes longer than subsequent requests - the first request has extra work to do.

If you take the heavy-handed approach of resetting IIS (IISRESET) rather than recycling an individual application pool, there is much more to be torn down and restarted. Developers quickly learn the speed advantage of resetting single application pools, and administrators quickly learn the value of "warming up" pages so the JIT-compilation is done by the time users make their page requests.

SharePoint 15 object model preview

A technical preview of the Managed Object Model Software Development Kit for SharePoint 15 was also released today and this provides some insights into what might be included in the next version of SharePoint. Some of the more interesting additions are:

The addition of a CorporateCatalog enumeration with the following values:

  • StoreFront – The package is from the marketplace.
  • CorporateCatalog – The package is from a corporate gallery.
  • DeveloperSite – The package is from a developer site.
  • ObjectModel – The package is loaded via an object model.
  • RemoteObjectModel – The package is uploaded via CSOM.

New SPApp, SPAppInstance and SPAppCatalog classes. The description for the SPApp class states: “Represents an app loaded onto Microsoft SharePoint Server and ready to be installed.” which also contains a CreateAppInstance method that states “Creates an instance of an app at the specified site specified by the web parameter. The new instance can then be retrievedby using the SPAppCatalog class and using the returned ID.”

This hints at an extended deployment framework allowing more control over deployment of custom components within SharePoint. For example we also have a SPWeb.LoadAndInstallApp method that is used to upload and install an app package and a SPWeb.AppDatabaseName property.

Another potentially related addition is the SPWebApplication.IsUserLicensedForEntity method that “Checks if the currently logged in user has the proper license to access the specified entity.”

SharePoint 2010 | Clear SharePoint Cache

 

SharePoint caches the content (Could be images, etc.) in two of its system folders.

The cache is composed of these 2 folders:

  • %APPDATA%\Microsoft\Web Server Extensions\Cache
  • %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache

In order to clear the cache, simply delete the files in these two folders.

I even created a batch file for doing this, which allows you to automate this function either as a scheduled job or manually by clicking on the batch file.

========Script Start below===================
cd “%APPDATA%\Microsoft\Web Server Extensions\Cache”

del *.web /S /Q “%APPDATA%\Microsoft\Web Server Extensions\Cache”

cd “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache\”

rmdir /S /Q “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache\.”

mkdir “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache”

dir “%APPDATA%\Microsoft\Web Server Extensions\Cache”

dir “%USERPROFILE%\AppData\Local\Microsoft\WebsiteCache”

========Script End========================

 

Fuente: http://blogs.msdn.com/b/varun_malhotra/

Más información:

Sharepoint Designer  web cache issue: http://urbandude.com/post/2007/04/02/Sharepoint-Designer-web-cache-issue-fix.aspx

http://blogs.msdn.com/b/spdsupport/archive/2008/07/03/how-to-fix-custom-list-forms-will-not-insert-or-show-up-on-the-design-surface-of-sharepoint-designer.aspx

Excel Services Architecture In SharePoint Server 2010

Excel Services is part of Microsoft SharePoint Server 2010. Excel Services is built on ASP.NET and SharePoint Foundation technologies. Following are the core components in Excel Services:

  • Excel Web Access
  • Excel Web Services
  • User-defined functions (UDFs)
  • ECMAScript (JavaScript, JScript)
  • Representational State Transfer (REST) service
  • Excel Calculation Services

The Excel Web Access, Excel Web Services, UDFs, ECMAScript, the REST service, and Excel Calculation Services components can be divided into two major groups: the components on a front-end server (also known as the "Web front end") and the component on a back-end application server.

An important aspect of Excel Services is that solution developers can use its power programmatically from their applications. These applications can be line-of-business (LOB) products or custom enterprise solutions that an organization develops internally.

Método SPSecurity.RunWithElevatedPrivileges

Executes the specified method with Full Control rights even if the user does not otherwise have Full Control. A delegate method that is to run with elevated rights. This method runs under the Application Pool identity, which has site collection administrator privileges on all site collections hosted by that application pool.

If secureCode includes any write operations, then the call to RunWithElevatedPrivileges should be preceded by a call of either SPUtility.ValidateFormDigest orSPWeb.ValidateFormDigest

Guid siteId = SPContext.Current.Site.ID;
Guid webId = SPContext.Current.Web.ID;

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    using (SPSite site = new SPSite(siteId))
    {
        using (SPWeb web = site.OpenWeb(webId))
        {
            // Your code here
        }
    }
});

sábado, 28 de enero de 2012

Sharepoint 2010 - Objecto Session

Pues bien SharePoint 2010 tiene la capacidad de manejar las sesiones Asp.net con total transparencia para el desarrollador, ya que toda la información de sesiones se almacena en una base de datos SQL.

Sin embargo esto también quiere decir que el uso intensivo de la sesión debe ser como siempre bien planificado.

Por defecto en una instalación estándar de SharePoint las sesiones Asp.net se encuentran deshabilitadas. Para habilitarlas en MOSS simplemente:

En la consola PowerShell ejecute

  • Enable-SPSessionStateService –DefaultProvision

Este comando establece los atributos por default dejando la base de datos de manejo de sesión en el mismo sitio que la base de configuración de SharePoint, si desea puede usar atributos adiciones para establecer dicha base de datos en otra ubicación.

  • DatabaseName 
  • DatabaseServer 
  • DatabaseCredentials
  • Custom SharePoint Pages – Site Pages vs Application Pages

    Here are major characteristics and differences between site pages and application pages categorized by major areas of architectural decisions.

    • Characteristics
      • An Application page is an ASP.NET content page hosted in the LAYOUTs directory on the WFEs and inherits from Microsoft.SharePoint.WebControls.LayoutsPageBase. Site Pages are stored in the virtual file system in the Content databases. SPFile and SPFolder objects represents Site Pages in WSS object model.
      • As Name Suggest, An Application Page is application or farm scoped and A site page is  site/web scoped.
      • Site Pages consists of two compoents => Site Page Templates vs Site Page Instances
        • Site Page Templates are .aspx pages stored in the file system in the FEATURES directory.
        • Site Page Instances are provisioned through Module and File elements and resides in content database. They are created inside the context of the particular site. WSS treats Un-customized Site Page Instances as a reference pointer to the Site Page Template. You can use SharePoint Designer to customize or view site page instances. Both customized or un-customized site pages exposed through the virtual file system.

    Columna auto numérica

    Una solución es usar workflows: http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/867bcacd-d378-411a-849a-fc040de9e5da/

    Otra solución es usar la columna ID, se genera el valor autonumérico después que el registro es agregado, así si necesitás que el valor auto numérico en un nuevo item, esta solución no es para vos.

    Crear una columna autocalculada Request Number, y ingreso la fórmula:

    =CONCATENATE("WR-",REPT(0,4-LEN(ID+1)),ID+1)

    Esta formular combina WR- y con 0's y el ID numérico:

    Fuente:

    http://blog.netnerds.net/2012/01/sharepoint-simple-sample-approach-to-autonumber/

    Más información:

    https://www.nothingbutsharepoint.com/sites/eusp/pages/sharepoint-how-to-create-an-auto-incrementing-number-field-for-use-in-a-custom-id-part-1.aspx

    Debuggear un custom timer job de Sharepoint

    Cuando crea timer jobs de SharePoint en Visual Studio 2010 no se puede debuggear como si fuera un web part o una página de la aplicación simplemente pulsando F5. En su lugar, usted tiene que deployar la solución en la instancia local de SharePoint y luego asociar el depurador al Sharepoint timer Process.

    1.  En el método Execute del Timer Job, agrega un breakpoint

    msdn_attach-300x207

    2.  Deploy la solución en la instancia local del SharePoint. Si tienes ya has deployado previamente, debes resetear el Sharepoint Timer Service, para refrescar el código.

    3.  Desde el menú Debug del Visual Studio, selecciona Attach To Process.

    4.  Selecciona OWSTIMER.EXE y hace un Attach.Si no ves OWSTIMER.EXE en la lista, asegúrate de checkear “Show processes from all users” y “Show processes in all sessions” .  Si lo sigues sin ver, asegúrate de que esté corriendo Sharepoint Timer Service. If you receive a security warning about the process running as a different user, selyect Attach.

    msdn_attach-300x207

    5.  En el Central Administration, inicia el timer job. Se ejecutará el método execute y se hará una pausa en el breakpoint.

    msdn_execute-300x127

    Más información:

    http://msdn.microsoft.com/en-us/library/ff798310.aspx

    Crear un timer job en Sharepoint 2010: http://www.sharepointjohn.com/sharepoint-2010-custom-timer-job-in-visual-studio/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SharepointJohn+%28SharePoint+John%29

    Acceder al web.config desde el job: http://srisharepointdevelopment.blogspot.com/2010/11/how-to-access-webconfig-in-timer-job.html

    Estructura de los workflows

     

    For each SPD workflow, three or four files are created depending upon the existence rules or conditions.

    • xoml – Contains all the activities included in the workflow in Extensible Application Markup Language (XAML) format

    • xoml.wfconfig.xml – Contains details of the list or site GUIDs and start configuration of the workflow

    • xsn or aspx – In MOSS, an aspx page is created for starting workflow. In SharePoint 2010, we have InfoPath form in place of aspx page

    • xoml.rules – Contains workflow rules if used

    Sharepoint 2010 Item Event Receiver

    image

    Item Event Receivers derive from the SPItemEventReceiver class and have a number of methods that can be overridden to respond to various events:

    Notes Chapter 2 – Sharepoint 2010 Unleashead

    414VVriDCOL._SL500_AA300__thumb 

    All SharePoint content is stored in databases, including all document library content, list items, document metadata, and web parts. There are only two exceptions to this. The first is if the database server uses a concept known as Remote BLOB Storage (RBS), which allows for the storage of the documents, or BLOBs (binary large objects), in another storage medium such as a file server or an archive.

      The full-text search index, which is stored in flat-file format

      Supported versions of SQL Server for SharePoint 2010 are as follows:

      . SQL Server 2005 SP3 x64

      . SQL Server 2008 x64

      . SQL Server 2008 R2 x64

    Configuración correcta de ULS (Diagnostic Log)

    En primer lugar, consideramos que los registros de ULS están diseñados con un propósito singular en cuenta: Para permitir que un administrador identifique y resuleva problemas en SharePoint. No se utilizan para ningún otro propósito dentro de SharePoint. Desde esta perspectiva, si el entorno es "perfecto" (si es posible), entonces la mejor respuesta para usted es simplemente apagarlo. Consumen una pequeña cantidad del sistema de recursos del sistema, y pueden consumir una cantidad considerable de espacio en disco.

    Por otro lado, algunos clientes lo tienen seteado a verbose (detallado),todo el tiempo. Esto es un poco ridículo, si no estás investigando un problema. Está consumiendo enormes cantidades de espacio en disco y recursos del sistema potencialmente significativo y el rendimiento un poco degradado para los usuarios finales para capturar los datos que no tienen interés en realidad de mirarlo. Le sugiero que restablecer la configuración predeterminada o incluso apagar esta funcionalidad.

    SharePoint 2010 RBS (Remote Blob Storage)

    Remote Blob Storage (RBS) is a Microsoft technology for managing large BLOBs (Binary Large Objects) in SQL Server and is fully supported within SharePoint 2010. This technology basically allows you to take the large binary files that are expensive to maintain within a database, and offload them to a separate drive.

    Who needs RBS? You may need it if you:

    • Have very large Content Databases (100GB+)
    • Have a content mix that includes a large proportion of streaming media
    • Your content is large (1TB+)
    • You have more than one tier of storage

    Few people actually use RBS as implemented by Microsoft. Most users who need RBS simply pay for 3rd party software (StoragePoint/Metalogix or DocAve extender) which is the easy way to go.

     

    viernes, 27 de enero de 2012

    SharePoint 2010 Best Bets

    Best Bets is enhancement to your basic SharePoint 2010 Search.  Essentially, this allows you to inject chosen content at the top of search queries to searching users.  An example could be that you want your twitter account link to display if someone searches for your name.  Lets jump in and get this set up!
    First you need to create a Search Center site, for this example I will use the Basic Search Center.  Go to Site Actions -> New Site -> Basic Search Center (under search on the left).  This is the same as creating any site within SharePoint 2010. 

    Now that you have the Search Center created, we need to go in and set up our Best Bets!  Navigate to Site Actions -> Site Settings and under Site Collection Administration click go to top level site settings option.  If you don't see this option then just navigate to the top level site and go to Site Settings.  Once at the top level site settings, under Site Collection Administration you should see Search Keywords (shown below).

    skey

    Remover una webpart de una página con errores (Web Part Page Maintenance: default)

    Agregar ?contents=1 a la url de la página  y se redireccionará al mode mantenimiento de la página.

    SharePoint API Guía de Traduccción

     

    SharePoint UI Term  --> SharePoint API Class

    Site Collection  -->  SPSite

    Site  --> SPWeb

    Business Data Catalog  --> ApplicationRegistry

    Site Column  --> SPField

    Permission Level  --> SPRoleDefinition

    Alternate Access Path  --> SPAlternateUrl

    Top Level Site  --> RootWeb

    My Sites  --> QuickLink

    Content Approval  --> Moderation

    User Profile Syncronization

     

    Gran artículo sobre la implementación de User Profile Syncronization

    http://www.harbar.net/articles/sp2010ups.aspx

    15 consideraciones que deberías tener al decidirte por SharePoint Online Office 365

     

    1. Each My Site gets 500MB of personal storage. This amount cannot be adjusted.
    2. The My Content part of a My Site is not provisioned until the user clicks on My Content from their My Profile page. After they do, a personal My Site site collection is created. This does not count against the 300 site collection limit as that applies to non-My Site site collections.
    3. BCS within SharePoint Online does not support a direct connection to SQL Azure. A WCF endpoint is required. -- See this Blog on how to do this with WCF here http://www.sharepointfabian.com/blog/Lists/Posts/Post.aspx?ID=212
    4. Access reporting is not supported by SharePoint Online Access Services because SQL Server Reporting Services (SSRS) is not currently enabled for SharePoint Online.  Access reporting requires SSRS.
    5. SharePoint Online does not support auditing capabilities to log the opening and downloading of files in a document library.
    6. SharePoint Online does not support PerformancePoint Services.
    7. SharePoint Online does not support Excel Services and PowerPivot for SharePoint
    8. PDFs and other types of files can potentially run scripts against sites. To prevent this security threat, SharePoint Online requires users to download these types of files. When the user tries to open a PDF document stored in a SharePoint Online document library,  the user will see a “Save As…” window and must download the PDF file to their local directory.
    9. SharePoint Online does support Enterprise Search, but does not currently support FAST Search.
    10. Vanity URLs can only be applied to the public website. Customers cannot apply a vanity URL to an intranet zone site.
    11. Editing the Public Website with SharePoint Designer is not supported.  SharePoint Designer 2010 cannot be used to edit the public website. This site can only be edited with the built-in Site Designer tool. SharePoint Online only supports SharePoint Designer 2010.
    12. SharePoint Online development patterns and practices are currently targeted at site collection level solutions.
    13. “Server Resources” quota, what are used to determine amount of processing power available to Sandboxed Solutions, is determined by the number of licensed user seats in a company's tenancy. To calculate server resource quota in Office 365, you can use the following equation: (#seats×200) + 300.
    14. SharePoint Online does not currently support customer use of Windows PowerShell for service administration.
    15. You cannot create property based search scopes in Office 365 (SharePoint Online) -- Credit Wictor Wilen athttp://www.wictorwilen.se/Post/You-cannot-create-property-based-search-scopes-in-Office-365-SharePoint-Online.aspx

    Obtener un listado de Webs, Listas y Librerías de una web application

    Para ver el listado de un SiteCollection
    Get-SPSiteInventory -Url http://spsite –SiteCollection
    Para ver el listado de un web application
    Get-SPSiteInventory -Url http://spwebapp –WebApplication
    La función completa
    function Get-SPSiteInventory {
    Param(
    [string]$Url,
    [switch]$SiteCollection,
    [switch]$WebApplication
    )
    Start-SPAssignment -Global
    if ($SiteCollection) {
    $site = Get-SPSite $Url
    $allWebs = $site.allwebs
    foreach ($spweb in $allWebs) {
    " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
    $spweb.Url
    $spweb.Lists | select Title, BaseType
    $spweb.dispose()
    }
    $site.dispose()
    }
    elseif ($WebApplication) {
    $wa = Get-SPWebApplication $Url
    $allSites = $wa | Get-SPSite -Limit all
    foreach ($spsite in $allSites) {
    $allWebs = $spsite.allwebs
    foreach ($spweb in $allWebs) {
    " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
    $spweb.Url
    $spweb.Lists | select Title, BaseType
    $spweb.dispose()
    }
    }
    }
    Stop-SPAssignment -Global
    }
     
    Fuente: http://sharepointryan.com/2012/01/25/get-a-web-list-and-library-inventory-using-powershell/
     
     
     
     

    SharePoint 2010 Developer FAQs

    Q. How do I deploy my custom CSS file in Sharepoint 14 hive?

    To simply deploy a CSS file you can use “Sharepoint mapped folder” available in vs 2010.
    Quick steps -
    Create a empty project
    Add new item -> select “SharePoint mapped folder”
    Select the folder in 14 hive where you want to add the CSS file into. The folder structure then will be added to your Solution.
    Next, add your CSS under the desired folder in your solution and deploy.

     

    SharePoint 2010 Nombre de la base de datos PerformancePoint

    A partir de Sharepoint 2010 SP1 es posible cambiar el nombre de la base de datos de PerformancePoint con PowerShell

    New-SPPerformancePointServiceApplication [-Name <string>] [-ApplicationPool <spiiswebserviceapplicationpool>] [-DatabaseServer <string>] [–DatabaseName <string>] [-DatabaseSQLAuthenticationCredential <pscredential>] [-DatabaseFailoverServer <string>]

     

    Más información: http://technet.microsoft.com/es-es/library/ff608122.aspx

    http://www.sharepointroundtable.com/blogs/rdennis/archive/2011/04/03/create-a-performancepoint-service-application-database-without-guids.aspx

    Naming Your PerformancePoint 2010 Database

    http://blogs.msdn.com/b/performancepoint/archive/2011/06/23/naming-your-performancepoint-2010-database.aspx

    jueves, 26 de enero de 2012

    Top 10 questions about InfoPath attachments

    1. Where are InfoPath form attachments stored?

    InfoPath attachments are stored as pieces of text called base64 encoded strings within the InfoPath form itself.

    To be able to store a file as a string, InfoPath converts the binary data of the file to a string. This is called encoding.

    Once you’ve added a file as an attachment to an InfoPath form, you can use the menu options Open or Save As on the File Attachment control to retrieve the file that was stored in the InfoPath form.

    When you select either menu option, InfoPath converts the string it stored previously back to binary data and presents you with the file again. This is called decoding

    Managed Metadata Column Limitations

    1) No InfoPath Support

    There is no InfoPath support for Managed Metadata columns. Regardless of whether this is a InfoPath form that is hosted through Forms Services or a list form it is not supported.

    If you try to customize a form with InfoPath that has a Managed Metadata column you will get this:

    image

    This is really, really important if you intended to use InfoPath to start customizing all of your forms and intended to also leverage Managed Metadata. Put simply you cant

    2) No SharePoint Workspace Support

    There is also no support for Managed Metadata columns in SharePoint workspace, as pointed out by a blog from Paul Culmsee. So if you have requirements around taking content offline with Workspace be careful on deciding whether Managed Metadata is right for you.

    image

    3) No Support in Office 2007

    This is another one that gets many organizations. You can not edit Managed Metadata columns from the Office 2007 client, or 2003 for that matter. If you want  to be able to edit Managed Metadata columns you need to have Office 2010 installed.

    This can be a major pain, especially if you have Managed Metadata columns set to required on a particular Content Type or library. For more information Corey Roth did a great point over at nothingbutsharepoint.com. Go check it out and don’t get caught like many organizations have.

    Base de datos Sharepoint 2010 – Post 1 (Configuration)

    Microsoft® SQL Server® databases are integral to Microsoft® SharePoint® 2010 Products. The databases used in a specific environment are determined by the product, version, edition, and features that are running. Database size, and the edition of SQL Server that you run will be determined by the capacity and feature requirements of your environment.


    For more detailed information about each database, see the articles:
    ·    Database types and description for SharePoint Server 2010 (http://go.microsoft.com/fwlink/?LinkId=187312)
    ·    Database types and description for SharePoint Foundation 2010 (http://go.microsoft.com/fwlink/?LinkId=187313).

    CONFIGURATION

    La base de datos de configuración contiene datos sobre bases de datos de SharePoint, sitios web de Internet Information Server (IIS), aplicaciones web, soluciones de confianza, paquetes de elementos web, plantillas de sitio, y opciones de configuración de aplicaciones web y granjas de servidores específicos de Productos de SharePoint 2010, como la configuración de cuota predeterminada y los tipos de archivos bloqueados.

    miércoles, 25 de enero de 2012

    Solutions Sandbox – Limitaciones

    Hasta el día de hoy, estas son algunas limitaciones de las soluciones sandboxed. Con la nueva versión de Visual Studio se eliminarán algunas de estas limitaciones: http://todosharepoint.blogspot.com/2012/01/what-new-sharepoint-development-in.html
    • Can’t deploy files to disk or deploy assemblies to GAC. Can you imagine how limiting this can be? Think workflows.
    • Cannot access the cache object from a sandboxed web part.
    • Cannot access the ScriptManager from a sandboxed web part.
    • Sandbox does not support re-direction – no Response.Redirect, no Server.Transfer,  no SPUtility.Redirect.
    • Can’t access SharePoint.WebControls: you can't create a Web Part that uses any of the built in controls which you can use in SharePoint Designer!

    SharePoint 2010: Acceso por Windows Explorer muy lento

    Podemos manejar las bibliotecas de SharePoint como si fuera una unidad de red pudiendo copiar y pegar ficheros desde una ventana de explorador de Windows gracias a la vista en explorador de Windows.

    En ocasiones si utilizamos Windows 7 o Windows Vista podemos encontrarnos con que el acceso a esta funcionalidad se hace muy lenta tanto en abrir la ventana como copiar/descargar ficheros.

    En mi caso la solución ha sido desmarcar la opción “Detectar la configuración automáticamente” de Internet Explorer:

    Desde Internet Explorer > Opciones de Internet > Conexiones > Configuración de LAN > desmarcar “Detectar la configuración automáticamente”.

    image

    martes, 24 de enero de 2012

    Sharepoint 2010 – Carpeta que deberías conocer

     

    C:\ProgramFiles\Microsoft Office Servers\14.0 - This directory is the installation location for SharePoint Server 2010 binaries and data. The directory can be changed during installation.

    C:\Inetpub\wwwroot\wss - This directory (or the corresponding directory under the Inetpub root on the server) is used as the default location for IIS Web sites.

    C:\ProgramFiles\Microsoft Office Servers\14.0\WebServices - This directory is the root directory where SharePoint back-end Web services are hosted, for example, Excel and Search.

    C:\ProgramFiles\Microsoft Office Servers\14.0\Data - This directory is the root location where local data is stored, including search indexes.

    C:\ProgramFiles\Microsoft Office Servers\14.0\Logs – This directory is the location where the run-time diagnostic logging is generated.

    Control SPSecurityTrimmedControl

    Este control permite ocultar el contenido debido a una determinada definición de seguridad.  La solución anterior ocultaba en el lado del cliente (style.display='none') el contenido, ahora lo hace desde el servidor.

    <SharePoint:SPSecurityTrimmedControl PermissionsString="AddAndCustomizePages, ManageLists" runat="server">
        <%--content %>
    </SharePoint:SPSecurityTrimmedControl>

     

    Crear un site collection con un custom Site Template

     

    Hace poco me surgió la duda si era posible crear una nueva colección de sitios de SharePoint 2010 y el uso de una plantilla de sitio personalizada para él. En un sitio de SharePoint 2007, las plantillas se guardan como archivos .STP. Los archivos STP podría estar en la galería de la colección de sitios, o en la farm. Si estaba en la granja, entonces estaba disponible en la creación de los site collection. En un sitio de SharePoint 2010 se almacenan las plantillas como soluciones para los usuarios en la store de la site collection como archivos WSP.

    Cuando una nueva colección de sitios se crea, hay un selector de plantillas. Que no se aplica la plantilla a la colección de sitios en sí, sino a la rootweb de esa colección de sitios.Cuando la colección de sitios se crea, el rootweb también se crea. Ahí es donde se aplica la plantilla. Sabiendo eso,podemos encontrar una solución. Sabemos que la colección de sitios se crea, con o sin plantilla. Si la colección de sitios se crea, también lo es su galería de solución. Si subimos nuestro WSP a la galería de solución, entonces está disponible para nosotros cuando creamos el rootweb. Así es como creamos una colección de sitios con una plantilla personalizada.

     

    lunes, 23 de enero de 2012

    Notes Chapter 1 – Sharepoint 2010 Unleashead

    414VVriDCOL._SL500_AA300_

    Estaré subiendo mis anotaciones de la lectura de este libro.

     

    One of the most significant architectural changes in SharePoint 2010 is the change to a service application architecture from the shared services provider architecture of SharePoint 2007.

    Content sources can now be divided among multiple index partitions

    FAST Search has all of the improvements available with the native SharePoint 2010 search but adds additional features, such as thumbnail previews, click-through relevance, and automatic metadata tagging.

    The space consumed within SharePoint content database is approximately 80 percent BLOB content, using RBS can have a significant effect on the size and maintenance of content databases.

    Sharepoint Top 10 Codeplex project for Developers

     

    1)  Sharepoint 2010 Fluent Ribbon Api:
    Fluent API for Ribbon creation in SharePoint 2010. Create and manage your ribbon without unpredictable xml or typo-prone “magic strings”
    http://spribbon.codeplex.com/

    2)  jQuery Library for SharePoint Web Services
    This is a jQuery library which abstracts SharePoint’s Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.
    http://spservices.codeplex.com/

    Subir archivos grandes a SharePoint 2010 con Client Object

    When you use SharePoint Client OM to upload files to SharePoint 2010 Document Library, uploading of files larger than 3 MB fail with the following error:

    The remote server returned an error: (400) Bad Request.

    Stack trace:
    System.Net.WebException was unhandled
    Message=The remote server returned an error: (400) Bad Request.
    Source=System
    StackTrace:
          at System.Net.HttpWebRequest.GetResponse()
          at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
          at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
          at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
          at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
          at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
          at SPClientOMConsoleApp.Program.Main(String[] args) in C:\SPClientOMConsoleApp\SPClientOMConsoleApp\Program.cs:line 32
          at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
          at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
          at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
          at System.Threading.ThreadHelper.ThreadStart()
    InnerException:

    Sample program used to upload file using SharePoint 2010 Client OM:

    ClientContext clientContext = newClientContext("http://server:10000/sites/testSite");
    Web web = clientContext.Web;
    clientContext.Load(web);
    List docLib = web.Lists.GetByTitle("doclib");
    clientContext.Load(docLib);
    clientContext.ExecuteQuery();
    byte[] bFile = System.IO.File.ReadAllBytes(@"C:\largeFile.docx");
    FileCreationInformation file = new FileCreationInformation();
    file.Content = bFile;
    file.Url = "http://server:10000/sites/testSite/doclib/" +"test.docx";
    Microsoft.SharePoint.Client.File newFile = docLib.RootFolder.Files.Add(file);
    clientContext.Load(newFile);
    clientContext.ExecuteQuery();

    Fuentes:

    http://support.microsoft.com/kb/2529243

    http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx

    domingo, 22 de enero de 2012

    Sharing The Point–Argentina

    El día sábado (21/01/2012) participé del evento Sharing the Point en las oficinas de Microsoft, http://www.sharingthepoint.org/SitePages/Home2012.aspx

    Les dejo una foto con Michael Noel (el del traje, y escritor de Sharepoint 2010 Unleashed).

    405709_10150490446499147_675514146_8815233_198174312_n

    Columnas calculadas–formato de fechas (format of dates in SharePoint Calculated Columns)

     

    The regional settings of the site were set to English (Australia) – see screenshot below.

    SharePoint Regional Settings

    My calculated column was set up like so (formula and columns blurred out) -

    SharePoint Calculated Column

    SharePoint 2010 List View AJAX Options and Filter Web Parts

    Es posible con los OOB (OUT OF THE BOX) de listas y librerías. En la sección AJAX Options.

    La opción principal es la opción “Habilitar Actualización automática asincrónica”. El “intervalo de refresco automático” es el intervalo de tiempo en el que webpart se actualizará automáticamente.

    jueves, 19 de enero de 2012

    Convenciones de nombres Sharepoint 2010

    Web Applications

    Web Applications should be given a name that clearly reflects both the default URL and port number.

    Proposed pattern: {Host Header} – {Port}

    Example for a site with host header intranet.contoso.com, port 80:
    intranet.contoso.com – 80

    Service Applications

    The most straightforward way to name service applications is to use the same name as the service application type. You can see the names of the different service application types in the “New” dropdown button on Manage Service Applications in Central Administration.

    If more than one service application exists, just add a dash and an additional value that differentiates the service application.

    Examples:
    Excel Services Application
    Managed Metadata Service
    Secure Store Service

    Examples with more than one service application of the same type:
    Corporate level: Managed Metadata Service
    Department level: Managed Metadata Service – Sales Department

    martes, 17 de enero de 2012

    SharePoint 2010 Inline Editing

    Inline editing means we can edit and save the list item in the same line itself. You do not need to go to the editing page. In the same page view itself you will be able to edit the list item.

    Just like ASP.NET grid provides the way of edit and then update by clicking edit button and then updating the record.

    Well, now this was possible in MOSS 2007 as well, but it required little trick, but with SharePoint 2010, it is easy to do that.

    In order to enable in line editing, which isn’t enabled on lists by default, firstly modify the default view by going to List Tools -> List -> Modify View

    Modify View

    Modify View

    Then expand the Inline Editing option and select the ‘Allow inline editing‘ checkbox, then press OK to save the changes to the current view

    Inline Editing

    Now you have a new little icon on the far left side of the list view  as shown below, click on it and you can see the inline editing experience which is pretty cool actually!

    Inline editing in action

    Inline editing in action

    You can see that you have access to drop downs, text fielsd and related links. Unfortunately for calendar controls looks like you can only enter in a text date and that you can’t have links to look up lists but I am sure that this might change in the RTM version.

    Fuentes:

    http://www.sharepointanalysthq.com/

    http://www.c-sharpcorner.com/

    http://shafaqat309.wordpress.com/

    SharePoint 2010 SPGridView

    The SPGridView is similar to the asp GridView.  The SPGridView is derived from the aspGridView and has additional functionality.  The SPGridView does not support the property AutoGenerateColumns, you must specify each SPBoundField.

    If you didn’t know, you probably will soon, the SPGridView is not available in Sandboxed solutions.

    Example: SPBoundFields such as "BoundField" are used to display datasource columns.

    lunes, 16 de enero de 2012

    Working with URLs in SharePoint 2010 JavaScripts

    In SharePoint 2010 the SharePoint product team spent some time making a nice and decent JavaScript API (not just the ECMAScript Client Object Model stuff).

    Application Page links

    Many SharePoint solutions contains application pages (aka layout pages) that are used for different administrative tasks. A good approach is to open these application pages using the Modal Dialog Framework. To redirect the user to an application page using JavaScript or open a Modal Dialog box with an application page, you need to construct the URL in JavaScript. This is often done using string concatenation using the current site URL and application page URL - but here's a better way:

    You can use the SP.Utilities.Utility.getLayoutsPageUrl(pageName) method to get the correct URL to the application page. For instance like this.

    var layoutsUrl = SP.Utilities.Utility.getLayoutsPageUrl('DemoPage.aspx');
    var options = {
    title: "My Dialog",
    url: layoutsUrl
    }
    SP.UI.ModalDialog.showModalDialog(options);

    Using this method you will always get the correct application page URL to your page in the correct site. If you are using localized versions of the application page there is a localized equivalent of the method called SP.Utilities.Utility.getLocalizedLayoutsPageUrl(pageName) to use.


    MATERIAL DE APRENDIZAJE PARA DESARROLLADORES DE OFFICE 365

    365 presentaciones orientadas a desarrolladores, laboratorios y recursos asociados están disponibles en http://msdn.microsoft.com/es-ar/hh181605 .

    Como todo está instalado en línea el alumno puede focalizarse exclusivamente en lo que le interesa independizándose de cuestiones de infraestructura.

    También puede descargarse el material para trabajar Offline.

    Las unidades disponibles hoy son:

    1. Developing in the Cloud with Office 365
    2. Developing for SharePoint Online with Sandbox Solutions
    3. Building Workflow Solutions for SharePoint Online
    4. Developing SharePoint Online Solutions with the Client Object Model
    5. Leveraging Excel and Access Services in SharePoint Online
    6. SharePoint Online Branding
    7. Developing Communication Solutions for Lync Online
    8. Developing Messaging Solutions for Exchange Online

    Fuente: http://geeks.ms/blogs/mgrimberg/

    Powershell script to pre-download prerequisites Sharepoint 2010

    This script will download all files required by Prerequisiteinstaller.exe in advance, in order to support an 'offline' installation of SharePoint 2010 (that is, on a server without Internet connectivity, as is often the case). Normally it will attempt to download any missing files, which of course doesn't help you if your server can't browse the Internet. Thankfully, PrerequisiteInstaller.exe also accepts command-line switches to allow installation from a locally-accessible file for each respective hotfix/prerequisite.


    The script contains a list (current as of this writing) of the URLs for each prerequisite, and attempts to download them all in sequence.

    Descargar: http://gallery.technet.microsoft.com/bcf3332d-f726-4ac7-b01a-eeda4b7ece8e

    Sharepoint 2010 Diciembre Actualización (CU 2011-12)

    La actualización acumulativa 2011-12 (CU 2011-12) para Microsoft SharePoint Server 2010 es muy importante porque permite ver los informes de PerformancePoint y scorecards, informes de Excel Services y Reporting Services en dispositivos iPad .

    Se acaba de publicar un artículo en TechNet que proporciona más detalles sobre qué tipo de informes y scorecards funcionan en los dispositivos iPad, la forma de configurar el contenido de inteligencia de negocios para mostrar los mejores resultados, y cómo navegar por el contenido de dispositivos iPad. Consulte Visualización de informes y scorecards de los dispositivos iPad(http://technet.microsoft.com/library/hh697482.aspx)

    Microsoft Online Services Diagnostics and Logging (MOSDAL)

    Los diagnósticos de Microsoft Online Services y el Kit de herramientas de soporte de registro (MOSDAL) realiza diagnósticos de red y recopila información de registro para las aplicaciones que se utilizan para conectarse a la de Microsoft Business Productivity Online Standard Suite (seguridad-S) o a 365 de Microsoft Office, configuración de red y configuración del sistema. Los registros que genera la herramienta de proporcionan datos que ayuda a los profesionales de soporte técnico solucionar otros problemas relacionados con el servicio, red, instalación y configuración. El Kit de herramientas de soporte de MOSDAL recopila los archivos de registro, las claves del registro y opciones de configuración que requerirían mucho tiempo y esfuerzo colección mediante el uso de herramientas independientes.

    Descargar: http://www.microsoft.com/download/en/details.aspx?id=626&WT.mc_id=rss_office_365

    domingo, 15 de enero de 2012

    The transaction log for database 'SharePoint_Config' is full

    Scenario: Tried to change web application settings from Authentication Providers page from Central Administration

    Problem: Received the error "The transaction log for database 'SharePoint_Config' is full" when tried to save the updated settings.

    Resolution: Found that the drive that containing the config database log is having very few space remaining.

    Following steps helped to resolve this issue

    1. Do full backups of all the SharePoint databases.  

    2. Open the database, right click SharePoint Config database > Properties

    3. Select Simple under Recovery model list > Click OK

    4. Right click the database,  Tasks > Shrink > Files

    5. In File type select Log

    6. Click OK

    Refer to the following post for more information

    http://alstechtips.blogspot.com/2011_04_07_archive.html

    Fuente:

    http://sharepointserved.blogspot.com

    Error - Disco lleno SQL Server Sharepoint 2010

    Hace poco tuve un problema al subir un archivo a una Document lIbrary en Sharepoint 2010. Me lanzaba el siguiente error:

    error

    Me decia que la referencia al archivo es inválida.

    Revisando el log de errores, me di cuenta que estaba llena la partición de los archivos de datos del SQL Server, y por lo tanto no me permitía guardar el documento.

    SPUtility Sharepoint 2010

    It is a static object that contains a number of useful functions.Provides tools for converting date and time formats, for obtaining information from user names, for modifying access to sites, and for various other tasks in managing deployments of Microsoft SharePoint.

    Miembros:

    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility_members.aspx

    Algunas funciones útiles:

    To access the object, you need to add the following using statement:

    using Microsoft.SharePoint.Utilities;

    I had a quick go through the SDK, an the following are what strikes me as some of the more useful functions this object provides (note, I havent used all of these yet, just went through the SDK then googled the functions I thought sounded interesting):

    • SPUtility.FormatDate
      Allows you to format a given date to any of the SPDateFormat types

      DateTime curDate = DateTime.Now();
      DateTime regionDate = web.RegionalSettings.TimeZone.UTCToLocalTime(web.ParentWeb.RegionalSettings.TimeZone.LocalTimeToUTC(curDate));
      return Convert.ToDateTime(SPUtility.FormatDate(web, regionDate, SPDateFormat.ISO8601));

    • Get the 14-Hive filesystem path
      Returns the filesystem path for the 14-Hive, or any of the folders beneath it.  This is typically (though not always) going to be C:\Program Files\Common Files\Microsoft Shared\web server extensions\12

      //Get path to features directory
      //Would typically return "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES"
      string featurePath =SPUtility.GetGenericSetupPath("template\\features");

    • Get Full (absolute) URL
      Converts a relative Url into an absolute Url

      //Get url to list item
      SPListItem item = spList.Items[1];
      string itemUrl = SPUtility.GetFullUrl(spSite, item.Url);

    • Redirect to page
      Send a HTTP redirect to the client's browser

      //Redirect to specified page, adding querystring
      string url ="http://portal/TestResults/Pages/results.aspx";

      string queryString = "successflag=passed";
      SPUtility.Redirect(url, SPRedirectFlags.Default, Context, queryString);

    • Send email
      Lets you send an email from the context of the given SPWeb

      //Send email from current SPWeb
      SPWeb web = SPContext.Current.Site.OpenWeb();
      string subject = "Email from the " + web.Title + " web";
      string body = "The body of the email";

      SPUtility.SendEmail(web, false, false,"someone@somewhere.com", subject, body);

    • Transfer to SharePoint success/error page
      Allows you to transfer the browser to the ootb error and success pages

      //Transfer to Error Page
      SPUtility.TransferToErrorPage(ex.Message);

      //Transfer to success page, and specify url to move onto after "Ok" clicked
      SPUtility.TransferToSuccessPage("Operation was completed", @"/Docs/default.aspx", "", "");

    SharePoint 2010 Base Types, List Template y Definition IDs, y Content Types IDs

    A menudo necesitamos lista de los identificadores de los tipos base más comunes (Base Types), definiciones de lista y tipos de contenido. Especialmente útil si usted está escribiendo definiciones CAML de listas, o tipos de contenido. Aquí están las listas que he recogido de MSDN:

    Base Types

    Estos Base Types vienen del tipo enumerado SPBaseType

    image

    sábado, 14 de enero de 2012

    Top Browser statistics in SharePoint 2010 Web Analytics

    One of the reports is called Top Browsers and shows which web browser that the users are using to access the site. For a public facing web site this report might make sense but for an Intranet the results may cause you a headache if you do not understand how to interpret the data.

    Let's assume that you have an Intranet with a standardized web browser platform with Internet Explorer 8. If you take a look at the statistics you will first notice that the most used browser isInternet Explorer 7, following that are most often Unknown and/or Netscape4. Internet Explorer 8 is coming later down (together with instances of Safari, Firefox, Chrome etc. - some people just have disobey the corporate rules :-).

    Extendiendo una Web Application Sharepoint 2010 (Extending web application)

    Sharepoint permite exponer el mismo contenido a diferentes tipos de usuarios con diferentes URL´s y con diferente autentificatión. Esto es llamado “Extending a Web Application”.

    Ej: una compañia tiene un Web Site para usuarios internos. Los usuarios acceden al sitio usando una URL http://demo-intranet. Los usuarios internos usando Windows Authentication para acceder al sitio. Ahora necesitamos exponer el mismo contenido sobre una extranet usando otra URL como http://extranet-demo.com. Los usuarios externos accederán a la aplicación usando autentificación basadas en forms.

    Cada Web Application tiene un correspondiente  IIS Web Site. Cuando extendemos un Web Application a otro Web Application, se crea un IIS Web Site. Este extended Web Application usa la misma base de contenido usada por el Web Application original. Este nuevo sitio tiene su propio web.config pero no copia el contenido del original web.config dentro del nuevo.

    Entendiendo Farm, web application, sites collection, sites and subsites Sharepoint 2010

    1.A) SharePoint Farm

    A SharePoint farm is a group of front-end servers, applicative servers (Shared Services), indexing servers and database servers. A SharePoint farm can be deployed to a particular location according to objectives (Internet access, geographical localization, …).

    image

    1.B) Service applications

    This is a set of services that are available at farm level. Because of this, it is shared between the different web applications and site collections.

    These services are responsible of:

    • User Profile (profile properties, synch parameters)
    • Search (scopes, properties mappings, content sources, …)
    • Excel Services
    • Business Data Catalog

    image_thumb7

    Each service can be enabled or disabled on each SharePoint servers. This allows SharePoint infrastructure to be the most efficient and met security and availability requirements.

    2) Web Application

    There is nothing new for ITs or developers that already worked with sites or applications powered by ASP.NET, PHP or all server-side technologies. A web application characteristics are:

    • A site in IIS
    • A particular url
    • A authentication method associated with this web application

    image

    We can notice that a web application uses its own database in a SharePoint context (to be more precise, it is the case for new application. There is the possibility to create Web Applications extensions. These extensions can use different parameters that the main web application. We will use this when we want to share data between web applications and use different authentication modes for example).

    Furthermore, SharePoint is an ASP.NET application so it uses Web.config files. We will be able to add differents entries according to the objectives of the web application. We will remove some features if the web application is used by partners for example.

    Finally, a web application is always associated with a SSP.

    3) Sites Collection

    A sites collection is a virtual container (there is no physical file as it is the case for previously described elements) and sites collection structure is stored in a configuration database.

    Form an IT point of view, sites collection has some advantages. The main advantages are:

    • Content quota templates
    • Ease of maintenance (backup / restore is performed by site collection by default)

    image_thumb15

    From a content manager point of view, we will notice that an administrator is defined each site collection. This administrator can manage:

    • Second level Recycle bin
    • Customized search
    • Users of the site collection

    Lastly, site collections is used to bring customized elements together and shared them with a audience that will access data across this sites collection (per example a department):

    • Master Pages
    • Images
    • Sites and lists Templates
    • Web parts

    There is always a root site in a site collection.

    image_thumb22

    4) Sites and subsites

    In the beginning of this post, we told a lot of time of IT guys, a little bit about developers but I didn’t told about about end users even though they are the driving force of SharePoint content.

    At this level, everything is related to content management. According to the users permissions, they can:

    • Create sites
    • Create lists
    • Attach workflow to lists
    • Grant permissions
    • Restore deleted content
    • A lot of others operations!

    At this level, there is only one important thing to manage and organize data: company best practices and rules. It doesn’t matter where data are logically based, it will be physically stored in the same database. However, data should be spread all around sites and sub-sites. Do not hesitate to use important feature as permissions inheritance. It will help to organize data efficiently.

    image

    It is possible to add some code or reporting tools but the most important thing is the end-user and power-user training.

    Here is a SharePoint structure example:

    • Farm
      • Web Application 1
        • Sites collection A (with top-level site)
          • Site A.1
            • Site A.1.1
            • Site A.1.2
          • Site A.2
        • Sites collection B (with top-level site)
          • Site B.1
            • Site B.1.1
              • Site B.1.1.1
          • Site B.2
      • Web Application 2
        • Sites collection C (with top-level site)
          • […]
        • Sites collection D (with top-level site)
          • […]

    Fuentes:

    http://didierdanse.net/blogs/dev_en/

    SharePoint 2010 Licencias

    SharePoint 2010 supports intranet, extranet, and Internet applications from a single, integrated platform. The specific licenses you need depend on three factors: what capabilities are used, how SharePoint is deployed, and where the system is hosted.

    The following information provides details about buying and licensing SharePoint for your company. The links below also provide more information:

    Mejores Prácticas Sharepoint 2010 (Artículo 2)

    Best Practices for SharePoint Server 2010

    Este post es una continuación del siguiente: http://todosharepoint.blogspot.com/2012/01/mejores-practicas-sharepoint-2010.html

    Team collaboration

    1. Plan and allocate database servers to support collaboration
    2. Monitor sites and content, and perform cleanups regularly
    3. Enforce site and content size limits
    4. Manage security and permissions
    5. Read details and more best practices >

    My Sites

    1. Use My Sites to promote social networking and enterprise collaboration
    2. Deploy My Site farms based on the geographical distribution of your workforce
    3. Plan for improved performance
    4. Isolate My Sites in a dedicated Web application
    5. Read details and more best practices >

     

    Mejores Prácticas Sharepoint 2010 (Artículo 1)

    Best Practices for SharePoint Server 2010

    Operational excellence
    1. Use lots of memory and fast network adapters
    2. Stay close: Do not put too much network distance between front-end Web servers, application servers, and database servers
    3. Consider performance and availability when you configure Web servers and application servers
    4. Consider performance and availability when you configure database servers
    5. Read details and more best practices >
    Virtualization
    1. Use hardware-assisted virtualization
    2. Enable hyper-threading on processors that support this technology
    3. Configure Non-Uniform Memory Access correctly
    4. Configure the Hyper-V host for optimal performance
    5. Read details and more best practices >

    viernes, 13 de enero de 2012

    Procesos Sharepoint 2010

    • w3wp.exe: este es sin duda el más conocido. Nos adjuntaremos a él para depurar la mayoría de los desarrollos de SharePoint en modo Farm: Webparts, Manejadores de eventos, Workflows…
    • owstimer.exe: este es el encargado de los Timers de SharePoint. Nos adjuntaremos a él para depurar nuestros jobs de SharePoint personalizados. “The SharePoint Timer Service (owstimer.exe) is a Windows service. Services in Windows must be created in a Windows Service application project or another .NET Framework–enabled project that creates an .exe file when built and inherits from the ServiceBase class. The owstimer.exe was likely compiled using unmanaged code that runs outside the Common Language Runtime (CLR), but has code that starts the CLR automatically by using the mscoree.dll when the .exe is executed.
    • spucworkerprocess.exe: en este proceso corren nuestras soluciones sandbox, así que nos debemos adjuntar para depurar nuestros desarrollos sandbox y por lo tanto, todo lo que queramos subir a Office 365

    Si estás preguntando para qué sirve el proceso spucworkerprocessproxy.exe, es el encargado de recibir las peticiones del spucworkerprocess.exe y ejecutar las llamadas al modelo de objetos completo de SharePoint

    Fuentes:

    http://geeks.ms/blogs/lmanez/ ; http://www.the14folder.com/ ; http://aelena.com/blog/?p=68

    Más información:

    Debugging Custom SharePoint Timer Jobs (http://www.codeproject.com/KB/sharepoint/debugging-sharepointjobs.aspx)

    http://msdn.microsoft.com/en-us/library/ff798310.aspx

    Event Receivers in SharePoint 2010 (Asincrónicos): http://www.chakkaradeep.com/post/Event-Receivers-in-SharePoint-2010.aspx

    What's New SharePoint Development in Visual Studio 11 Developer Preview

    The SharePoint developer tools in Visual Studio 11 Developer Preview contain new designers and templates to facilitate SharePoint development, as well as new options for deploying and testing SharePoint sites. See the following descriptions to learn about these and other new features.

    This topic contains the following sections.

    • Create Lists and Content Types by Using New Designers
    • Create Site Columns
    • Create Silverlight Web Parts
    • Publish SharePoint Solutions to Remote SharePoint Servers
    • Test SharePoint Performance by Using Profiling Tools
    • Create Sandboxed Visual Web Parts
    • Improved Support for Sandboxed Solutions.
    • Support for JavaScript Debugging and IntelliSense for JavaScript
    • Streamlined SharePoint Project Templates

    Diferencias de Features Sharepoint 2007-2010

     

    SP 2007 Object Model Vs SP 2010 Client Object

    In Sharepoint Object model there are two Important namespaces.

    In SharePoint 2007 – The Microsoft.Office.Server namespace is the root namespace of all Office Server objects and Microsoft.SharePoint is the root namespace for all WSS objects.

    Hive :

    In SharePoint 2007 – It has “12 hive” structure where all SharePoint resources are deployed.

    In SharePoint 2010 – Microsoft has apparently added three new folders to its hive and calling it as “14 Hive”
    * UserCode – files used to support sandboxed solutions
    * WebClients – used for the client Object Model
    * WebServices – New .svc files

    Foundation :

    SharePoint 2007 : Wss 3.0 was required for accessing all common SharePoint API’s

    SharePoint 2010 : SharePoint Foundation 2010 is required to provide base API’s.

    API’s :

    SharePoint 2007 : No API was available for Code to Interact with SharePoint site through Client side scripts (side Note : You can do it by calling Sharepoint web services using javascript )

    SharePoint 2010 : MS has introduced Microsoft.SharePoint.Client namespace that enable you to interact with SharePoint sites through scripts that run in the browser from Microsoft .NET Framework managed code, and inside Microsoft Silverlight applications.

    Parámetros query string que no deberías usar con tus aplicaciones Sharepoint

    Al crear el objeto SPContext de SharePoint evalúa los siguientes parámetros de consulta:

    • FeatureId
    • ListTemplate
    • List
    • ID (con números funciona bien)
    • VersionNo
    • ContentTypeId
    • RootFolder
    • View
    • FolderCTID
    • Mode
    • Type
    • PageVersion
    • IsDlg
    • Title
    • _V3List_

    Para asegurarse de que la creación del objeto SPContext no falle, la aplicación debe asegurarse de que los parámetros de cadena de consulta son diferentes de las mencionadas anteriormente.

    Web Application Scoped Resources

     

    When you try to deploy a solution without Web Application Scoped Resources, you will get the following errors:

    The solution contains no Web application scoped resource, and therefore cannot be deployed to a particular Web application. It can only be deployed globally.

    If you like to deploy the solution to a web application, you need to set the Assembly Deployment Target to WebApplication instead of GlobalAssemblyCache. You can download a deployment script here.

    jueves, 12 de enero de 2012

    Alertas custom Sharepoint 2010

    Custom Alerts in Sharepoint 2010

    Alerts are automated emails generated by Sharepoint when something changes (a list item for example) and if any user has created an alert for that particular change in the list item.


    In some scenarios, we may want to customize the alert email generated by the Sharepoint 2010. This can be done in two ways


    1. Altering the OOTB alert template xml to use whatever the text you would like to have in the alert email
    2. Adding a custom alert handler in the dll deployed to GAC and alter the alert template xml to make use of that


    I personally prefer the second method since we (programmers) have more control over the email subject and body and I find it little complex to achieve my particular situation (altering the default url to link the edited/changed item).

    Obtener el número de todos los sitios web de SharePoint en una aplicación Web

    This script opens an SPWebApplication object for the given url, retrieves the Site Collections, and counts the webs in each.

    PowerShell

    $webappUrl = "http://localhost"  $webapp = Get-SPWebApplication $webappUrl  $allWebsCount = 0  $webapp.Sites | % { $allWebsCount += $_.AllWebs.Count; $_.Dispose(); }    Write-Host "There are" $allWebsCount "webs" -ForegroundColor Green

    Assumptions

    The script assumes the following:



    • you are either using the SharePoint Management Shell or have imported the Microsoft.SharePoint.PowerShell snapin



    • you are running on the SharePoint Server



    • you have administrative access to the web application, site collection, and webs


     

    Fuente: http://gallery.technet.microsoft.com/scriptcenter/

    martes, 10 de enero de 2012

    PSConfig.exe – Central administration

    One of most important part of SharePoint setup is understanding the role of PSConfig.exe.

    It is located at %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\14\bin

    PSConfig.exe is an alternative interface to perform several operations that control how SharePoint 2010 Products are configured.

    This is useful when you want to make changes related to Central Admin site like:

    • Changing authentication
    • Re provisioning of central admin site from one server to another
    • You deleted site from IIS accidentally or screwed up in some other way

    as a simple solution open the command prompt and navigate to path above and give following command.

    > psconfig.exe -cmd adminvs -provision -port 42706 -WindowsAuthProvider OnlyUseNTLM

    And its done. you will see new central admin site with port 42706 with default ntlm authentication.

    You can find more details at : http://technet.microsoft.com/en-us/library/cc263093.aspx

    Alternate to use PSConfig is obvious PowerShell.

    “adminvs -provision” is now replaced with “New-SPCentralAdministration”  in PowerShell.

    So new command will be

    New-SPCentralAdministration -Port 42706 -WindowsAuthProvider “NTLM”

     

    More you can with con PSConfig:

    • Provision the Services (handy in case of unresolvable service application errors)
    • Provision the Central Administration (handy in case of unresolvable CA errors)
    • Resume a failed upgrade
    • Repair SharePoint 2010 installations

    Fuentes:

    http://www.thesharepointblog.net/

    http://angler.wordpress.com/

    Más información:

    lunes, 9 de enero de 2012

    Habilitar /Deshabilitar Developer Dashboard in SharePoint 2010

    Enabling/ Disabling Developer Dashboard in SharePoint 2010

    ¿Qué información podemos encontrar al hacer uso de esta herramienta?

    • Tiempo de ejecución de subprocesos
    • Número, duración, información de la pila de llamadas y texto de la consulta, para cada consulta de SQL Server procesada en la página
    • URL y nombre del trabajo del temporizador
    • Usuario actual
    • Tiempo de inicio de la ejecución

    Existen diversos modos para mostrar el SharePoint Developer Dashboard

    1. ON .- Cuando tenemos este modo habilitado, el Dashboard se puede “ver” en todas las páginas que muestren la página maestra por defecto . NO RECOMENDADO
    2. ONDEMAND .- Cuando hemos habilitado este modo, se nos muestra un icono en la esquina superior derecha de la página. Este icono permite al usuario activar o desactivar el Dashboard. RECOMENDADO
    3. OFF .- es la default

    SharePoint Global Resource (resx) file locations

    Los archivos Global resource (resx) son almacenados en la siguiente dirección en SharePoint 2010:

    • App_GlobalResources folder in the VirtualDirectories folder in inetpub (e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\80)
    • Resources folder in the 14 hive (e.g. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Resources)
    • Config/Resources folder in the 14 hive (e.g. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\Resources)

    En general, un archivo resx en su solución debe ser copiado en cada uno de estos lugares durante la instalación. Esta es la forma en que se utilizan:

    • Los archivos de recursos en App_GlobalResources se utilizan cuando el código en una página ASPX se refiere a un recurso, por ejemplo,

    <asp:Label ID="lblNumberingTitle" runat="server" Text="<%$Resources:GlobalSiteResources, AutoNameTitle %>"/>

    • Los archivos de recursos en la carpeta Resources se utilizan para hacer referencia a los recursos mediante el modelo de objetos de SharePoint, por ejemplo,


    btnExport.Text = SPUtility.GetLocalizedString("$Resources:GlobalSiteResources, Tab_Export","GloablSiteResources", language);

    • Los archivos de recursos en Config/Resources se copian en la carpeta App_GlobalResources cada vez que una nueva aplicación web se ha creado. Al añadir los archivos resx aquí, usted se asegurará que la aplicación va a ser capaz de acceder a sus archivos de recursos globales en nuevas aplicaciones web.

    Error al iniciar la consola de PowerShell de SharePoint 2010

    El siguiente error puede ocurrir al iniciar la consola de PowerShell de SharePoint 2010:

        "No se puede tener acceso al conjunto de servidores local. No se registraron cmdlets con FeatureDependencyId"

    En ingles:

        "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered."

    Para solucionar el problema es necesario darle derechos de DB_owner en la Base de Datos de Configuración de SharePoint a la cuenta que se está utilizando para ejecutar a PowerShell.

    basta con abrir el SQL Server Management Studio –> Security –> Logins, seleccionar el usuario, pinchar sobre User Mapping y seleccionar la base de datos SharePoint_Config y seleccionar el rol SharePoint_Shell_Access

    image

    image

    Algunas cosas más para considerar si no lo solucionas con la opción de arriba:

    • Ejecutar la Management Shell como administrador

    domingo, 8 de enero de 2012

    Event Handler in SharePoint 2010

    Consider a scenario where document is added to the document library after an important meeting (e.g., a minutes-of-the-meeting document), then all the team members want tasks assignment later and may want to use this newly created task list.

    In this tip, you will learn how to use the SharePoint 2010 event handler, namely "ItemAdded," to make sure that a SharePoint "Task List" is automatically created whenever a document of type "MS Word" is added to a document library. This will make sure the users can later use this task list to allocate tasks among the team member's whenever they like.

    SharePoint Dispose Checker Tool

     

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

    SPDisposeCheck es una herramienta que ayuda a los desarrolladores y administradores a comprobar soluciones custom de SharePoint que utilizan el modelo de objetos SharePoint para que cumplan con las mejores prácticas de dispose de objetos. Esta herramienta no puede mostrar todos los memory leaks en el código y puede generar falsos positivos que necesitan revisión por parte nuestra.

    Installation

    During installation you can choose to integrate SPDisposeCheck into Visual Studio 2008 or 2010. It’s still a command line utility and is called by the Visual Studio Add-In. Supported SharePoint installations are:

    • SharePoint Server 2010
    • SharePoint Foundation 2010
    • Microsoft Office SharePoint Server 2007
    • Windows SharePoint Services 3.0

    image 

    image (1)

    Mover el directorio de logs de Sharepoint

    For production SharePoint 2010 servers, the C drive should be at least 80 GB.

    When I do SharePoint 2010 installs I always recommend to my customers that they have a secondary drive. That drive serves a few purposes, and one of them is to serve as a place to store stuff you can move off of your C drive. SharePoint’s logs are a great candidate for that.

    There are two sets of logs you want to move, the diagnostic logs and the usage logs. An important note is that every machine in the farm must have the same paths for this to work. If one doesn’t have a D drive or something SharePoint will freak out.

    Topología Sharepoint 2010

    Este post explica brevemente los diferentes topologías de granja de SharePoint 2010 y explica los roles involucrados en esa topología. SharePoint 2010 se puede implementar en un solo servidor o varios servidores. Los roles involucrados en SharePoint 2010 de granja son:

    • Web server role
    • Application server role
    • Database server role

    En pequeñas granjas típicamente estos roles pueden estar en un uno o dos servidores.

    Web server role:

    1. Aloja las páginas web, servicios web y web parts para procesar las solicitudes.
    2. Pasa las peticiones a los servidores de aplicación adecuados.

     

    Servicio online para convertir SharePoint CAML Queries a C#

     

    Impulsado por su proyecto de CodePlex - Camlex.NET(http://camlex.codeplex.com), Alexey Sadomov y Timashkov Vladimir ha lanzado un servicio online gratuito para convertir sus cadenas de consulta CAML en código C #.Todo lo que tienes que hacer es escribir CAML y te convierte a  expresiones lambda  de C#:

    Ejemplo, escribiendo esta consulta CAML:

    <Query>
    <Where>
    <And>
    <Eq>
    <FieldRef Name="ID" />
    <Value Type="Integer">1</Value>
    </Eq>
    <Eq>
    <FieldRef Name="Title" />
    <Value Type="Text">Hello world</Value>
    </Eq>
    </And>
    </Where>
    </Query>


    Usted recibe este código:

    Camlex.Query().Where(x => (int)x["ID"] == 1 && (string)x["Title"] == "Hello world")


    El enlace con el servicio gratuito es: http://camlex-online.org/
    Mi herramienta favorita para generar la consulta CAML en sí sigue siendo el Generador de consultas CAML de U2Uque puede ser utilizado tanto en SharePoint 2007 y 2010:http://www.u2u.net/Tools/wincamlquerybuilder/CamlQueryBuilder.

    Configurar el Rating de items para Sharepoint 2010

    Lo primero es verificar que el servicio “User Profile Service” este iniciado en todos los servidores web de la granja, esto es muy importante en ambientes multiservidor.

    image

    El siguiente paso es verificar la periodicidad de la ejecución de los siguientes jobs en el temporizador, de forma predeterminada están para ejecutarse cada hora, si los usuarios requieren un refresco mas rápido de sus votaciones (calificaciones), usted debe ajustar este tiempo de ejecución en ambos jobs procurando dejar los mismos intervalos de tiempo para ambos jobs.

    image

    Acceso anónimo a DocIdRedir.aspx en SharePoint 2010

    El servicio de identificación de documentos (Document ID service ) en SharePoint 2010 permite proporcionar un enlace permanente a los documentos mediante la asignación de un identificador único para cada documento.
    Los documentos estarán disponibles en una URL como esta:

    http://localhost/_layouts/DocIdRedir.aspx?ID=P46NTRUENZ26-213-1

    DocIdRedir.aspx takes care of this by looking up the document using the ID querystring parameter. It also takes care of the error handling in case you provide an invalid document id.

    DocIdRedir.aspx se encarga de buscar el documento utilizando el parámetro de consulta ID. También se ocupa de la gestión de errores en caso de que proporcionar un documento de identidad inválido.

    Uno de los problemas ... DocIdRedir.aspx no es de acceso anónimo. ¿Qué pasa si usted desea hacer documentos descargables a través de un enlace permanente en un sitio web público?
    A continuación una versión accesible de forma anónima DocIdRedir.aspx:

    Agregar referencia a Microsoft.Office.DocumentManagement.Pages

    Esta dll tipicamente se encuentra en C:\inetpub\wwwroot\wss\VirtualDirectories\\_app_bin, no en la que estamos acostumbrados a encontrar los otros archivos DLL de SharePoint.
    Puedo añadir este archivo DLL en una carpeta lib en mi proyecto y de referencia a partir de ahí.

    SharePoint 2010 Search Engine Optimization (SEO) Consejos

     

    • Utilice nombres de sitios significativos ynombres de páginas para crear URLS "amigables”.

    Piense en estos ejemplos:

    http://foo.com/nodes/123
    http://foo.com/blog/sharepoint-2010-search-engine-optimization-seo-tips/
    http://foo.com/blog/sharepoint2010/seo/tips/


    ¿Cuál sería más probable de obtener más tráfico? Definitivamente no será la primera. ¿Y el segundo y el tercero? La mayoría de las veces la segunda conseguirá más tráfico, en función de las palabras clave. Páginas con una URL muy profunda (sites1/sites2/sites3/sites4/page1.html) es poco probable que obtenga una mejor clasificación. En SharePoint 2010, es necesario planificar cuidadosamente la infraestructura del sitio y los nombres de página para que pueda ser más significativa para los rastreadores y los usuarios.

    • Mejores títulos de páginas

    Por ejemplo,"Untitled", "New-Page-1" no tiene sentido. Incluso si se puede mostrar en el resultado, es probable que muy pocas personas hagan clic en él.