12.10.10

Disabilitare iper link da utente sharepoint

Acceder tramite Sharepoint Designer alla lista da cui si intende disabilitare il link al profilo utente, lasciando il nome del utente solo come etichetta e modificare xsl nel modo seguente:

 

<xsl:value-of select="substring-after(substring-after(substring-before(@In_x0020_carico_x0020_da,'&lt;/A&gt;'),'ID'),'&gt;')" disable-output-escaping="yes" />

14.9.10

Che ore sono: Confronto tra date XSL

<xsl:variable name="cheoresono" select="ddwrt:FormatDate(ddwrt:TodayIso(),1040,5)"></xsl:variable>

<xsl:variable name="testconverted" select="number(concat(substring(string(@TEST),1,4), substring(string(@TEST),6,2), substring(string(@TEST),9,2), substring(string(@TEST),12,2), substring(string(@TEST),15,2)))" />

<xsl:variable name="cheoresonoconverted" select="number(concat(substring($cheoresono,1,4), substring($cheoresono,6,2), substring($cheoresono,9,2), substring($cheoresono,12,2), substring($cheoresono,15,2)))" />

A questo punto posso effettuare il confronto delle due date con il semplice xsl:if

<xsl:if test="$testconverted &gt; $cheoresonoconverted">@TEST è maggiore di questo momento (secondi esclusi)</xsl:if>

Non volendo inserire all’interno del template XSL questo tipo di filtro (forse più utile per formattazione condizionale che per filtro) potrei applicarlo allo stesso modo nella query XPath presente nella dataview all’interno del template dvt_1:

<xsl:variable name="cheoresono" select="ddwrt:TodayIso()"></xsl:variable>

<xsl:variable name="cheoresonoconverted" select="number(concat(substring($cheoresono,1,4), substring($cheoresono,6,2), substring($cheoresono,9,2), substring($cheoresono,12,2), substring($cheoresono,15,2)))" />

<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[number(concat(substring(string(@TEST),1,4), substring(string(@TEST),6,2), substring(string(@TEST),9,2), substring(string(@TEST),12,2), substring(string(@TEST),15,2))) &lt; $cheoresonoconverted]"/>

1.9.10

Form Based Authentication Question

Autenticazione Form Based ? il web é pieno di tutorial sulla configurazione di SharePoint, rimando a dei link molto chiari:

 

Client Integration

Una semplice risposta è possibile, funziona, ma richiede:

  • Service pack 2 di SharePoint Server 2007 lato server
  • Service pack 2 di Office 2007 lato cliente

31.8.10

SharePoint Service ( WSS ) LDAP Authentication Provider – Yes

Autenticazione LDAP con MOSS è possibile e semplece da configurare farò presto un articolo sull argomento, ma con WSS.

Putroppo non sono disponibili le stesse classi fornite dalla libreria

Microsoft.Office.Server.Security.LDAPMembershipProvider

ma possiamo comunque sviluppare in modo abbastanza semplice un constro custom provider per una autenticazione ad hoc per le nostre esigenze.

 

Se non sapete come partire cominciate da questa classe, scarica il docide da qui QUI

 

image

Esempi di Authentication Provider in SharePoint

 

image

Free Text Box For Rich Text

… perchè le cose fatte bene devono essere pubblicizzate

image

30.7.10

