K2 Blackpoint In one way trust environment – process not showing as running in K2 Process Portal

By peter.stilgoe









Configuring K2 Blackpoint in a one way trust as per previous post. Deployed a new process & then triggered it by creating a new document. The process started & I could click on it & see it as ‘In progress’.

When I went to the K2 Process Portal the ‘Processes’ webpart showed the process as deployed with all the relevant data. However the process never displayed in the K2 Worklist webparts nor did it show as ‘Running’ in the K2 Instance Summary Webpart.

This is because the account that you are using to run your Sharepoint web application needs ‘Admin’ & ‘Impersonate’ rights on the K2 server.

Share

Leggi tutto

The K2 Setup Manager requires the logged on user to have domain user privileges to proceed

By peter.stilgoe









Installing K2 Blackpoint / Blackpearl in a one way trust environment you need to run the K2 server service account & application pool using an account from the ‘trusted’ domain. It is also recommended that you install K2 components using this account:

Note: It is recommended to install all K2 components using the K2 Service Account. Log on to the server as the K2 Service Account before installing.

However if you try you will get the following error:

“The K2 Setup Manager requires the logged on user to have domain user privileges to proceed”

As you are in a one way trust environment you cant easily give the required permissions (if at all) so the work around is –

“If you have a scenario where you have multiple domains, you can disable the Installer’s domain check. 1. Please browse to the directory where you are executing the installation files from. 2. Look for an configuration file called product.config. This file will reside in the installer directory. 3. Please edit the file and change the Domainusercheck from true to false as shown below. 4. Save the file and execute the setup.exe again.

setting key=”domainusercheck” value=”false”

source: K2underground

Share

Leggi tutto

How to restart the Sharepoint Timer Service (SPtimer)

By peter.stilgoe









SharePoint 2010: net stop SPTimerV4 / net start SPTimerV4

SharePoint 2007: net stop SPTimerV3 / net start SPTimerV3

SharePoint 2003: net stop SPTimer / net start SPTimer

Share

Leggi tutto

K2 Blackpoint Blackpearl not showing in Sharepoint Central Administration

By peter.stilgoe









If you are installing K2 Blackpoint / K2 Blackpearl in a distributed Sharepoint environment, you install K2 for Sharepoint on your web front ends but the K2 section still doesnt appear in Sharepoint Central Administration.

This is probably because you are hosting your central admin web app on a different server ie. an application server, if this is the case you need to install K2 on this server hosting your central admin as well as your Sharepoint Web Front End servers.

Share

Leggi tutto

Sharepoint CQWP: XSL to link document icon to document and open in edit mode

By peter.stilgoe









The xsl code will display & make the document icon link to the sepcific document & open it in edit mode in your content query webpart:

<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
                   <xsl:attribute name="onclick">
                     <xsl:value-of select="@OnClickForWebRendering"/>
                   </xsl:attribute>
                 </xsl:if>
                 <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                   <xsl:attribute name="onclick">
                     <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                   </xsl:attribute>
                 </xsl:if> 

                 <img class="image" src="{@DocumentIconImageUrl}" title="" />
				 </a>




Share

Leggi tutto

Sharepoint CQWP How to format date from mm/dd/yyyy to UK dd/mm/yyyy

By peter.stilgoe









To format your Sharepoint content query webpart to UK date format do the following:

In your ItemStyle.xsl add the following line to your declarations:

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"

Then use the following line to display & format your date field in UK date format:

<xsl:value-of disable-output-escaping="no" select="ddwrt:FormatDate(string(@Modified), 2057, 5)" />

@Modified is your date field that you want to format




Share

Leggi tutto

How to rename your web application in Sharepoint Services & MOSS

By peter.stilgoe









Syntax:
stsadm -o renameweb -url -newname

Example:
Stsadm -o renameweb -url http://localhost/oldname -newname newname

The above command will rename the web application from oldname to the newname.




Share

Leggi tutto

Sharepoint Workflow Task Error: This task is currently locked by a running workflow and cannot be edited

By peter.stilgoe









Error in Event Log on Sharepoint Server: This task is currently locked by a running workflow and cannot be edited

When a workflow processes a task normally, the following sequence of events is expected to occur:

1. The process begins.

2. The workflow places a ‘lock’ on the task so nothing else can change the values while the workflow is processing.

3. The workflow processes the task.

4. The lock is released when the task processing is finished.

The error occurs because the lock never gets released, which usually occurs between steps 2 – 4. You can read more from this forum post.

http://connect.nintex.com/forums/thread/6503.aspx

Anyway I was getting this problem in a K2 Blackpoint / Blackpearl workflow which was preventing my workflow from moving to the next step. I resolved it by creating a new task list & pointing my K2 process to the new task list, no locking errors & the workflow runs fine now.

You may get similar errors with any workflow product ie. Nintex, Sharepoint Designer Workflow, C# Workflow etc, anything that uses the Sharepoint Workflow Engine & Sharepoint Task Lists.




Share

Leggi tutto

Sharepoint – How to setup a one way trust & required ports

By peter.stilgoe









1. Open Command Prompt.
2. Type: netdom trustTrustingDomainName/d:TrustedDomainName/add

TrustingDomainName – Specifies the DNS name (or NetBIOS name) of the trusting domain in the trust being created.

TrustedDomainName – Specifies the DNS name (or NetBIOS name) of the domain that will be trusted in the trust being created.

• To perform this procedure, you must be a member of the Domain Admins group or the Enterprise Admins group in Active Directory, or you must have been delegated the appropriate authority. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups [http://technet2.microsoft.com/WindowsServer/en/library/f6e01e51-14ea-48f4-97fc-5288a9a4a9b11033.mspx], Default groups [http://technet2.microsoft.com/WindowsServer/en/library/1631acad-ef34-4f77-9c2e-94a62f8846cf1033.mspx], and Using Run as [http://technet2.microsoft.com/WindowsServer/en/library/8782f8ab-9538-4111-8a68-7bfd130c21c01033.mspx].
• To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.
• This command-line method requires the Netdom Windows support tool. For information about installing Windows support tools, see Related Topics.
• Other switches can be used to assign a password or determine the direction of the trust. For example, to make a two-way, transitive trust, you can use the following syntax:
netdom trustTrustingDomainName/d:TrustedDomainName/add/twoway
• To view the complete syntax for this command, at a command prompt, type:
netdom trust | more

One Way trust validation

Inbound
————–

LDAP 389 UDP and TCP
MS DS 445 TCP
DCE Endpoint resolution – portmapper 135TCP
Netlogon fixed port

Using object / people picker

Outgoing
—————
LDAP 389 UDP and TCP
LSA fixed port
Kerberos 88 UDP
DCE endpoint 135 TCP

Netlogon to external forest with NTLM

Outgoing
————

DCE endpoint 135 TCP
netlogon fixed port




Share

Leggi tutto

K2 Blackpoint Blackpearl – How to update a Sharepoint list items using common meta data

By peter.stilgoe









In a K2 Sharepoint process you will quite often have to update the same piece of meta data in multiple locations ie. you have a status column which is part of the list your process is attached to but you may need to reflect this status update on another list item in another list for reporting purposes or something similar. Your lists will need to have a common piece of metadata like a ‘reference number’ or something similar in order for you to return the List IDs’.

You can do this fairly easily using the ‘Sharepoint Search’ event wizard in K2.

- Drop the Sharepoint Search Event wizard on to your design canvas

- Choose ‘Search in a Sharepoint List or Library’ this will just search the specific list your point it at

- Add the URL of the Sharepoint site where the list resides & pick the list you want to search

- Now specify you search parameters ie

Content Type: Order

Field: Reference Number

Operator: Equal

Value: Order Number (This column exists on your other list ie. the one attached to your existing process)

This is now searching your list for a reference number that matches the order number on your original list.

- Create a content field in order to store the results on the next screen

- Finish the process and save

- Now if you go into your process explorer you can browse your new content field that will contain the List ID of your item everytime your search event fires

ie. Object Browser –> XML Fields –> ‘Process Name’ –> ‘Content Field Name’ –> Items –> Item –> Item (This contains the List Item ID of the item you wish to update on the other list)

ps: I wrote this in a hurry which is probably apparent!




Share

Leggi tutto

How to delete a corrupted Sharepoint list

By peter.stilgoe









Sometime you will find you have a currupted list that you cant delete through the normal way as when you try & access the list or the list settings the webpage throws errors. In this case use STSADM

stsadm.exe -o forcedeletelist -url http://devapp01/Lists/<MyListName>/

Share

Leggi tutto

Creating custom reports using K2 Blackpoint and ADO.net

By peter.stilgoe









In K2 Blackpearl you have access to a K2 Report Designer making it fairly easy to create custom reports, however in Blackpoint there is no report designer. The good news is you can still create custom reports by creating a new Web Application in Visual Studio & using the ADO.net provider that ships with Blackpoint for interacting with Smartobject data.

“K2 blackpoint ships with an ADO.net provider for interacting with SmartObjects. This includes any SmartObjects that you create against SharePoint content, Workflow SmartObjects that you can configure when designing your process, as well as some pre-configured reporting SmartObjects which are used by the out of the box reports in the process portal.

The ADO.net provider allows you to build ASP.net forms as well as SQL Reporting Services reports in much the same way as you would use any other ADO.net provider.

Today I will show you the ASP.net example. The recording attached to this post also discusses using the ADO.net Provider in a SQL Reporting Services report. The configuration of the data source is similar for ASP.net and SQLRS.

For this example I have created a basic web page project. There are 2 things that you will need to configure to ensure that your ASP.net page works properly with the data provider”

Read more Creating Custom Reports With K2 Blackpoint

Share

Leggi tutto

Modifying an Open XML Document in a SharePoint Document Library

By peter.stilgoe









C# Console Application code to query a Sharepoint Library, Open a document, Make a change & then save the document.

You need references to WindowsBase.dll, Microsoft.Sharepoint & DocumentFormat.OpenXml

You also need to ensure your project is .Net 3.5 & set to target ‘Any CPU’ in the project properties.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using Microsoft.SharePoint;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;

class Program
{
 static void Main(string[] args)
 {
 string siteUrl = "http://localhost";
 using (SPSite spSite = new SPSite(siteUrl))
 {
 Console.WriteLine("Querying for Test.docx");
 SPList list = spSite.RootWeb.Lists["Shared Documents"];
 SPQuery query = new SPQuery();
 query.ViewFields = @"<FieldRef Name='FileLeafRef' />";
 query.Query =
 @"<Where>
 <Eq>
 <FieldRef Name='FileLeafRef' />
 <Value Type='Text'>Test.docx</Value>
 </Eq>
 </Where>";
 SPListItemCollection collection = list.GetItems(query);
 if (collection.Count != 1)
 {
 Console.WriteLine("Test.docx not found");
 Environment.Exit(0);
 }
 Console.WriteLine("Opening");
 SPFile file = collection[0].File;
 byte[] byteArray = file.OpenBinary();
 using (MemoryStream memStr = new MemoryStream())
 {
 memStr.Write(byteArray, 0, byteArray.Length);
 using (WordprocessingDocument wordDoc =
 WordprocessingDocument.Open(memStr, true))
 {
 Document document = wordDoc.MainDocumentPart.Document;
 Paragraph firstParagraph = document.Body.Elements<Paragraph>()
 .FirstOrDefault();
 if (firstParagraph != null)
 {
 Paragraph testParagraph = new Paragraph(
 new Run(
 new Text("Test")));
 firstParagraph.Parent.InsertBefore(testParagraph,
 firstParagraph);
 }
 }
 Console.WriteLine("Saving");
 string linkFileName = file.Item["LinkFilename"] as string;
 file.ParentFolder.Files.Add(linkFileName, memStr, true);
 }
 }
 }
}

Code written by Eric White

Share

Leggi tutto

Sharepoint Object Model C# Error The Web Application at could not be found. Verify that you have typed the URL correctly

By peter.stilgoe









When running some C# code containing a reference to SPSite ie

        string siteUrl = "http://devapp01/";
        using (SPSite spSite = new SPSite(siteUrl))

I was getting the following error:

The Web Application at could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

Looking at various forums people have spent along time troubleshooting this problem, in my case it was easily fixed by:

Go to Project Properties -> Build -> Target Platform -> Make it Any CPU (default is x86)

Share

Leggi tutto

Page cannot be found when trying to view a K2 Sharepoint Workflow Integration Task

By peter.stilgoe









If you are creating a K2 Blackpearl / K2 Blackpoint process using the ‘Sharepoint Workflow Integration Client’ and when trying to open a particular task item to complete it & you get a ‘page cannot be found’ error in you web browser, its probably because the task title in your workflow contains a ‘&’ char.

Replace ‘&’ with ‘and’ or something and you will be able to view & complete your K2 task as expected.

Share

Leggi tutto

When trying to view K2 Blackpoint Blackpearl report error: ‘Microsoft.ReportViewer.WebForms The system cannot find the file specified

By peter.stilgoe









When trying to view a K2 Blacpoint or Blackpearl report in a process portal you get the following error:

An error has occurred trying to load the settings for the report. N/A:Could not load file or assembly ‘Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

In my case the reason was that I needed to install the Microsoft Report Viewer Redistributable 2008 on my server(s). Once installed do an IISreset & all reports should render as expected.




Share

Leggi tutto

How to display a URL in a DVWP using the XSLT ‘substring’ function

By peter.stilgoe









The code below will use the URL held in View_x005F_x0020_Flow but will only use the URL part before the comma

ie original URL

www.petestilgoe.com/&=testing,testing123

<a href="{substring-before(@View_x005F_x0020_Flow, ',')}">View Flow</a></td></tr>

URL after using the above code is:

www.petestilgoe.com/&=testing

Share

Leggi tutto

How to get the current List Item ID in a K2 Blackpoint / Blackpearl process

By peter.stilgoe









The current list item ID in a K2 Blackpoint / Blackpearl process is held in the ‘SpIntegrationData’ hive in XML fields. This hive is hidden by default so in the Object Explorer window you need to click the down arrow top right hand side & click ‘Show Hidden Fields’.

SPIntegrationData –> SPData –> All available data fields show here

This data is populated as soon as the process is started.

Share

Leggi tutto

K2 Blackpoint / Blackpearl: Using Sharepoint lookup columns in K2 processes

By peter.stilgoe









As you probably know lookup columns in Sharepoint are stored in this format “ID;#String” (record number & then the string value). I was trying to use a lookup value in a K2 process to make up the new sites URL when provisioning new sites. Obviously this was failing due to the way lookup columns are stored ie. illegal characters ID;#String.

You can get round this by using the K2 ‘Code Reference Event’

1) Add a ‘Code Reference Event’ to one of your activity containers on the K2 canvas.

