CAML XML Editor

- 1 min read

My last project has changed of name, I believe that CAML XML EDITOR will be called.

Join to workspaces.gotdotnet.com/CAMLEditor

camlxmleditor.gif

At the moment he is a simple XML editor that allows simultaneously to publish the code by fragments (use the context menu in editor) that can are validated themselves. Also has a HTML preview to show the HTML code generated.

camlxmleditor.gif

And a little CAML generator, you can select any CAML then you has the correct XML, if you select a reference in the XML you can expand it using the context menu.

Caml Editor

- 3 mins read

Para la mayoría de los que trabajamos con SharePoint, el personalizar listas, sitios o áreas usando CAML, seré suave, es un INFIERNO, pero para bien o para mal vamos a tener que convivir con el.

No quiero entrar en detalles acerca de lo bueno o malo, de lo dificultoso o no que pueda llegar a ser, por que como ya he dicho antes hay que convivir con el. Así que he pensado en ser más tolerante y tratar de solucionar los problemas en la medida de lo posible.

XSL Namespaces

- 1 min read

With csegRollUp v3 you can use both namespaces in the xml stylesheet.

This example use msxsl namespace with a c# script function to transform a date in a month name:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
     xmlns:msxsl="urn:schemas-microsoft-com:xslt"
     xmlns:utils="urn:script-items">
 
<msxsl:script language="C#" implements-prefix="utils">
     <![CDATA[
     public string GetMonth(string sDate)
     {      
        if (sDate.Length > 0)
            {
           string[] monthNames = {null , "January" , "February" , "March" , "April", "May",
                      "June", "July", "August", "September", "October",
                      "November", "December"};
 
           DateTime d = DateTime.Parse(sDate);
           return monthNames[d.Month];
        }
        else 
            return "(Empty)";
     }
     ]]>
</msxsl:script>
 
<xsl:output method="html" encoding="utf-8" />
 
<xsl:template match="/Rows/Row">
    <li/><b><xsl:value-of select="Title" /></b><xsl:value-of select="utils:GetMonth(Fecha)" /><br/>
</xsl:template>
 
</xsl:stylesheet> 

Link with more info XSLT Stylesheet Scripting using msxsl:script

Multiple Templates

- 2 mins read

I have a site with some document libraries to store documentation based in multiple templates, to save each template in the correct folder, I have created a custom list thats contains the name of the template, the template and the folder where documents created with this tempalte must be stored.

Name – text – Template name

Template – hyperlink – The link to the template file

Folder – text – Folder where the document must be stored (site based path)

csegRollUp v3 out

- 2 mins read

Finally csegRollUp v3 is here, first I want to give to thanks to all beta testers and and special thanks to Florian Rossmark and Dor Rotman.

  • Lists – As in previous versions, List of comma delimited values that signify the sites and lists Format: /site/subsite:ListName, /site/subsite/subsite:ListName

  • Fields – As in previous versions, List of comma delimited values with the field names Format: Title,Text,Comment,User

  • Include List Data (new) – If enabled the result xml data contains special fields

csegRollUp v3 rc1

- 2 mins read

I am finishing csegRollUp v3, at the moment some examples….

1.- Using csegRollUp cell consumer interface.

Show all documents inside of a document library where Title contains data provider from other webpart.

Lists: Shared Documents Fields: ID, LinkFilename,EncodedAbsUrl,Modified,DocIcon,FileRef,Author,Title

CAML query

<Where>
   <Contains>
      <FieldRef Name='Title' />
      <Value Type='Text'>[CellProvider]</Value>
   </Contains>
</Where>

Recursive: enabled

XSLT

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="html" />
   <xsl:template match="/">
      <table class="ms-summarycustombody">
         <tbody>
            <xsl:for-each select="Rows/Row">
               <xsl:sort select="Modified" order="descending" />
               <tr>
                    <td>
                       <img src="/_layouts/images/ic{DocIcon}.gif" />
                    </td>
   
                    <td width="75%">
                       <a href="{EncodedAbsUrl}">
                          <xsl:value-of select="LinkFilename" />
                       </a>
                    </td>
                 </tr>
              </xsl:for-each>
           </tbody>
        </table>
     </xsl:template>
  </xsl:stylesheet>

2.- Using csegRollUp cell provider interface

Bloqueando campos

- 2 mins read

Hace unos días necesitaba bloquear un campo en una lista de sharepoint, esto se puede hacer modificando las páginas newform.aspx y editform.aspx y añadiendo un pequeño script.

<script defer>
    // tomar el campo y bloquearlo
    var fld_anotacion = frm.FieldPost(frm.FindField("Anotaci_x00f3_n"));
    fld_anotacion.readOnly = true;
    // poner el foco en el campo descripcion
    frm.FindField("Descripci_x00f3_n").FieldFocus();
</script>

En este caso en concreto, el campo bloqueado se rellena desde un nuevo formulario (una copia de editform.aspx que he modificado para albergar una nueva zona de webparts y dentro de esta he añadido un data viewer webpart) este formulario se utiliza para rellenar el campo que con los formularios iniciales se encuentra bloqueado.

Google Sharepoint

- 6 mins read

Al igual que otros usuarios de SharePoint, en su día me encontré con la limitación que tienen las búsquedas de SharePoint. Por ello desarrolle el csegSearchWebPart, añadiendo funcionalidad extra a las búsquedas del portal.

Como referencia tome Google, ya que es considerado “el mejor buscador del mundo”.

Estos días he pensando en ello, y he llegado algunas conclusiones interesantes.

Goggle tiene tres grandes rasgos que otros buscadores no tienen:

  • Cantidad de documentos indexados. (8.000 millones)
  • Flexibilidad en las búsquedas.
  • Motor de indexación / búsqueda distribuido.

Y un gran característica que lo diferencia de los demás buscadores

SPQuery and Recurrence

- 2 mins read

This last long weekend I’m playing with spqery to show recurrent events from one of my lists after spent too many hours and the only think I have got are frustrations.

The query.ViewAttributes, with RecurrenceRowset=’TRUE’ or with ModerationType=’Moderator’ modifiers are ignored totally.

My sample query for recurrence without results : (RecurrenceRowset=’TRUE’)

<Where>
  <DateRangesOverlap>
    <FieldRef Name=”EventDate” />
    <FieldRef Name=”EndDate” />
    <FieldRef Name=”RecurrenceID” />
    <Value Type=”DateTime”>
      <Now />
    </Value>
  </DateRangesOverlap>
</Where>
``

Today trying get the pending documents: (ModerationType=’Moderator’)

```xml	
<Where>
  <Eq>
    <FieldRef Name=”_ModerationStatus” />
    <Value Type=”Integer”>0</Value>
  </Eq>
</Where>

After read the wsssdk, there is only a example with “ModerationType” is in “SPModerationInformation” class

csegRollUp v3

- 2 mins read

csegRollUp v3

  • Include List Data flag, if you enable the checkbox the xml data will include the underscore data

(_ListTitle, _ListUrl, _SiteTitle, _SiteUrl, _ItemId, _ItemUrl, _ItemEdit)

  • Queries

    • CAML Query you can use a caml query to search on each list.
    • RowLimit – maximun number of rows to return
    • Recursive - the query recursive be made (great for Document Libraries)
    • DebugQuery – show the xml from the query

    Special values that you can use on queries: