Monthly Archives: January 2011

Configuring Sharepoint 2010 for Incoming and Outgoing Emails

Enhanced by Zemanta
Advertisements

Software Systems in Regulated Environments

:Original raster version: :Image:Food and Drug...

Image via Wikipedia

Some importnat links for the beginning:

Solutions:

Enhanced by Zemanta

SharePoint 2010 Backup scripts

Easy backup procedure can be to daily backup the farm and clean the old backups.

Backup script:

Add-PsSnapin Microsoft.SharePoint.Powershell
Backup-SPFarm -Directory \\server_name\backup_folder_name -BackupMethod full

Clean script deletes all backups that are older than 3 days


# Location of spbrtoc.xml
 $spbrtoc = "\\server_name\backup_folder_name\spbrtoc.xml"

# Days of backup that will be remaining after backup cleanup.
 $days = 3

# Import the Sharepoint backup report xml file
 [xml]$sp = gc $spbrtoc

# Find the old backups in spbrtoc.xml
 $old = $sp.SPBackupRestoreHistory.SPHistoryObject |
 ? { $_.SPStartTime -lt ((get-date).adddays(-$days)) }
 if ($old -eq $Null) { write-host "No reports of backups older than $days  days found in spbrtoc.xml.`nspbrtoc.xml isn't changed and no files are  removed.`n" ; break}

# Delete the old backups from the Sharepoint backup report xml file
 $old | % { $sp.SPBackupRestoreHistory.RemoveChild($_) }

# Delete the physical folders in which the old backups were located
 $old | % { Remove-Item $_.SPBackupDirectory -Recurse }

# Save the new Sharepoint backup report xml file
 $sp.Save($spbrtoc)
 Write-host "Backup(s) entries older than $days days are removed from spbrtoc.xml and harddisc."

In order to run the script invoke the following command in powershell (you can put this script into BAT file if you want to run it from the command prompt) :

powershell -command C:\BackupScripts\Script\CleanOldBackups.ps1

We have to run Backup and Clean scripts daily. We can do this by using “Task Scheduler”. Put the call of both scripts into separate BAT files.

Scripts are written in PS1 files.

We call above scripts from BAT files.

Then take the following steps in order to setup daily farm backup.

1. Run the Task scheduler

2. In Task Scheduler create new task (Action / Create Task)

3. Setup the task (here are some screen shots):

See the following links as well:

Enhanced by Zemanta

Customizing the CQWP and Project Portfolio Dashboard creation

My basic goal was to aggregate the information about all the projects within the site collection and present them in a list with some additional formatting (e.g. status icons). The basic webpart, which aggregates data within given location is a Content Query Web Part (CQWP). At first sight this web part is not atractive and has a boring view, but has a very important functionality. When I started investigating, how we can customize the view, I concluded that with some knowledge of XSL, we can build rich views.

Here are the steps, which I took before I started with the CQWP (configuring project portfolio site):

  1. I defined a new content type named “Project statement”, which consists of general project data (e.g. customer, project manager, planed data, start, finish, status, time etc).
  2. Then I created a new site named “Projcet Site” and on this site a list named “Project information”. On this list only “Project statement” content type is allowed. I allow only one item on this list. So, every project has only one “Project statements”,
  3. After that I configured also some other structure, which is typical for the project (libraries, lists, KPI’s etc). Finally, I saved it as site template. With every new project I create a new project site and with each new project site one new “porject statement”.
  4. The only thing that is missing is a project dashboard, which can show me the status of the projects.

Here are the steps, how I basicly configured the project dashboard:

  1. On the site collections home web parts page I inserted a CQWP. If  CQWP is not available, activate “Publishing Infrastructure” feature on the site collection.
  2. Edit Web part. In the “Content Type” section select the desired content type group and then in the “specify your content type.
  3. Now, we have to customize the CQWP according to our needs.

