Home RSS 2.0 ATOM 1.0  CDF  
 
CodeSegment - Carlos Segura Sanz (blog)
 

This is the second webpart in the package csegAlerts (the first is here) this webpart show all users in a site and yours current alerts.

The webpart is called csegAdminUsersAlerts, you can delete one or all alerts for an user.

If you has installed the previous version, please unistall before install the new one. 

csegAlertsWebPart.zip (7,43 KB)

Sunday, July 31, 2005 12:11:40 AM (Hora de verano romance, UTC+02:00)   #    Comments [5]   SharePoint | csegAlerts  | 

Buff, finally csegSearch 1.1

Thanks to Henrik, Raphael, André, Klaus and Mario for your comments.

Fixed/Improvements

- Add support to display custom attributes in results view.
- Fix the query string parameters
- Fix empty Hilight color
- Hilight keywords in document title and author
- Parser optimization and autofix 

Operation

Webpart will transform the keywords into sharepoint joining  the words with the nexus AND as in google.  Internally csegSearch uses a parser engine that tries to correct the syntax of queries.

  •     Supports  AND, OR and NOT operators (also short form &,| and !)
  •     Supports  NEAR operator
  •     Supports  Wildcars and brackets
  •     Supports Special keywords (site, file, status, author)
  •     Hilights results (now client mode via javascript, support wildcards)
  •     Extend results easily (add custom)
  •     Go to folder button

Special keywords:

    They are added to the main query using AND operator. And always are considered using the nexus OR among them. Special keywords only works with simple queries.

    site, author, status, file

    Both accept wildcards ej: site:Demo*, file:*.doc

Custom properties

Show Query: If checked show the current query (debug purposes).

Show keywords: If checked show the keywords after parser it.

Extend Results: To show others attributes in your query results you need edit this property.

<Title>;<Search Attribute>,<Tile>;<Search Attribute> ...

Example: Modified;DAV:getlastmodified,Description2;urn:schemas.microsoft.com:fulltextqueryinfo


Query where part: Where part used in queries, you can modify it to use a custom where part.

Colorize color: Name of the color to hilights results (red, blue etc...) if empty not colorize.

Go to folder text: Query results show a new button under documents to go to the folder of document this is the text of button, if empty this button is not showed.

Search text: If show keywords is enabled this is the text before keywords.

Download csegSearchWebPart.zip (12,07 KB)

Wednesday, July 27, 2005 12:07:37 AM (Hora de verano romance, UTC+02:00)   #    Comments [3]   csegSearch  | 

This is my new blog (dasBlog based) thanks to Newtelligence

DasBlog Community Edition is currently on version 1.7 and is managed by Omar Shahine and Scott Hanselman with the blessing of Clemens Vasters The project is hosted at SourceForge

The cseg webparts forums are based in phpBB

Carlos.

Tuesday, July 26, 2005 9:39:22 PM (Hora de verano romance, UTC+02:00)   #    Comments [0]    | 

I am working in three webparts for handling alerts in Sharepoint, as advance here is first of them. 

csegUserListsAlerts

This webpart shows

1) A drop-down list with all the lists of the Web site in where it is located. 
2) The name of the current user
3) One lists with all the users of the Web site
4) The alerts for the selected list

o_csegUserListAlerts.gif

You can do:

Eliminate the selected alert
Eliminate all alerts for the current list
Add alert to selected users (specify type and frecuency)
Add alerts to all users

The webpart screenshot has texts in spanish but the download webpart is translated to english.

The next webpart would show a drop-down list with all users and your alerts. The third webpart is a webpart for information to show current user alerts.

csegAlertsWebPart.zip (7,43 KB)

Tuesday, July 26, 2005 7:52:41 PM (Hora de verano romance, UTC+02:00)   #    Comments [11]   csegAlerts | SharePoint  | 

Some people ask me about samples of transformations, XSL to use with the csegRollUp webpart. First of all, I adopted XSL because it is the best way to customize any webpart.

I’m using mainly XMLSpy in work, but those days in my laptop I’m using too a freeware application to edit XSL called “cooktop” written by Victor Pavlov, it is a xsl, xpath and dtd editor, you can use the XML debug output from csegRollUp and test your XSL.

If you want share your csegRollUp XSL files, please send me a mail to include it in the csegRollUp weekly sample contest.

