Home RSS 2.0 ATOM 1.0  CDF  
 
CodeSegment - Carlos Segura Sanz (blog)
 
Page 1 of 2 in the csegRollUp category Next Page

It returns, the best Roll Up of contents for Share Point, of the hand of SPSProfessional. Sure it sounds you a lot.


And besides now it does pretty graphics.


 

More information in www.spsprofessional.com

 

Monday, May 05, 2008 5:56:24 PM (Hora de verano romance, UTC+02:00)   #    Comments [0]   csegRollUp | SharePoint  | 


Important NOTE: Only works in Windows Sharepoint Services 2.0 and SPS2003

Finally is here, many thanks to the people who have tested this version.

From the forums:

"I had rolled back to 3.1a with 22 individual imported spreadsheet lists rolling up to 22 individual web part pages; with 3 additional web part pages rolling up some specified fields from all 22 lists."

ALL 25 Rollups where present, accounted for and functioning as expected under 3.5 FINAL's smooth control. Very, Very Smooth Transition


Now can rollup with 3.5 Final for the first time again. This is truly a powerful and extremely useful enhancement to SharePoint. Thank You.

There is no new great improvements by compatibility reasons with previous versions, but there are some important changes.

* Now you can use fields that are not in all lists, you can use deferent lists and rollup if this contains the same specified fields.

* There are two new variables for use in the queries
[Now] - Replace with the current date-time in iso 8601 format
[SNow] - Replace with the current date-time in short format

* Now you can use the [CellProvider] variable in the TOP list in properties

* Improved speed

* Now a consumer rollup can get values from multiple cell providers.

* There is a new property called "Retain Values" in order to retain the provider values if other webpart init a postback event

* The multipage interface now uses a postback event better than a query string, now you can put two csegRollUps with multipage on the same web page. Use __doPostBack('','Page:X') where X is the page number.  (the previous system continues working)

* You can select if you want use the MVP.XML for XSLT processing or use the internal NET processor.

 csegRollUp35.zip

Thursday, May 04, 2006 8:01:33 PM (Hora de verano romance, UTC+02:00)   #    Comments [4]   csegRollUp  | 

This is a small xml stylesheet to render a generic table with the data collected from csegRollUp, and it's ideal for debug purposes.

<?xml version="1.0" encoding="utf-8"?>
 
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <xsl:template match="Rows">
    <xsl:call-template name="Tabla"/>
  </xsl:template>
 
  <!-- Tabla -->
  <xsl:template name="Tabla">
    <table width="100%" cellpading="1">
      <tbody>
      <xsl:call-template name="Cabeceras" />
      <xsl:for-each select='Row'>
        <tr>
          <xsl:for-each select=".//*">
            <td class="ms-vb2">
              <xsl:value-of select="."/>
            </td>
          </xsl:for-each>
        </tr>
      </xsl:for-each>
      </tbody>
    </table>
  </xsl:template>
  
  <!-- Cabeceras de la tabla -->
  <xsl:template name="Cabeceras">
    <tr>
      <xsl:for-each select="Row[1]/*">
        <th nowrap=""  class="ms-vh2">
          <xsl:value-of select="name()"/>
        </th>
      </xsl:for-each >
    </tr>
  </xsl:template>
  
</xsl:stylesheet> 

Now I'm finishing the new version 3.5. There is a beta in the forums.

 

Wednesday, April 19, 2006 11:39:19 PM (Hora de verano romance, UTC+02:00)   #    Comments [0]   csegRollUp  | 

He estado pensando en las nuevas características que tendrá la versión 3.5 del csegRollUp (como siempre, si alguien tiene sugerencias que las diga)  por el momento dejo unas pequeñas pistas aquí. He estado trabajando con unas bibliotecas de documentos que contiene un meta dato llamado estado, la idea era mostrar los últimos archivos modificados por cada usuario dentro de un estado en particular, bien para esto basta con hacer una vista de la biblioteca de documentos y mostrar la vista organizada en categorías (cada estado una categoría). Esto esta muy bien pero en ocasiones el diseño ha de ser más funcional y esto es lo que ha salido usando el csegRollUp.

El primer csegRollUp va a mostrar un menú con los distintos estados, seleccionando uno de los estados se mostrarán en un segundo csegRollUp los documentos que tienen  dicho estado.

Para el primer csegRollUp se puede usar un pequeño truco si lo que queremos es hacer una transformación XSLT, que es poner un guión en el nombre de la lista y otro en el nombre de los campos, después podemos nuestro XSLT, (esto se podría hacer con un webpart de contendo, pero lo interesante aquí es aprovechar el interface cell provider de csegRollUp)