XSLT Search Result SharePoint Customization

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:param name="ResultsBy" />
    <xsl:param name="ViewByUrl" />
    <xsl:param name="ViewByValue" />
    <xsl:param name="IsNoKeyword" />
    <xsl:param name="IsFixedQuery" />
    <xsl:param name="ShowActionLinks" />
    <xsl:param name="MoreResultsText" />
    <xsl:param name="MoreResultsLink" />
    <xsl:param name="CollapsingStatusLink" />
    <xsl:param name="CollapseDuplicatesText" />
    <xsl:param name="AlertMeLink" />
    <xsl:param name="AlertMeText" />
    <xsl:param name="SrchRSSText" />
    <xsl:param name="SrchRSSLink" />
    <xsl:param name="ShowMessage" />
    <xsl:param name="IsThisListScope" />
    <xsl:param name="DisplayDiscoveredDefinition" select="True" />
    <xsl:param name="NoFixedQuery" />
    <xsl:param name="NoKeyword" />
    <xsl:param name="NoResults" />
    <xsl:param name="NoResults1" />
    <xsl:param name="NoResults2" />
    <xsl:param name="NoResults3" />
    <xsl:param name="NoResults4" />
    <xsl:param name="DefinitionIntro" />

    <xsl:key name="results-by-site" match="Result" use="sitename" />

    <!-- When there is keywory to issue the search -->
    <xsl:template name="dvt_1.noKeyword">
        <span class="srch-description">
            <xsl:choose>
                <xsl:when test="$IsFixedQuery">
                    <xsl:value-of select="$NoFixedQuery" />
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$NoKeyword" />
                </xsl:otherwise>
            </xsl:choose>
        </span>
    </xsl:template>

    <!-- When empty result set is returned from search -->
    <xsl:template name="dvt_1.empty">
        <div class="srch-sort">
            <xsl:if test="$AlertMeLink and $ShowActionLinks">
                <span class="srch-alertme" >
                    <a href ="{$AlertMeLink}" id="CSR_AM1" title="{$AlertMeText}">
                        <img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/>
                        <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                        <xsl:value-of select="$AlertMeText" />
                    </a>
                </span>
            </xsl:if>

            <xsl:if test="string-length($SrchRSSLink) &gt; 0 and $ShowActionLinks">
                <xsl:if test="$AlertMeLink">
                    |
                </xsl:if>
                <a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL">
                    <img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/>
                    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                    <xsl:value-of select="$SrchRSSText"/>
                </a>
            </xsl:if>
        </div>
        <br/>
        <br/>

        <span class="srch-description" id="CSR_NO_RESULTS">
            <xsl:value-of select="$NoResults" />

            <ol>
                <li>
                    <xsl:value-of select="$NoResults1" />
                </li>
                <li>
                    <xsl:value-of select="$NoResults2" />
                </li>
                <li>
                    <xsl:value-of select="$NoResults3" />
                </li>
                <li>
                    <xsl:value-of select="$NoResults4" />
                </li>
            </ol>
        </span>
    </xsl:template>

    <!-- Main body template. Sets the Results view (Relevance or date) options -->
    <xsl:template name="dvt_1.body">
        <div class="srch-results">
            <xsl:if test="$ShowActionLinks">
                <div class="srch-sort">
                    <xsl:value-of select="$ResultsBy" />
                    <xsl:if test="$ViewByUrl">
                        |
                        <a href ="{$ViewByUrl}" id="CSR_RV" title="{$ViewByValue}">
                            <xsl:value-of select="$ViewByValue" />
                        </a>
                    </xsl:if>
                    <xsl:if test="$AlertMeLink">
                        |
                        <span class="srch-alertme" >
                            <a href ="{$AlertMeLink}" id="CSR_AM2" title="{$AlertMeText}">
                                <img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/>
                                <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                                <xsl:value-of select="$AlertMeText" />
                            </a>
                        </span>
                    </xsl:if>
                    <xsl:if test="string-length($SrchRSSLink) &gt; 0">
                        |
                        <a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL">
                            <img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/>
                            <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                            <xsl:value-of select="$SrchRSSText"/>
                        </a>
                    </xsl:if>
                </div>
                <br />
                <br />
            </xsl:if>
            <xsl:apply-templates />

        </div>
        <xsl:call-template name="DisplayMoreResultsAnchor" />
    </xsl:template>
    <!-- This template is called for each result -->

    <xsl:template match="All_Results">

        <style>

            .searchCategory
            {
            background-color: lightsteelblue;
            border-bottom: solid 1px steelblue;
            border-right: solid 1px steelblue;
            border-top: solid 1px aliceblue;
            border-left: solid 1px aliceblue;
            width: 100%;
            font-family: arial;
            font-size: 11pt;
            padding: 7px;
            margin-bottom: 8px;
            }

        </style>

        <xsl:for-each select="Result[count(. | key('results-by-site', sitename)[1]) = 1]">
            <xsl:sort select="sitename"/>

            <div class="searchCategory">

                Sito:

                <b>
                    <xsl:value-of select="sitename"/>
                </b>
            </div>

            <xsl:for-each select="key('results-by-site', sitename)">
                <xsl:variable name="id" select="id"/>
                <xsl:variable name="url" select="url"/>
                <span class="srch-Icon">
                    <a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
                        <img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
                    </a>
                </span>
                <span class="srch-Title">
                    <a href="{$url}" id="{concat('CSR_',$id)}" title="{$url}">
                        <xsl:choose>
                            <xsl:when test="hithighlightedproperties/HHTitle[. != '']">
                                <xsl:call-template name="HitHighlighting">
                                    <xsl:with-param name="hh" select="hithighlightedproperties/HHTitle" />
                                </xsl:call-template>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="title"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </a>
                    <br/>
                </span>

                <xsl:choose>
                    <xsl:when test="$IsThisListScope = 'True' and contentclass[. = 'STS_ListItem_PictureLibrary'] and picturethumbnailurl[. != '']">
                        <div style="padding-top: 2px; padding-bottom: 2px;">
                            <a href="{$url}" id="{concat('CSR_P',$id)}" title="{title}">
                                <img src="{picturethumbnailurl}" alt="" />
                            </a>
                        </div>
                    </xsl:when>
                </xsl:choose>
                <div class="srch-Description">
                    <xsl:choose>
                        <xsl:when test="hithighlightedsummary[. != '']">
                            <xsl:call-template name="HitHighlighting">
                                <xsl:with-param name="hh" select="hithighlightedsummary" />
                            </xsl:call-template>
                        </xsl:when>
                        <xsl:when test="description[. != '']">
                            <xsl:value-of select="description"/>
                        </xsl:when>
                    </xsl:choose>
                </div >
                <p class="srch-Metadata">
                    <span class="srch-URL">
                        <a href="{$url}" id="{concat('CSR_U_',$id)}" title="{$url}" dir="ltr">
                            <xsl:choose>
                                <xsl:when test="hithighlightedproperties/HHUrl[. != '']">
                                    <xsl:call-template name="HitHighlighting">
                                        <xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
                                    </xsl:call-template>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of select="url"/>
                                </xsl:otherwise>
                            </xsl:choose>
                        </a>
                    </span>
                    <xsl:call-template name="DisplaySize">
                        <xsl:with-param name="size" select="size" />
                    </xsl:call-template>
                    <xsl:call-template name="DisplayString">
                        <xsl:with-param name="str" select="author" />
                    </xsl:call-template>
                    <xsl:call-template name="DisplayString">
                        <xsl:with-param name="str" select="write" />
                    </xsl:call-template>
                    <xsl:call-template name="DisplayCollapsingStatusLink">
                        <xsl:with-param name="status" select="collapsingstatus"/>
                        <xsl:with-param name="urlEncoded" select="urlEncoded"/>
                        <xsl:with-param name="id" select="concat('CSR_CS_',$id)"/>
                    </xsl:call-template>
                </p>
            </xsl:for-each>
        </xsl:for-each>
    </xsl:template>

    <xsl:template name="HitHighlighting">
        <xsl:param name="hh" />
        <xsl:apply-templates select="$hh"/>
    </xsl:template>

    <xsl:template match="ddd">
        &#8230;
    </xsl:template>
    <xsl:template match="c0">
        <span style="background-color:green">
            <b >
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c1">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c2">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c3">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c4">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c5">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c6">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c7">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c8">
        <span style="background-color:yellow">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>
    <xsl:template match="c9">
        <span style="background-color:red">
            <b>
                <xsl:value-of select="."/>
            </b>
        </span>
    </xsl:template>

    <!-- The size attribute for each result is prepared here -->
    <xsl:template name="DisplaySize">
        <xsl:param name="size" />
        <xsl:if test='string-length($size) &gt; 0'>
            <xsl:if test="number($size) &gt; 0">
                -
                <xsl:choose>
                    <xsl:when test="round($size div 1024) &lt; 1">
                        <xsl:value-of select="$size" /> Bytes
                    </xsl:when>
                    <xsl:when test="round($size div (1024 *1024)) &lt; 1">
                        <xsl:value-of select="round($size div 1024)" />KB
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="round($size div (1024 * 1024))"/>MB
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:if>
        </xsl:if>
    </xsl:template>

    <!-- A generic template to display string with non 0 string length (used for author and lastmodified time -->
    <xsl:template name="DisplayString">
        <xsl:param name="str" />
        <xsl:if test='string-length($str) &gt; 0'>
            -
            <xsl:value-of select="$str" />
        </xsl:if>
    </xsl:template>

    <!-- document collapsing link setup -->
    <xsl:template name="DisplayCollapsingStatusLink">
        <xsl:param name="status"/>
        <xsl:param name="urlEncoded"/>
        <xsl:param name="id"/>
        <xsl:if test="$CollapsingStatusLink">
            <xsl:choose>
                <xsl:when test="$status=1">
                    <br/>
                    <xsl:variable name="CollapsingStatusHref" select="concat(substring-before($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'), 'duplicates:&quot;', $urlEncoded, '&quot;', substring-after($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'))"/>
                    <span class="srch-dup">
                        [<a href="{$CollapsingStatusHref}" id="$id" title="{$CollapseDuplicatesText}">
                            <xsl:value-of select="$CollapseDuplicatesText"/>
                        </a>]
                    </span>
                </xsl:when>
            </xsl:choose>
        </xsl:if>
    </xsl:template>
    <!-- The "view more results" for fixed query -->
    <xsl:template name="DisplayMoreResultsAnchor">
        <xsl:if test="$MoreResultsLink">
            <a href="{$MoreResultsLink}" id="CSR_MRL">
                <xsl:value-of select="$MoreResultsText"/>
            </a>
        </xsl:if>
    </xsl:template>

    <xsl:template match="All_Results/DiscoveredDefinitions">
        <xsl:variable name="FoundIn" select="DDFoundIn" />
        <xsl:variable name="DDSearchTerm" select="DDSearchTerm" />
        <xsl:if test="$DisplayDiscoveredDefinition = 'True' and string-length($DDSearchTerm) &gt; 0">
            <script language="javascript">
                function ToggleDefinitionSelection()
                {
                var selection = document.getElementById("definitionSelection");
                if (selection.style.display == "none")
                {
                selection.style.display = "inline";
                }
                else
                {
                selection.style.display = "none";
                }
                }
            </script>
            <div>
                <a href="#" onclick="ToggleDefinitionSelection(); return false;">
                    <xsl:value-of select="$DefinitionIntro" />
                    <b>
                        <xsl:value-of select="$DDSearchTerm"/>
                    </b>
                </a>
                <div id="definitionSelection" class="srch-Description" style="display:none;">
                    <xsl:for-each select="DDefinitions/DDefinition">
                        <br/>
                        <xsl:variable name="DDUrl" select="DDUrl" />
                        <xsl:value-of select="DDStart"/>
                        <b>
                            <xsl:value-of select="DDBold"/>
                        </b>
                        <xsl:value-of select="DDEnd"/>
                        <br/>
                        <xsl:value-of select="$FoundIn"/>
                        <a href="{$DDUrl}">
                            <xsl:value-of select="DDTitle"/>
                        </a>
                    </xsl:for-each>
                </div>
            </div>
        </xsl:if>
    </xsl:template>

    <!-- XSL transformation starts here -->
    <xsl:template match="/">
        <xsl:if test="$AlertMeLink">
            <input type="hidden" name="P_Query" />
            <input type="hidden" name="P_LastNotificationTime" />
        </xsl:if>
        <xsl:choose>
            <xsl:when test="$IsNoKeyword = 'True'" >
                <xsl:call-template name="dvt_1.noKeyword" />
            </xsl:when>
            <xsl:when test="$ShowMessage = 'True'">
                <xsl:call-template name="dvt_1.empty" />
            </xsl:when>
            <xsl:otherwise>
                <xsl:call-template name="dvt_1.body"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <!-- End of Stylesheet -->
</xsl:stylesheet>

28.7.10

Ricerca Personalizzata Sharepoint

Nella tua Content EditorWebpart

<b>Inserisci numero di protocollo:</b><br>
<input type=text name=CRSearchString id=CRSearchString>
<input type=button name=btnSubmit value="Cerca" onclick="DoCRSearch()">
<br><br>

<script language="JavaScript">

function DoCRSearch()
{
       var obj = document.getElementById("CRSearchString");
    var strSearch = obj.value;
    strSearch = escape(strSearch);

        document.location.href = "http://win-sharefe1/Ricerca/results.aspx?k=nprotocollo:" + strSearch + “&u=http://win-sharefe1:9998/prova_vendite”;
}</script>

12.7.10

Configure connection to records center

central administration

 

…/_admin/OfficialFileAdmin.aspx

 

configure connection to records center

 

…/ _vti_bin/officialfile.asmx

 

and name

Backup SharePoint Scripts

Backup completo della Farm:

rem BAckup full per disaster recovery

cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

stsadm -o backup -directory \\WIN-SHAREFE1\backup\full -backupmethod full

Questo file di script esegue il backup di tutta la farm il commando principale contenuto è

stsadm -o backup -directory \\WIN-SHAREFE1\backup\full -backupmethod full

e’ conveniente dopo la prima esecuzione cambiare il parametro full con differential in modo da fare un backup differenziale e non occupare troppo spazio sul disco.

Backup web application :

rem BAckup full per disaster recovery

cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

stsadm -o backup -directory \\WIN-SHAREFE1\backup\vendite -backupmethod differential -item "nome sito"

Questo script esegue il backup di una web application. Per salvare tutte le web application basterà copiare- incollare il comando sostituendo i parametri.

Il comando principale contenuto è

stsadm -o backup -directory \\WIN-SHAREFE1\backup\vendite -backupmethod differential -item "nome sito"

anche in questo caso la prima volta come backupmethod si dovrà fare un full e poi un differential

bisognerà rieseguire il comando per ogni singola web application ed eventualmente cambiare il path di destinazione es:

stsadm -o backup -directory \\WIN-SHAREFE1\backup\pippo -backupmethod differential -item "nome sito”

Backup site collection:

rem backup site collection

cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

stsadm -o backup -url http://win-sharefe1:35133 -filename C:\backup\site\vendite.bak –overwrite

Questo script permette di “backuppare” la singola site collection. Anche in questo caso il comando principale andrà ripetuto per ciascuna site collection.

Il comando principale contenuto nello script è :

stsadm -o backup -url http://win-sharefe1:35133 -filename C:\backup\site\vendite.bak –overwrite

il sistema creerà un file con estensione bak (vendite.bak nell’esempio) il parametro finale –overwrite permetterà di sovrascrivere il file.

Backup delle cartelle contenenti file di sharepoint (non presenti nel DB)

rem copia delle cartelle contenenti i file inerenti shere point

robocopy.exe "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12" "C:\backup\folder\12" /E /COPYALL /ZB /LOG+:"C:\backup\folder\log.log" /XO

robocopy.exe "C:\Program Files\Microsoft Office Servers\12.0" "C:\backup\folder\binari" /E /COPYALL /ZB /LOG+:"C:\backup\folder\log.log" /XO

robocopy.exe "C:\inetpub\wwwroot" "C:\backup\folder\wwwroot" /E /COPYALL /ZB /LOG+:"C:\backup\folder\log.log" /XO

E’ fortemente consigliato copiare il file contenuti nelle cartelle in cui sharepoint scrive delle informazioni non presenti nel database. Le cartelle sono le seguenti:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12

C:\Program Files\Microsoft Office Servers\12.0

C:\inetpub\wwwroot

E’ consigliato copiarli direttamente tramite un normale comando di copia nello script è stato proposta una soluzione tramite il robocopy (più performante del xcopy)

Backup configurazione IIS7

rem "backup metabase iss7"

cd %windir%\system32\inetsrv

appcmd.exe add backup "backup_IIS7"

cd %windir%\system32\inetsrv\backup

xcopy *.* C:\backup\iis /s /r /Y

rem appcmd.exe delete backup "backup_IIS7"

In IIS7 è stato introdotto un nuovo metodo di backup tramite il comando appcmd.exe

La riga di comando contenuta nello script è molto semplice:

appcmd.exe add backup "backup_IIS7"

Vi è però un problema , non è possible effettuare funzioni di over write del backup quindi nello script viende spostato e cancellato.

7.7.10

Link a dettaglio item senza menu

<a href="{$URL_Display}?ID={@ID}" style="border-style:none; border-width:0px" ><img style="border-style:none; border-width:0px" src="/_layouts/images/ApViewItem.gif" width="13" alt="" /> Dettaglio</a>

5.7.10

Manual Security Trimming by SharePoint:SPSecurityTrimmedControl

<SharePoint:SPSecurityTrimmedControl ID=”SPSecurityTrimmedControlName″ PermissionsString=”BrowseDirectories” runat=”server”>

The markup that needs to be security trimmed goes here.

</SharePoint:SPSecurityTrimmedControl>

 

Here are the permissions you can use, you can add multiple using commas:

  • AddAndCustomizePages
  • AddDelPrivateWebParts
    Add or remove personal Web Parts on a Web Part Page.
  • AddListItems
    Add items to lists, add documents to document libraries, and add Web discussion comments.
  • ApplyStyleSheets
    Apply a style sheet (.css file) to the Web site.
  • ApplyThemeAndBorder
    Apply a theme or borders to the entire Web site.
  • ApproveItems
    Approve a minor version of a list item or document.
  • BrowseDirectories
    Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.
  • BrowseUserInfo
    View information about users of the Web site.
  • CancelCheckout
    Discard or check in a document which is checked out to another user.
  • CreateAlerts
    Create e-mail alerts.
  • CreateGroups
    Create a group of users that can be used anywhere within the site collection.
  • CreateSSCSite
    Create a Web site using Self-Service Site Creation.
  • DeleteListItems
    Delete items from a list, documents from a document library, and Web discussion comments in documents.
  • DeleteVersions
    Delete past versions of a list item or document.
  • EditListItems
    Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.
  • EditMyUserInfo
    Allows a user to change his or her user information, such as adding a picture.
  • EmptyMask
    Has no permissions on the Web site. Not available through the user interface.
  • EnumeratePermissions
    Enumerate permissions on the Web site, list, folder, document, or list item.
  • FullMask
    Has all permissions on the Web site. Not available through the user interface.
  • ManageAlerts
    Manage alerts for all users of the Web site.
  • ManageLists
    Create and delete lists, add or remove columns in a list, and add or remove public views of a list.
  • ManagePermissions
    Create and change permission levels on the Web site and assign permissions to users and groups.
  • ManagePersonalViews
    Create, change, and delete personal views of lists.
  • ManageSubwebs
    Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites. 
  • ManageWeb
    Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the Site Collection Features page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.
  • Open
    Allow users to open a Web site, list, or folder to access items inside that container.
  • OpenItems
    View the source of documents with server-side file handlers.
  • UpdatePersonalWebParts
    Update Web Parts to display personalized information.
  • UseClientIntegration
    Use features that launch client applications; otherwise, users must work on documents locally and upload changes. 
  • UseRemoteAPIs
    Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.
  • ViewFormPages
    View forms, views, and application pages, and enumerate lists.
  • ViewListItems
    View items in lists, documents in document libraries, and view Web discussion comments.
  • ViewPages
    View pages in a Web site.
  • ViewUsageData
    View reports on Web site usage.
  • ViewVersions

from http://raiumair.wordpress.com/2009/08/05/security-trim-control/

1.7.10

Convertire contenuto html delle colonne

Aggiungi webpart editor come ultima web part della pagina inserisci script sottostante com testo html della webpart. Fatto !

 

Ricorda che le funzioni dei campi calcolati variano a seconda della lingua della site collection. Esempio controllo IF:

  • inglese: =IF([Column1]="Vietzen", "OK", "Not OK")
  • italiano: =SE([Column1]="Vietzen"; "OK"; "Not OK")

 

<script type="text/javascript">

// Find all Web Parts in the page
var listWP=[],calWP=[],divs=document.getElementById("MSO_ContentTable").getElementsByTagName("div");
var count=divs.length;
for (i=0;i<count;i++) {
try {
if (divs[i].id.indexOf("WebPartWPQ")==0){
if (divs[i].innerHTML.indexOf("ViewDefault_CalendarView")>=0) {
// Calendars
calWP.push(divs[i].id);
}
else {
// Other Web Parts
listWP.push(divs[i].id);
}
}
}
catch(e){}
}

function TextToHTML(NodeSet, HTMLregexp) {
var CellContent = "";
var i=0;
while (i < NodeSet.length){
try {
CellContent = NodeSet[i].innerText || NodeSet[i].textContent;
if (HTMLregexp.test(CellContent)) {NodeSet[i].innerHTML = CellContent;}
}
catch(err){}
i=i+1;
}
}

var regexpA = new RegExp("\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*$");
var regexpTD = new RegExp("^\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*$");

var WP = new Object;

function UpdateWP() {
if (calWP.length>0){
for (i=0;i<calWP.length;i++) {
WP=document.getElementById(calWP[i]);
if (WP.innerHTML.indexOf("&lt\;")>=0) {TextToHTML(WP.getElementsByTagName("a"),regexpA);}
}
}
if (listWP.length>0){
for (i=0;i<listWP.length;i++) {
WP=document.getElementById(listWP[i]);
if (WP.innerHTML.indexOf("&lt\;")>=0) {TextToHTML(WP.getElementsByTagName("td"),regexpTD);}
}
}
// Check every 200 ms, forever
setTimeout("UpdateWP()",200);
}
UpdateWP();

</script>

30.6.10

XSL per dashboard collegate a dataview in sharepoint designer ? Voilà

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:param name="dvt_apos">&apos;</xsl:param>
    <xsl:variable name="dvt_1_automode">0</xsl:variable>
    <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:WebControls="Microsoft.SharePoint.WebControls">
        <xsl:call-template name="dvt_1"/>
    </xsl:template>
    <xsl:template name="dvt_1">
        <xsl:param name="ParentPath"/>
        <xsl:variable name="dvt_StyleName">Table</xsl:variable>
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
        <xsl:variable name="dvt_RowCount" select="count($Rows)" />
        <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
        <xsl:call-template name="dvt_1.footer">
            <xsl:with-param name="Rows" select="$Rows" />
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="percentformat">
        <xsl:param name="percent"/>
        <xsl:choose>
            <xsl:when test="format-number($percent, '#,##0%;-#,##0%')= 'NaN'">0%</xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="format-number($percent, '#,##0%;-#,##0%')" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="ChartRow">
        <xsl:param name="RowName"></xsl:param>
        <xsl:param name="Value"></xsl:param>
        <xsl:param name="PercentValue"></xsl:param>
        <tr>
            <td class="ms-formbody" width="125px" style="vertical-align:middle">
                <xsl:value-of select="$RowName"/>: <xsl:value-of select="$Value" />
                <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;
            </xsl:text>(<xsl:call-template name="percentformat">
                    <xsl:with-param name="percent" select="$PercentValue"/>
                </xsl:call-template>)
            </td>
            <td>
                <table width="100%" >
                    <tr>
                        <td width="{round($PercentValue*100)+1}%" height="15px" class="ms-selected">
                            <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                        </td>
                        <td width="100%" >
                            <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </xsl:template>
    <xsl:template name="dvt_1.footer">
        <xsl:param name="ParentPath" />
        <xsl:param name="Rows" />
        <xsl:variable name="NotStarted" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Priority) = '(1) Alta'])" />
        <xsl:variable name="InProgress" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Priority) = '(2) Normale'])" />
        <xsl:variable name="Completed" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Priority) = '(3) Bassa'])" />
        <xsl:variable name="AllTasks" select="count(/dsQueryResponse/Rows/Row)" />
        <xsl:variable name="percentNotStarted" select="$NotStarted div $AllTasks" />
        <xsl:variable name="percentInProgress" select="$InProgress div $AllTasks" />
        <xsl:variable name="percentCompleted" select="$Completed div $AllTasks" />
        <table width="100%" cellspacing="0" cellpadding="2" style="border-right: 1 solid #C0C0C0; border-bottom: 1 solid #C0C0C0; border-left-style: solid; border-left-width: 1; border-top-style: solid; border-top-width: 1;">
            <xsl:call-template name="ChartRow">
                <xsl:with-param name="RowName">Alta</xsl:with-param>
                <xsl:with-param name="Value">
                    <xsl:value-of select="$NotStarted"/>
                </xsl:with-param>
                <xsl:with-param name="PercentValue">
                    <xsl:value-of select="$percentNotStarted"/>
                </xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="ChartRow">
                <xsl:with-param name="RowName">Normale</xsl:with-param>
                <xsl:with-param name="Value">
                    <xsl:value-of select="$InProgress"/>
                </xsl:with-param>
                <xsl:with-param name="PercentValue">
                    <xsl:value-of select="$percentInProgress"/>
                </xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="ChartRow">
                <xsl:with-param name="RowName">Bassa</xsl:with-param>
                <xsl:with-param name="Value">
                    <xsl:value-of select="$Completed"/>
                </xsl:with-param>
                <xsl:with-param name="PercentValue">
                    <xsl:value-of select="$percentCompleted"/>
                </xsl:with-param>
            </xsl:call-template>
        </table>
    </xsl:template>