CQWP customization steps are described in in the sites, that are given at the end of this post. Here is my customized style.

    <!--Put header contents here: column name lables write only before first row of data -->
     <xsl:if test="count(preceding-sibling::*)=0">
	<table width="100%">
     	   <tr>
    	       <th align="left" width="20"></th>					<!--Workspace Icon-->
	    	   <th align="left" width="100">Ime projekta</th>
	    	   <th align="left" width="100">Kupec</th>
	    	   <th align="left" width="120">Vodja projekta</th>
	    	   <th align="left" width="20"></th>					<!--Status Icon-->
	    	   <th align="left" width="80">Stanje</th>
	    	   <th align="left" width="120">Vrednost</th>
	    	   <th align="left" width="20">Čas</th>					<!--Time Icon-->
	    	   <th align="left" width="130">Rok</th>
	    	   <th align="left" width="20">Uredi</th>				<!--Edit Icon-->
    	   </tr>
	</table>
    </xsl:if>

   <table style="width:100%;" cellpadding="0" cellspacing="0">
    <tr>
      <!--Workspace icon-->
      <td width="20">
         <a class="Image" href="{substring-before(substring-after(@FileRef,'/'),'/Lists/Izkaznica')}" target="{$LinkTarget}">
	      <IMG>
 	         <xsl:attribute name="border">
 	           <xsl:value-of select="0"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="src">
 	           <xsl:value-of select="'../_layouts/images/mtgicon.gif'"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="alt">
 	           <xsl:value-of select="@Title"/>
 	         </xsl:attribute>
 	      </IMG>
        </a>
      </td>

       <!-- Project name with the link to the project site-->
       <td width="100">
        <a href="{substring-before(substring-after(@FileRef,'/'),'/Lists/Izkaznica')}">
         	<xsl:value-of select="@Title"/>
        </a>
      </td>

       <!-- Customer name -->
      <td width="90">
        <xsl:value-of select="@CustomerName"/>
      </td>

       <!-- Project manager -->
      <td width="120">
        <xsl:value-of select="@ProjectManager"/>
      </td>

      <!--Status Icon-->
      <td width="20">
         <a class="Image" href="{$SafeLinkUrl}" target="{$LinkTarget}">
	      <IMG>
 	         <xsl:attribute name="border">
 	           <xsl:value-of select="0"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="src">
 	           <xsl:value-of select="substring-before(@StateIcon,',')"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="alt">
 	           <xsl:value-of select="@Title"/>
 	         </xsl:attribute>
 	      </IMG>
        </a>
      </td>

      <!--Project Status (text)-->
      <td width="70">
        <xsl:value-of select="@ProjectState"/>
      </td>

      <!--Ammount-->
      <td allign="right" width="100">
         <xsl:value-of select="format-number(@ContractAmmount,'###,###.00 €')"/>
      </td>

      <!--Time icon-->
      <td width="20">
         <a class="Image" href="{$SafeLinkUrl}" target="{$LinkTarget}">
	      <IMG>
 	         <xsl:attribute name="border">
 	           <xsl:value-of select="0"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="src">
 	           <xsl:value-of select="substring-before(@TimeIcon,',')"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="alt">
 	           <xsl:value-of select="@Title"/>
 	         </xsl:attribute>
 	      </IMG>
        </a>
      </td>

      <!--Planned start
      <td width="80" bgcolor="yellow">
        <xsl:value-of select="@PlannedStart"/>
      </td>
      -->

      <!--Due date-->
      <td width="130">
        <xsl:value-of select="@PlannedFinish"/>
      </td>

      <!--Edit icon _ Projcet edit-->
      <td width="20">
         <a class="Image" href="{$SafeLinkUrl}" target="{$LinkTarget}">
	      <IMG>
 	         <xsl:attribute name="border">
 	           <xsl:value-of select="0"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="src">
 	           <xsl:value-of select="'../_layouts/images/edititem.gif'"/>
 	         </xsl:attribute>
 	         <xsl:attribute name="alt">
 	           <xsl:value-of select="@Title"/>
 	         </xsl:attribute>
 	      </IMG>
        </a>
      </td>

      <!--Actual project start date
      <td width="80">
        <xsl:value-of select="@ActualStart"/>
      </td>
      -->

      <!--Actual project finish date
      <td width="80">
        <xsl:value-of select="@ActualFinish"/>
      </td>
      -->

    </tr>
    </table>

	<!--Put footer contents here: only after last row of data
     <xsl:if test="count(following-sibling::*)=0">
	<table bgcolor="yellow" width="100%">
     	   <tr>
	        <td>Footer</td>
    	   </tr>
	</table>
    </xsl:if>
    -->

    </xsl:template>

And here you can see my final product (customized CQWP, which includes icons and some other formated text):

As you can see I used standard SharePoint icons because it is much easier for maintanance of the system.

I gathered helpful  information to solve my challange (customizing CQWP) on the following sites:

Enhanced by Zemanta

SharePoint 2010 Icons

Insted of using custom icons, we can use standard SharePoint icons. We can find them on the server on the following location:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES

The path to the desired icon, which we have to refer,  is as follows:
http://your_server_name/_layouts/images/mtgicon.gif        ( This is a WORKSPACE ICON.)

Here are the names of some interesting icons:
ARRDOWNA.GIF
ARRDOWNI.GIF
ARRLEFTNA.GIF
ARRLEFTNI.GIF

CALENDAR.GIF
CHECK.GIF

kpidefault-0.gif         GREEN Dot
kpidefault-1.gif         YELLOW TRIANGLE
kpidefault-2.gif         RED DIAMOND