<?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="/">
    <a href="javascript:__doPostBack('','Estado A')">Ver los del estado A</a>
    <br/>
    <a href="javascript:__doPostBack('','Estado B')">Ver los del estado B</a>
    <br/>
  </xsl:template>
</xsl:stylesheet>

Este xslt pasará el estado a un segundo csegRollUp, donde mostraremos los documentos en función del estado, para ello en el segundo:

Lista: Nustra biblioteca favorita
Campos: FileRef,LinkFilename,EncodedAbsUrl,Modified,DocIcon,Author,Estado

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 width="24px">
              <img src="/_layouts/images/ic{DocIcon}.gif" alt="{FileRef}"/>
            </td>
            <td width="100%">
              <xsl:value-of select="LinkFilename" />
              <br/>
              <font color="#999999">
                (<xsl:value-of select="substring-before(Modified,' ')" />)
              </font>
            </td>
            <td width="24px">
              <a href="{substring-before(FileRef,LinkFilename)}">
                <img border="0" src="/_layouts/images/folder.gif" alt="Ir a la carpeta"/>
              </a>
            </td>
          </tr>
        </xsl:for-each>
      </tbody>
    </table>
  </xsl:template>
</xsl:stylesheet>

Y por último lo más importante la CAML query que recogerá el valor pasado.

<Where>
  <And>
    <Eq>
      <FieldRef Name="Author" />
      <Value Type='Text'>[UserName]</Value>
    </Eq>
    <Eq>
      <FieldRef Name="Estado" />
      <Value Type='Text'>[CellProvider]</Value>
    </Eq>
  </And>
</Where>

El resultado tras conectar los dos webparts:

Saturday, February 18, 2006 1:46:25 PM (Hora estándar romance, UTC+01:00)   #    Comments [0]   csegRollUp | SharePoint-es  | 

 

csegRollUp 3.1a

* Fixes

    - Queries with fields that contains spaces
    - Variables in caml queries
    - Other minor bugs

* Improvements (awaited :-))

    - Now there is a new property "From top level" where you can specify the starting point from which the csegrollup would gather the information, this url can be a site or a portal area. The format is an Url format (http://sever/sites/site or http://server/area), Now you can use csegRollUp in an area and rollup content from sites in other areas or others urls, also you can use csegRollUp in a site/subsite and agregate content from a top site.

  csegRollUp31a.zip (75,44 KB)

Tuesday, January 24, 2006 11:29:46 PM (Hora estándar romance, UTC+01:00)   #    Comments [31]   csegRollUp | SharePoint  | 

Thanks to Matthew McDermott and to Melvin Santana for this new xsl to render calendars with csegRollUp.

<?xml version="1.0" encoding="utf-8" ?>
<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 FormatDate(string sDate)
        {              
            if (sDate.Length > 0)            
            {           
                DateTime d = DateTime.Parse(sDate);           
                return d.ToString("u");
            }        
            else             
                return "(Empty)";     
        }    
]]>
</msxsl:script>
<xsl:output method="html" encoding="utf-8" />
  <xsl:template match="/">
    <SCRIPT>
       var dopt = new DateOptions;
       dopt.chDateSep = "/";
       dopt.chTimeSep = ":";
       dopt.SetTimeFormat(1);
       dopt.SetDateOrder(1);
       dopt.SetDOW(0); 
       dopt.webTZOffsetMin = -60;
       dopt.CalendarPeriod = "week";
       var cal = new Calendar(null, null, dopt);
       var rgIcons = new Array;
       rgIcons[0] = "\u003cIMG border=0 width=16 height=16 title=\u0022\u0022 SRC=\u0022/_layouts/images/blank.gif\u0022\u003e";
       rgIcons[1] = "\u003cIMG alt=\u0022\u0022 border=0 width=16 height=16 SRC=\u0022/_layouts/images/blank.gif\u0022";
       <xsl:for-each select="Rows/Row">
          <xsl:if test=”Begin != ‘’ and End != ‘’”>
          cal.AddFullEvent("<xsl:value-of select="utils:FormatDate(Begin)" />","
			<xsl:value-of select="utils:FormatDate(Begin)" />","
			<xsl:value-of select="_SiteTitle" />","
			<xsl:value-of select="Description"/>","
			<xsl:value-of select="Title"/>","
			<xsl:value-of select="_ItemUrl"/>",
			rgIcons);
          </xsl:if>
       </xsl:for-each>
       cal.BuildUI();
    </SCRIPT>
  </xsl:template>
</xsl:stylesheet>

Thursday, December 15, 2005 12:24:43 AM (Hora estándar romance, UTC+01:00)   #    Comments [4]   csegRollUp  | 

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>

