Sharepoint Unit Testing

- 7 mins read

Como sabéis tanto Gustavo como yo llevamos tiempo realizando pruebas sobre lo que programamos en SharePoint, ambos estamos usando TypeMock como framework para nuestros objetos Mocks que son imprescindibles a la hora de realizar pruebas para SharePoint.

Durante los últimos meses hemos posteado sobre el tema, hemos iniciado un proyecto en CodePlex con un conjunto de clases envoltorio que pueden ayudarnos a la hora de realizar las pruebas con TypeMock y que está a un tris de quedarse obsoleto.

csegRollUp 3.0

- 1 min read

We have prepared the new SPSRollUp v3 in few days.

  • Improved performance
  • Now there is not necessary to apply changes twice.
  • New Xslt functions. Added FormatIsoDate, LookupValue, LookupId, Replace, RootWebUrl, SourceParam, UrlParam, XmlDecode (more information in SPSNamespace functions)
  • New View Lists and View Fields options to show crawled lists and fields.

Now there are two options in the configuration properties that will show a popup with the information about collected lists and fields.

Unit Testing

- 10 mins read

Aquí continúa el drama de Unit Test para SharePoint. Esta vez hemos reunido esfuerzos entre nosotros, Carlos Segura (http://www.ideseg.com ) y Gustavo Velez (http://www.gavd.net ), para intentar sacar algo en claro. Programadores del mundo de SharePoint, uníos! …

Unit Test, SharePoint y que es lo importante:

Testeo Unitario es una técnica de programación que permite asegurar que lo que se ha programado hoy cumple las condiciones exigidas, y que las seguirá cumpliendo en el futuro, cuando se hagan modificaciones en el código fuente. Existe numerosa información al respecto, tanto en libros de texto como en internet, así que no repetiremos las bases de la técnica; en resumen, es deseable que se cumplan algunas condiciones:

SPSRollUp Dropdown Recipe

- 2 mins read

In a blank page insert two SPSRollUp webparts.

Edit the properties in the first webpart and select any list, in the fields property write “Title”

In the XSL paste the next snippet; This snippet fills a drop down box with the titles of all crawled data

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" 
                xmlns:xsl="<http://www.w3.org/1999/XSL/Transform>" 
                xmlns:sps="<http://schemas.spsprofessional.com/WebParts/SPSXSLT>" 
                exclude-result-prefixes="sps">
  <xsl:output method="html" />
  <xsl:param name="CurrentRow" />
  <xsl:template match="/">
    <script type="text/javascript">
function combo_onchange(oSelect)
{
 if(oSelect.selectedIndex != -1)
 {
  var selected = oSelect.options[oSelect.selectedIndex].value;
  <xsl:value-of select="sps:EventJS('Select','selected')" />
  }
}
    </script>
    Select a value
    <select id="a1" name="combo" onchange="javascript:combo_onchange(this);" class="ms-input">
    <option value="" />
    <xsl:for-each select="Rows/Row">
       <xsl:sort select="Title" />
       <xsl:element name="option">
         <xsl:attribute name="value">
            <xsl:value-of select="_RowNumber" />
         </xsl:attribute>
         <xsl:if test="_RowNumber=$CurrentRow">
            <xsl:attribute name="selected" />
         </xsl:if>
         <xsl:value-of select="Title" />
      </xsl:element>
    </xsl:for-each>
  </select>
 </xsl:template>
</xsl:stylesheet>

When a value is selected the JavaScript embedded in the XSL “combo_onchange” send the selected value using the row provider interface.

SPSCopyMove WebPart

- 1 min read

This are the preliminary screenshots of SPSListCopyMove WebPart, this webpart permits move and copy list items in a SharePoint List. In the webpart properties you only need specify the list and the view that you want show in the webpart.

You can view a navigation tree, to navigate to any list folder quickly, and the list view that you has selected in the properties.

In the context menu of the items that are showed in the view there are two new options, one to copy the item to another folder in the same list and another to move the item.

CAS Policies

- 3 mins read

Muchos de los desarrolladores de SharePoint, terminan optando por desplegar sus aplicaciones en el GAC, para evitar problemas de seguridad. Esta no es la manera más correcta y cada vez más administradores de sistemas, exigen que las soluciones se desplieguen en los directorios de aplicación.

Los ensamblados que se ejecutan desde el GAC, se ejecutan bajo total confianza (Full Trust) y están disponibles para todos los servidores virtuales y todas las aplicaciones, lo cual termina siendo menos seguro si desconocemos la procedencia del ensamblado, cosa que ocurre con frecuencia.

SPSRollUp 2.0 Beta

- 2 mins read

We are developing an application for a customer using SPSRollUp (Beta 2), our customer want a site with some features that seem like BaseCamp site, BaseCamp is a well know Project Management web application.

Using SPSRollUp our customer can aggregate data from sub-projects and show all tasks status in an only view. But he want a special view that he likes specially, this view show pending tasks whit delayed days and coming tasks with the remaining days.

Hace algún tiempo comente un plan de mantenimiento para las bases de datos de SharePoint 2003, básicamente para SharePoint 2007 los pasos son los mismos, solo que las bases de datos a tener en cuenta son otras.

Tanto en MOSS como en WSS encontraremos las siguientes bases de datos:

WSS_Content_GUID

Esta base de datos contiene los datos de una aplicación web y las colecciones de sitios de dicha aplicación web. Todos los datos de las listas y los documentos de los sitios son almacenados en esta base de datos, en función del movimiento de esta deberemos de tener un plan de mantenimiento para la misma. Importante.

You can replace texts with custom images using the XSL. First you need load the desired images in the /_layouts/images of your server, after load you can use this images from XSL. Here is a little sample where the status of the tasks are replaced with flag images.

The XSL is the same used in the Task Status example, where we are add a xsl:choose in order to select the image:

This is only a sample to show how we can use SPSRollUp to show the pending tasks from a list.

Select a Task list in the SPSRollUp properties, and select fields Title,DueDate and Status, check the include list data to get the url where you can edit the task item.

Below there are some CAML queries that you can use to filter the results and show only the pending tasks or the tasks for the current logged user.