Of course this week I win.

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:
5:   
<xsl:key name="group-by-site" match="Row" use="_SiteTitle" />
6:
7:   
<xsl:template match="Rows">
8:      
<table class="ms-summarycustombody" width="100%">
9:         
<tbody>
10:            
<xsl:for-each select="Row[count(. | key('group-by-site', _SiteTitle)[1]) = 1]">
11:               
<xsl:sort select="_SiteTitle" />
12:
13:               
<tr id="group0">
14:                  
<td class="ms-gb" colspan="2">
15:                     
<span class="ms-announcementtitle">
16:                        
<a href="javascript:" onclick="javascript:ExpGroupBy(this);return false;">
17:                           
<img src="/_layouts/images/plus.gif" border="0" />
18:                        
</a>
19:
20:                        
<a href="{_SiteUrl}">
21:                           
<xsl:value-of select="_SiteTitle" />
22:                        
</a>
23:                     
</span>
24:                  
</td>
25:               
</tr>
26:
27:               
<xsl:for-each select="key('group-by-site', _SiteTitle)">
28:                  
<tr style="display:none">
29:                     
<td class="ms-vb" width="50%" style="padding-bottom: 3px">
30:                        
<span class="ms-announcementtitle">
31:                           
<a href="{_ItemUrl}">
32:                              
<xsl:value-of select="Título" />
33:                           
</a>
34:                        
</span>
35:                     
</td>
36:
37:                     
<td class="ms-vb" width="50%">
38:                        
<p align="right">
39:                         (
40:                        
<xsl:value-of select="Caduca" />
41:                         )
</p>
42:                     
</td>
43:                  
</tr>
44:
45:                  
<tr style="display:none">
46:                     
<td class="ms-vb" colSpan="2">
47:                        
<xsl:value-of select="Texto" disable-output-escaping="yes" />
48:                     
</td>
49:                  
</tr>
50:               
</xsl:for-each>
51:            
</xsl:for-each>
52:         
</tbody>
53:      
</table>
54:   
</xsl:template>
55:
</xsl:stylesheet>

Result

Tuesday, July 26, 2005 7:51:08 PM (Hora de verano romance, UTC+02:00)   #    Comments [0]   csegRollUp  | 

First, once again many thanks to all you for your kind commentaries about csegRollUp.

Sorry for being so late but I have had a lot of work last days, and nights are so short...

Fixes

For users with problems in sites with ports diferents to 80, I must say that all tests of this new version have been done with a server installed in the port 1000 and all them have run correctly.

For users with problems as "not in the configuration database"  they are using only wss sites, now csegRollUp runs correctly.

Remember that the field and list separator is comma ','

Installation

First is very important uninstall the previous version:

stsadm -o deletewppack -filename csegRollUp.cab  and them install the new one.

New Features

A new functionality has been added. To use it, please, indicate the name of the lists you want to rollup List,List2,List3 (a "coma" after every list) and choose the option "Lists in all subsites".

The webpart will search these lists in all the subsites of a lower level, and show the results.

Remember the csegRollUp XSL contest I wait for your contributions.

csegRollUp2.zip (8,03 KB)

Tuesday, July 26, 2005 7:49:23 PM (Hora de verano romance, UTC+02:00)   #    Comments [12]   csegRollUp  | 

This webpart allows to make searches GOOGLE  type in sharepoint.

In the first place I would like to thank  Mattiew Cosier since to a large extent I have been inspired by his work. And Gustavo to test the webpart in your systems.

This webpart is a subclass of the webpart included in sharepoint called SearchResults. Baically, csegSearch   transforms the keywords and  gives them the correct syntax to be used with the predicate CONTAINS of the Sharepoint searches..

Being a subclass of SearchResults we can interchange them and  continue using the adavanced searches and the management searches.


Installation

This webpart settles like a normal webpart..

Stsadm -o addwppack -filename csegSearchWebPart.cab [ -globalinstall -force ]


Once installed we need to modify the search.aspx page and to change webpart SearchResults by csegSearch (see installation video)

In the properties of csegSearch, we will change the name of the list by "sch" in order to use advanced search management (sort and group)


Operation

Webpart will transform the keywords into sharepoint joining  the words with the nexus AND as in google.  Internally csegSearch uses a parser engine that tries to correct the syntax of queries.

  •     Supports  AND, OR and NOT operators (also short form &,| and !)
  •     Supports  NEAR operator
  •     Supports  Wildcars and brackets
  •     Supports Special keywords (site and file)
  •     Hilights results.

Special keywords:

    They are added to the main query using AND operator. And always are considered using the nexus OR among them. Special keywords only works with simple queries.

    site:
    file:

    Both accept wildcards ej: site:Demo*, file:*.doc

Custom properties

Debug query: If checked show the current query.

Debug keywords: If checked show the keywords after parser it.

Query where part: Where part used in queries, you can modify it to use a custom where part.

Open links in a new window: If checked when click a result its show in a new window.

Colorize color: Name of the color to hilights results (red, blue etc...) if empty not colorize.

Go to folder text: Query results show a new button under documents to go to the folder of document this is the text of button, if empty this button is not showed.

Sample Queries

Input Keywords Result Query
red car "red" AND "car"
"red car" "red car"
red car big "red" AND "car" AND "big"
red car or big "red" AND "car" OR "big"
red (car or moto) "red" AND ("car" OR "moto")
red car not big ("red" AND "car") AND NOT "big"
red and and car "red" AND "car"
red car  or not big "red" AND "car" OR "big"
red car site:Demo* site:Test* file:doc "red" AND "car" AND (Site contains Demo* OR Site contains Test*) AND file contains doc

I wait for your commentaries and suggestions for future versions

Download csegSearch   Updated

Tuesday, July 26, 2005 7:46:56 PM (Hora de verano romance, UTC+02:00)   #    Comments [9]   csegSearch | SharePoint  | 

First, thanks to all by the comments about RollUp webpart.

Now, do you need a Calendar view with your RollUp events, tasks or any list???

Are you ready?.

You can use the Sharepoint calendar whith csegRollUp it’s easy and you can view the Month view, weekly view or day view whit your aggregated data.

Just, a sample of XSL to render.

<?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="/"
>
       <SCRIPT
>
       var dopt = new DateOptions;
       dopt.chDateSep = "/";
       dopt.chTimeSep = ":";
       dopt.SetTimeFormat(1);
       dopt.SetDateOrder(1);
       dopt.SetDOW(0); 
       dopt.webTZOffsetMin = -60;
       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=\u0022http://srvsp/_layouts/images/blank.gif\u0022";
    <xsl:for-each select="Rows/Row"
>
             <xsl:variable name='datetime' select='Caduca' /
>
             <xsl:variable name='year'  select='substring( $datetime, 7 , 4 )' /
>
             <xsl:variable name='month' select='substring( $datetime, 4 , 2 )' /
>
             <xsl:variable name='day'   select='substring( $datetime, 1 , 2 )' /
>
             <xsl:variable name='hour'  select='substring( $datetime, 1 , 1 )' /
>
             <xsl:variable name='minute' select='substring( $datetime, 4 , 2 )' /
>
             <xsl:variable name='second' select='substring( $datetime, 7 , 2 )' /
>
             <xsl:variable name='spdate' select="concat($year, '-', $month, '-', $day, 'T0', $hour, ':', $minute, ':', $second, 'Z' )" />

             cal.AddFullEvent("<xsl:value-of select='$spdate' />",
                                         "<xsl:value-of select='$spdate'/>
", 
                                         "", 
                                         "<xsl:value-of select="Texto"/>
",  
                                         "<xsl:value-of select="Título"/>
", 
                                         "<xsl:value-of select="_ItemUrl"/>
", 
                                         rgIcons);
          </xsl:for-each
>
        cal.BuildUI();
       
</SCRIPT
>
    
</xsl:template
>
</xsl:stylesheet>


 
Result Screenshots

 

You can use DateOptions CalendarPeriod to set the default view, modify the xsl with :

dopt.CalendarPeriod = “month” / “week” / “day”

The ows.js CalAddFullEvent format is :

CalAddFullEvent(stDateStart, stDateEnd, stLocation, stDesc, stTitle, stURL, rgIcons)

Tuesday, July 26, 2005 7:41:22 PM (Hora de verano romance, UTC+02:00)   #    Comments [0]   csegRollUp  | 

UPDATED New Version 2

This is my new webpart, in that I have worked in order to solve a common problem. The Rollup for Sharepoint lists.

With this webpart you can rollup any list in any site, you can get data from different lists (Tasks, Announcements, your customs lists)

The Webpart check the security so that if a user does not have access to a site or a list these data will not appear.

Webpart gathers data from the specified lists and join it in a common xml that later will render it using xsl.

Webpart properties

  • Lists

List of comma delimited values that signify the sites and lists
Format: /site/subsite:ListName, /site/subsite/subsite:ListName

  •  Fields

List of comma delimited values with the field names
Format: Title,Text,Comment,User
All the fields must exist in all the lists. You can put different lists but the fields must exist. 

  • XSL

XSL to render the result

  • Debug XML

If checked you can view the collected xml data

 

 

The XML is formatted as

<?xml version="1.0" encoding="utf-8" ?>
<
Rows>
   <
Row>
     <
_ListTitle/>
     <
_ListUrl/>     <!-- Url to default view -->
     <
_SiteTitle/>
     <
_SiteUrl/>     <!-- Url to site -->
     <
_ItemID/>
     <
_ItemUrl/>     <!-- Url to list item view -->
     <
Field/>        <!-- Each one of the specified fields -->
  
</Row>
<
/Rows
>

XML debug output.

Results once applied the xsl 

The XSL used in the sample

<?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="_SiteTitle"/>
              
<tr>
                
<td class="ms-vb" width="50%" style=