This example use exslt distinct function to show only rows with distinct values

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:set="http://exslt.org/sets" exclude-result-prefixes="set">
    <xsl:output method="html" encoding="utf-8" />
    <xsl:template match="/">
         <xsl:for-each select="set:distinct(Row/Estado)">
            <xsl:value-of select="." /><br/>   
         </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

You can find more information about exslt in exslt.org and Mvp-xml

Tuesday, November 29, 2005 9:46:52 AM (Hora estándar romance, UTC+01:00)   #    Comments [1]   csegRollUp  | 

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.

- New features

- Examples (using csegRollUp consumer and provider interfaces)

  - 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

<_ListTitle/>   <!-- List Title -->
<_ListUrl/>     <!-- Url to default view -->
<_SiteTitle/>   <!-- Site title -->
<_SiteUrl/>     <!-- Url to site -->
<_ItemID/>      <!-- Item ID -->
<_ItemUrl/>     <!-- Url to list item view -->


- List in all subsites - If enabled the webpart will search these lists in all the subsites of a lower level, and show the results

- XSL - XSL to render the result (new this release supports exslt extensions)

- Debug XML - If checked you can view the collected xml data.

- Fix Lookups (new) - If enabled lookup fields thats contains key;#data are replaced only by data.

- CAML Query (new) - The caml query to retrieve items on each list.

Special values that you can use on queries:

    [Login] - the logged user
    [UserName] - the complete user name
    [UserID] - the user ID
    [Now] - the current date and time
    [Now+x] - the current date and time + x days
    [Now-x] - the current date and time  - x days

    [CellProvider] - the cell provide from other webpart

- CAML Query Row Limit (new) - The limit for the number of items returned in the query.

- Query recursive (new) - If enabled the makes the query recursive (search in subfoldes for documents libraries)

- Query Moderator (new) - If enabled you can check approval status.

- Debug query (new) - If checked you can view the result query.

Also I want to say that the offers that I had for my webparts, they have not been the sufficiently good thing. The license usage is as always free for no commercial usage. Contact with me first for other usages.

  csegRollUpV3.zip (76,54 KB)

Tuesday, November 22, 2005 12:12:52 AM (Hora estándar romance, UTC+01:00)   #    Comments [17]   csegRollUp | SharePoint  | 

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

   1:  <Where>
   2:     <Contains>
   3:        <FieldRef Name='Title' />
   4:        <Value Type='Text'>[CellProvider]</Value>
   5:     </Contains>
   6:  </Where>

Recursive: enabled

XSLT

   1:  <?xml version='1.0' encoding='utf-8'?>
   2:  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   3:     <xsl:output method="html" />
   4:     <xsl:template match="/">
   5:        <table class="ms-summarycustombody">
   6:           <tbody>
   7:              <xsl:for-each select="Rows/Row">
   8:                 <xsl:sort select="Modified" order="descending" />
   9:                 <tr>
  10:                    <td>
  11:                       <img src="/_layouts/images/ic{DocIcon}.gif" />
  12:                    </td>
  13:   
  14:                    <td width="75%">
  15:                       <a href="{EncodedAbsUrl}">
  16:                          <xsl:value-of select="LinkFilename" />
  17:                       </a>
  18:                    </td>
  19:                 </tr>
  20:              </xsl:for-each>
  21:           </tbody>
  22:        </table>
  23:     </xsl:template>
  24:  </xsl:stylesheet>

2.- Using csegRollUp cell provider interface

With the same data, the XSL contains a __doPostBack used to provide a cell value.

XSLT

   1:  <?xml version='1.0' encoding='utf-8'?>
   2:  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   3:     <xsl:output method="html" />
   4:     <xsl:template match="/">
   5:        <table class="ms-summarycustombody">
   6:           <tbody>
   7:              <xsl:for-each select="Rows/Row">
   8:                 <xsl:sort select="Modified" order="descending" />
   9:                 <tr>
  10:                    <td>
  11:                       <img src="/_layouts/images/ic{DocIcon}.gif" />
  12:                    </td>
  13:                    <td width="75%">
  14:                       <a href="javascript:__doPostBack('','{LinkFilename}')">
  15:                          <xsl:value-of select="LinkFilename" />
  16:                       </a>
  17:                    </td>
  18:                 </tr>
  19:              </xsl:for-each>
  20:           </tbody>
  21:        </table>
  22:     </xsl:template>
  23:  </xsl:stylesheet>

3.- Finally csegRollUp as provider and consumer and csegRollUp as consumer the BIG ONE...

The first webpart for text entry, the second one locate documents thats contains the text entry in the title. The last webpart shows information about of file clicked in webpart 2.