2) Give the code event a name

3) Event Method Editor –> Call Constructor –> Add Reference –> Microsoft.Sharepoint.dll

4) Now on the Select Constructor Screen: Microsoft.Sharepoint –> SPFieldLookUpValue –> Constructor(String fieldValue)

5) Assign your Sharepoint Lookup Column to the fieldValue parameter

6) Now map the LookupValue field to whichever field you wish to store the lookup string value in, set ‘Retrieve Value’ and tick ‘after’

7) Now the field you chose to store the lookup string value will contain just the string without the prefix ID;# and can be used throughout the rest of your K2 process.

Share

Leggi tutto

Sharepoint Server Template Numbers

By peter.stilgoe









100 Generic list
101 Document library
102 Survey
103 Links list
104 Announcements list
105 Contacts list
106 Events list
107 Tasks list
108 Discussion board
109 Picture library
110 Data sources
111 Site template gallery
112 User Information list
113 Web Part gallery
114 List template gallery
115 XML Form library
116 Master pages gallery
117 No-Code Workflows
118 Custom Workflow Process
119 Wiki Page library
120 Custom grid for a list
130 Data Connection library
140 Workflow History
150 Gantt Tasks list
200 Meeting Series list
201 Meeting Agenda list
202 Meeting Attendees list
204 Meeting Decisions list
207 Meeting Objectives list
210 Meeting text box
211 Meeting Things To Bring list
212 Meeting Workspace Pages list
300 Portal Sites list
301 Blog Posts list
302 Blog Comments list
303 Blog Categories list
850 Page Library
1100 Issue tracking
1200 Administrator tasks list
2002 Personal document library
2003 Private document library

Share

Leggi tutto