kpinormal-0.gif        GREEN DOT WITH CHECK MARK
kpinormal-1.gif        YELLOW DOT WITH EXCLEMATION MARK
kpinormal-2.gif        RED DOT WITH CROSS

kpipepperalarm-0.gif    GREEN SEMAPHHOS
kpipepperalarm-1.gif    YELLOW SEMAPHOR
kpipepperalarm-2.gif    RED SEMAPHOR

kpipeppers-0.gif    GREEN DOT
kpipeppers-1.gif    YELLOW DOT
kpipeppers-2.gif    RED DOT

kpitrend-0.gif        GREEN ARROW UP
kpitrend-1.gif        GREEN ARROW LEFT UP

kpitrend-4.gif        GREEN ARROW DOWN

kpiryg-0.gif        GREEN SEMAPHOR (interesting)
kpiryg-1.gif        YELLOW SEMAPHOR (interesting)
kpiryg-2.gif        RED SEMAPHOR (interesting)

LOGO.GIF

Chance (Lateral puzzle)

Elegantly dressed man was sitting on the chair and nervously watching the clock. After half an hour he was aware that he lost a good chance. What happened?

Here is the answer >He lost a chess game.< (select text)

Enhanced by Zemanta

SharePoint 2010, Site Workflow

Site workflow is connected to the site and we can use it to perform actions on different lists, libraries and items. In this short description I provide information how to create a new item on a list by using “Site Workflow”.

At first we create a custom list with the desired columns, which we will use in this example. Let say we have a list of ideas, that are submited by employees.

Now start editing the site in designer (SiteActions/Eidt in SharePoint Designer).

Create a new site workflow (Workflows/Site Workflow icon on ribbon). With this workflow we will “Create item” on the “Idea” list.

We will create a new item on one of the lists on our site. In our example it is “Ideas” list. We have to provide the user a special form to fill in the data, because our workflow is not connected to the list of ideas. If we would use a new command directly on the list, the new item form od that list is displayed. But in this case we have to use “Initiation Form Parameters” command. When the dialog opens, we have to add all the fields that we need from the user to fill in in order to create a new item on the “Idea” list.

Now select the desired list and connect parameters with the “Idea” list columns. In this example I connected only one filed (only Description filed; other columns take default values or are calculated).

When the workflow is finished, save it and publish.

To find the site workflows, follow the next pictures:

When you start the workflow, the following form opens. Fill it out and finish the form.

The result is a new item on the “Idea” list.

You can redesign form by using InfoPath Designer tool. Open the form from the SharePoint Designer.

Edit the form (e.g. insert text, format fonst, insert pictures etc.). When you finish editing, publish the form back to the workflow. How to do this properly you can see on the second picture.

Now invoke the site workflow once again. You will get the new form:

Of course, you won’t use “Site Workflow” just to add new items to the lists. It is just an example, how we can use workflows that are not connected to listst or content types and do actions on items in different places around one site.

There is one other important thing and that is how to simply invoke the workflow from anywhere on the site, by clicking on the link. Simply, copy the current explorer address when the site workflow initation form is opened and use it on menu or quick launch.

Enhanced by Zemanta

Overview: Creating Workflows with SharePoint Designer 2010, InfoPath 2010 and Visio 2010 | Matthijs Hoekstra | Channel 9

Overview: Creating Workflows with SharePoint Designer 2010, InfoPath 2010 and Visio 2010 | Matthijs Hoekstra | Channel 9.

Enhanced by Zemanta

Building SharePoint Workflows with SharePoint Designer and Visio

SharePoint Workflow Authoring in Visio Premium 2010 (Part 1) – Visio Insights – Site Home – MSDN Blogs.

SharePoint Workflow Authoring in Visio Premium 2010 (Part 2) – Visio Insights – Site Home – MSDN Blogs.

Transfer workflows between SharePoint Designer and Visio – SharePoint Designer – Microsoft Office.

Enable the SharePoint 2010 Workflow Visualizations

To use Visio 2010 for workflow visualization, you must be running the Enterprise version of SharePoint Server 2010 and Visio 2010 Premium. Browser visualizations are only available for SharePoint Designer workflows. So it is not available for Workflows built using Visual Studio 2010 or any other tool.

To configure the workflow visualization on the SharePoint 2010 follow the instructions on the following link:

Enable the SharePoint 2010 Workflow Visualizations

I used to have the problem, that is solved according to the following procedure (be careful at the end; the visualization does not to apply to already running instances of your Workflow, only for the new ones):

The Unattended Service Account Application ID is not specified or has an invalid value

This site is helfull for the further steps on creating Workflows for SharePoint in Visio 2010:

Installing and Configuring Visio Services – Visio Insights – Site Home – MSDN Blogs.

Enhanced by Zemanta