XSL from webpart 2 (csegRollUp v3 RC1 as Consumer and Provider)

   1:  <?xml version='1.0' encoding='utf-8'?>
   2:  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   3:     <xsl:output method="html" />
   4:     <xsl:template match="/">
   5:        <table class="ms-summarycustombody">
   6:           <tbody>
   7:              <xsl:for-each select="Rows/Row">
   8:                 <xsl:sort select="Modified" order="descending" />
   9:                 <tr>
  10:                    <td>
  11:                       <img src="/_layouts/images/ic{DocIcon}.gif" />
  12:                    </td>
  13:                    <td width="75%">
  14:                       <a href="javascript:__doPostBack('','{ID}')">
  15:                          <xsl:value-of select="LinkFilename" />
  16:                       </a>
  17:                    </td>
  18:                 </tr>
  19:              </xsl:for-each>
  20:           </tbody>
  21:        </table>
  22:     </xsl:template>
  23:  </xsl:stylesheet>

CAML Query in webpart 3 (csegRollUp v3 RC1 as Consumer)

   1:  <Where>
   2:     <Eq>
   3:        <FieldRef Name="ID" />
   4:        <Value Type='Numeric'>[CellProvider]</Value>
   5:     </Eq>
   6:  </Where>

XSL in webpart 3

   1:  <?xml version='1.0' encoding='utf-8'?>
   2:  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   3:     <xsl:output method="html" />
   4:     <xsl:template match="/">
   5:        <xsl:for-each select="Rows/Row">File Details 
   6:        <table class="ms-summarycustombody">
   7:           <tbody>
   8:              <tr>
   9:                 <td>Icon</td>
  10:                 <td>
  11:                    <img src="/_layouts/images/ic{DocIcon}.gif" />
  12:                 </td>
  13:              </tr>
  14:              <tr>
  15:                 <td>File Name</td>
  16:                 <td>
  17:                    <xsl:value-of select="LinkFilename" />
  18:                 </td>
  19:              </tr>
  20:              <tr>
  21:                 <td>Author</td>
  22:                 <td>
  23:                    <xsl:value-of select="Author" />
  24:                 </td>
  25:              </tr>
  26:              <tr>
  27:                 <td>Modified</td>
  28:                 <td>
  29:                    <xsl:value-of select="Modified" />
  30:                 </td>
  31:              </tr>
  32:           </tbody>
  33:        </table>
  34:        </xsl:for-each>
  35:     </xsl:template>
  36:  </xsl:stylesheet>

4.- Using csegRollUp as ComboBox Provider

This is great ... Render a combo with data from tasks list and provide the selected to another webpart

List: Tasks

Fields: ID, Title

XSLT

   1:  <?xml version='1.0' encoding='utf-8'?>
   2:  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   3:  <xsl:output method="html"/>
   4:  <xsl:template match="/">
   5:         <SCRIPT>
   6:         function combo_onchange(oSelect) {  
   7:                if(oSelect.selectedIndex != -1)  
   8:              __doPostBack('',oSelect.options[oSelect.selectedIndex].text);  
   9:         }  
  10:         </SCRIPT>
  11:         <select name="combo" onchange="javascript:combo_onchange(this)">
  12:          <xsl:for-each select="Rows/Row">
  13:               <option value="{ID}"><xsl:value-of select="Title"/></option>    
  14:          </xsl:for-each>
  15:          </select>
  16:       </xsl:template>
  17:  </xsl:stylesheet>

Today it is the first birthday of my daughter. Happy Birthday Patricia.

Saturday, November 12, 2005 9:17:10 AM (Hora estándar romance, UTC+01:00)   #    Comments [2]   csegRollUp | SharePoint  | 

- 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:

    [Login] - the logged user
    [UserName] - the complete user name
    [UserID] - the user ID
    [Now] - the current date and time
    [Now+x] - the current date and time + x days
    [Now-x] - the current date and time  - x days

  example:

   1:  <query>
   2:     <Where>
   3:        <And>
   4:           <Eq>
   5:              <FieldRef Name="Author" />
   6:   
   7:              <Value Type="Text">[UserName]</Value>
   8:           </Eq>
   9:   
  10:           <Eq>
  11:              <FieldRef Name="Modified" />
  12:   
  13:              <Value Type="DateTime">[Now-30]</Value>
  14:           </Eq>
  15:        </And>
  16:     </Where>
  17:   
  18:     <OrderBy>
  19:        <FieldRef Name="Modified" Ascending="False" />
  20:     </OrderBy>
  21:  </query>

   (Note, you need put all fields thats are on query in the fields property).

- CellConsumer interface, you can use an special value in queries called [CellProvider] this value is replaced with the cell value provide from other webpart.

Sample (conected to a document library)

<Where>

<Contains>

<FieldRef Name='FileRef'/>

<Value Type='Text'>[CellProvider]</Value>

</Contains>

</Where>

- CellProvider in