</xsl:stylesheet>

Invio email a gruppo di sharepoint da workflow designer, si ma, …

Puoi farlo si ma,

 

  1. Su SharePoint site
  2. Site Actions
  3. Site Settings
  4. Modify All Site Settings
  5. Users and Permissions
  6. People and groups
  7. Seleziona gruppo interessato
  8. Settings
  9. Group Settings
  10. Group Settings area
  11. Seleziona:  everyone for who can view the membership of the group, click OK.

Migration e Command i

stsadm -o export -url http://win2003-sp2007/sites/Documents/Ticketing -filename migrateD.dat -includeusersecurity -versions 4

 

 

stsadm -o import -url http://win2003-sp2007/destinationsiteEmpty1040 -filename migrate.dat

 

 

stsadm -o createweb -url http://win2003-sp2007/destinationsiteDati1040 -Lcid 1040

 

stsadm -o createsite -url http://win2003-sp2007/sites/destinationMigration1040 -owneremail administrator@win2003-SP2007.com  -ownerlogin win2003-SP2007\administrator -lcid 1033

Allegati (attachments), DataView e Sharepoint Designer e il lupo cattivo

Se aggiungete solo


<xsl:value-of select="@Attachments" />


vedrete solo 'True' o 'False'


Dovete invece aggiugere il controllo sharepoint


<SharePoint:AttachmentsField ControlMode="Display" FieldName="Attachments" runat="server" Visible="true"/>

Nascondere link “Cestino” e “Visualizza tutto il contenuto del sito”

Modifica del file css core.css in

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\ [CODICE LINGUA] \STYLES

 

 

  • per nascondere il cestino

#ctl00_PlaceHolderLeftNavBar_idNavLinkRecycleBin
{
       Visibility:hidden;
}

 

  • per nascondere “Visualizza tutto il contenuto del sito”

#ctl00_PlaceHolderLeftNavBar_idNavLinkViewAll
{
Visibility:hidden;
}

Installare template stp

stsadm -o addtemplate -filename “project-simple.stp” -title “Project site – simple” -description “Project site template with a simple structure”

8.3.10

How to enable the Sharepoint reporting feature from the command line

http://blogs.msdn.com/esosa_en/archive/2007/08/03/how-to-enable-the-sharepoint-reporting-feature-from-the-command-line.aspx

I had a problem with a Sharepoint site recentrly that was not well provisioned and this caused that the audition reports were not displayed on the report site, I was trying to solve the problem with no success for a long time and getting the following error message "The specified web does not contain a reporting metadata list".  I was not able to activate the audit feature from the command line either, so , I had to call to my old friend the command line.  I used the following command:

stsadm -o activatefeature -name Reporting -url http://[server]/[sitecollection]/ -force

I was able to fix my site with that.

I'm still figuring out what was the situatuion that caused this situation, I think that this site was created with a inadecuate template or is a site that was migrated from a previous Sharepoint version, I will post the reason of this behavior as soon as I find it, in the meantime, this post could help some folks with the same problem.

1.3.10

ADAMMembership

<membership defaultProvider="ADAMMembership">

<providers>

<add

name="ADAMMembership"

type="Microsoft.Office.Server.Security.LDAPMembershipProvider,

Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral,

PublicKeyToken=71E9BCE111E9429C"

server="xxx"

port="50000"

useSSL="false"

userDNAttribute="distinguishedName"

userNameAttribute="cn"

userContainer="CN=Users,OU=Support,O=xxx,C=US"

userObjectClass="user"

userFilter="(ObjectClass=user)"

scope="Subtree"

otherRequiredUserAttributes="sn,givenname,cn" />

</providers>

</membership>

27.1.10

SPWebConfigModification, what’s up ?!?

 

//add all web.config entries

private void InsertWebConfigEntries(SPFeatureReceiverProperties properties)

        {

if (!CheckEntries(properties))

            {

using (SPSite site = properties.Feature.Parent as SPSite)

                {

                    SPWebConfigModification dsEntry = GenerateWebConfigEntry("New config key", "configuration/system.web/compilation/assemblies",

"<add assembly=\"Bartomolina.SharePoint.SPBM.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0123456789abcdef\" />", 100);

                    SPWebApplication currentWebApp = site.WebApplication;

                    currentWebApp.WebConfigModifications.Add(dsEntry);

                    currentWebApp.WebService.ApplyWebConfigModifications();

                    currentWebApp.Update();

                }

            }

        }

//check if the web.config entry exists. If you don't call this method you will get duplicate entries

private bool CheckEntries(SPFeatureReceiverProperties properties)

        {

using (SPSite site = properties.Feature.Parent as SPSite)

            {

                SPWebApplication currentWebApp = site.WebApplication;

                Collection<SPWebConfigModification> webConfigEntries = currentWebApp.WebConfigModifications;

foreach (SPWebConfigModification entry in webConfigEntries)

                {

if (entry.Owner == "ReceiverClass")

                    {

return true;

                    }

                }

return false;

            }

        }

//new web.config entry

private SPWebConfigModification GenerateWebConfigEntry(string modName, string sXpath, string sKey, uint iSequence)

        {

            SPWebConfigModification configMod = new SPWebConfigModification(modName, sXpath);

            configMod.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;

            configMod.Name = string.Format("add[@name='{0}']", modName);

            configMod.Owner = "ReceiverClass";

            configMod.Value = sKey;

            configMod.Sequence = iSequence;

return configMod;

        }