Author Archive

Where in the world is Mark and is he still working on SharePoint?

Thursday, October 23rd, 2008

Well, I write that title as I am sitting on a plane heading back home to FL.  Sorry for the lack of recent posts.  It is not because I am not knee-deep in SharePoint.  My current client engagement keeps me quite busy as my colleagues will attest to.  Most of my MVP colleagues who see me on messenger also can appreciate the busy schedules.  I have a lot of different projects going on, some with MOSS but my biggest project is still working to get to MOSS.  There is a lot of customization to attend to and I hope to post some notes at the beginning of the year.  With that said, what are you all looking for information on?  I am surfing for blog topics so please feel free to reply back wth some.   Are you interested in general opinions on functionality?  Are you looking for step-by-steps and how to's?  You tell me…. open forum! ;)

I'll await your replies… <as the cabin door closes>

Mark

Alert: Major Internet Security Flaw

Wednesday, August 6th, 2008

All of us in the SharePoint community need to get the word out on this one: http://latimesblogs.latimes.com/technology/2008/08/internet-securi.html

"Acclaimed Internet security researcher Dan Kaminsky detailed a flaw in the current architecture of the Internet today, firing the starting gun for a race between hackers who can now take advantage of the vulnerability and the big companies who have yet to patch their systems…"

Get in touch with your IT folks to make sure your servers have been updated.  This vulnerability enables hackers to bypass any SSL due to a vulnerability at the DNS level.  You cant patch your machine since this is coming from the DNS.  Check out the link to read the full article.

 

Content Query Web Part – Unable to Activate the Publishing Infrastructure

Wednesday, March 19th, 2008

So you want the Content Query Web Part but you're running into issues implementing it… First let's go over what the web part does.  A great overview is provided by the Microsoft ECM Team: Configuring and Customizing the Content Query Web Part.  To summarize, the web part shows content from your site or aggregated content from multiple sites in a collection based on a query.  You also have the ability to filter and apply additional rules to the query.  Here's another nice Content Query Web Part Overview from Microsoft's SharePoint Designer page.Ok, so you're using one of the default templates that display the Content Query Web Part by default.  As a crafty MOSS administrator, you've gone to your Site Settings -> Manage Web Parts and added the Content Query Web Part manually but it still doesn't work.  You've cursed and grumbled and you've googled away.  You now realize you need the Publishing Feature or the appropriate template to make it work but when you try to enable the Publishing Feature you run into the following error:
'One or more features must be turned on before this feature can be activated: Office SharePoint Server Publishing Infrastructure'

So now you're here and will find the information to make this your final stop to resolve the issue.

Issue Details

I am trying to enable the 'Office SharePoint Server Publishing' feature on a site collection through: Site Settings > Site Administration > Site features

When I click the 'Activate' button I get the following message: 'One or more features must be turned on before this feature can be activated: Office SharePoint Server Publishing Infrastructure'

There is no option to activate the 'Office SharePoint Server Publishing Infrastructure' feature in the 'Site features' list.

I opened Central Admin and went to Application Management > Manage Web application features, however, there is still no option to activate 'Office SharePoint Server Publishing Infrastructure'

Resolution

After some digging and research I found that the 'Office SharePoint Server Publishing Infrastructure' site feature won't appear unless you are explicitly set as a Site Collection Administrator, regardless of being set as `site owner.'   This can be a common issue if you are in an organization where the IT folks have the keys to the kingdom.  Once added as a Site Collection Administrator in SharePoint Central Admin, you can see and then enable the feature at the top level.   Phew. a relief!   The Publishing Infrastructure Feature appeared as you can see in the screenshot below. 

 

Note: Also verify that the user appears in Site Settings -> Site Collection Administrators.  

 


However, if you run into an Access Denied error (seen in the screenshot below), this can typically be resolved by following the steps indicated here or referring to the IT folks who may have the elevated rights you need:

http://blog.thekid.me.uk/archive/2007/02/05/activating-office-sharepoint-server-publishing-infrastructure-access-denied.aspx

 

   

 Additional Information

ú         Ishai Sagi [MVP] has created an enhanced content query web part, which now has properties that expose the Common View Fields to the user in the web interface, so there is no longer need to export-import.  http://www.sharepoint-tips.com/2007/06/adding-custom-fields-to-enhanced.html

ú         Check out Heather Solomon's [MVP] article: Customizing the Content Query Web Part and Custom Item Styles

 

Free SharePoint DataView Tips

Tuesday, June 26th, 2007

 

Free SharePoint DataView Tips

Hey Everyone… I know I've been out of touch but I wanted to post some DataView tips that I think people will find very useful.  I hope you do as well :o )  Do you have one you'd like to share that you can't live without?  Drop me a line and I'll add it to this list giving full credit.

 

Tip 1: Most people do not realize that when you create a DataView within FrontPage that you are actually connecting to the List's default view of the data.  This is a frustrating exercise to try and figure out why a newly created column doesnt display in your dataview regardless of how many times you refresh your content.  Save yourself a lot of time and frustration and make sure the columns are displayed in your default views.

 

Tip 2: If you're working with DataViews, you've probably run into a lot of frustration when trying to put conditional formatting on dates (i.e. only display items in the past or future using [Today]).  Well most programmers will hit the code and add scripts and modify the XSLT all over the place.  Your FrontPage experts will have you do numerous clicks to format the data and then do your comparisons.  Well, the easiest way to do this conditional formatting is to do it in the list itself.  As mentioned above, DataViews use the default view of your list.  Just modify columns and settings on your list and apply the quick and easy filter to the default view.  Once you create your DataView, you'll pick up the default views with conditional formatting already done.  There's a lot less overhead to applying the filter to the data since it is already done making your page load much quicker without the XSLT overhead ;o)

 

Tip 3: Have you had tried groupings in your DataView?  You'll notice right away that you lose some basic functionality of displaying the number of items in a grouping.  Here's some code to get you through that. 

The following returned the total number of items in the list:

<xsl:otherwise><xsl:value-of select="$fieldvalue"/> : <xsl:value-of select="count($nodeset)"/></xsl:otherwise>

 

The following returned the number of list items in the grouping (Default functionality in non-dataview List Views):

<xsl:value-of select="$fieldvalue"/> : <xsl:value-of select="count($nodeset[*[name()=$fieldname]=$fieldvalue or ($fieldtype!='isodatetime' and @*[name()=$fieldname]=$fieldvalue) or ($fieldtype='isodatetime' and ddwrt:GenDisplayName(string(@*[name()=$fieldname]))=$fieldvalue) or (not(*[name()=$fieldname] or @*[name()=$fieldname]) and $fieldvalue = ' ')]/@ID)"/>

 

 

Tip 4: Do you want your DataView to display a document type icon and have it render based on document type?  Try this within your XSLT:

<!–DocIcon–><!–Type–><xsl:choose><xsl:when test="@FSObjType='1'"> <xsl:choose> <xsl:when test="ddwrt:GetVar('RecursiveView')='1'"> <IMG BORDER="0" ALT="Icon" src="/_layouts/images/folder.gif" mce_src="/_layouts/images/folder.gif"/> </xsl:when> <xsl:otherwise> <A TABINDEX="-1" href="{@FileRef}BLOCKED SCRIPTSubmitFormPost()" mce_href="{@FileRef}BLOCKED SCRIPTSubmitFormPost()" onclick="BLOCKED SCRIPTClearSearchTerm('{$View}');BLOCKED SCRIPTSubmitFormPost('{$FilterLink}');BLOCKED SCRIPTreturn false;"> <IMG BORDER="0" ALT="Icon" src="/_layouts/images/folder.gif" mce_src="/_layouts/images/folder.gif"/> </A> </xsl:otherwise> </xsl:choose> </xsl:when>

 

Tip 5: Do you want to add a “New!” icon to your DataView?  Try this in your XSLT:

<xsl:if test="not(number(translate(substring-before(@Created,'T'),'-','')) < number(translate(substring-before($Today,'T'),'-','')))"><img border="0" src="/_layouts/1033/images/new.gif" mce_src="/_layouts/1033/images/new.gif"/></xsl:if>

 

Tip 6: If you've been working with DataViews you'll notice that Lookup fields do not translate well.  They are formatting with the title and the value of the data and are separated by special characters.  Here's how you can deal with this (Thanks to the Dean for refreshing my memory a few months back):

<xsl-value-of select="substring-after(@YourFieldName, '#')">

 

Tip 7: This tip comes from Pankaj Joshi who was working with a Multi-Choice checkbox field titled "Sub Network".  For the line:

[code] <xsl:value-of select="@Sub_x002d_Network"/> [/code] 

The output for two selected sub networks returned is:

[code];#Network A;#Network B;#[/code] 

If you change the xslt to:

[code]

<xsl:value-of select="substring(substring(translate(translate(@Sub_x002d_Network, ';', ','), '#', ' '),2),1,string-length

(substring(translate(translate(@Sub_x002d_Network, ';', ','), '#', ' '),2))-2)"/>

[/code]

Your new output will look like

[code]

Sub-network A, Sub-network B

[/code]

 

Tip 8: Another Multi-Choice checkbox field alternative to formatting… let's say you have a choice field with three options selected.  When you go to data view, you see something like ";#Option1;#Option2;#Option3;#"

The XSLT will look like this:

[code] <xsl:value-of disable-output-escaping="no" select="@FIELDNAME"/> [/code]

Change the line to:

[code]

<xsl:call-template name="stringreplace">

<xsl:with-param name="stringvalue" select="substring-after(@FIELDNAME,';#')"/>

<xsl:with-param name="from" select="';#'"/>

<xsl:with-param name="to" select="'; '"/>

</xsl:call-template>

[/code]

Include this template if it does not already exist:

[code]

<xsl:template name="stringreplace">

            <xsl:param name="stringvalue"/>

            <xsl:param name="from"/>

            <xsl:param name="to"/>

            <xsl:choose>

                <xsl:when test="contains($stringvalue, $from)">

                    <xsl:value-of select="substring-before($stringvalue, $from)"/>

                    <xsl:if test="contains(substring($stringvalue, 1, string-length($stringvalue) - 1), $from)">

                        <xsl:value-of select="$to"/>

                        <xsl:call-template name="stringreplace">

                            <xsl:with-param name="stringvalue" select="substring-after($stringvalue, $from)"/>

                            <xsl:with-param name="from" select="$from"/>

                            <xsl:with-param name="to" select="$to"/>

                        </xsl:call-template>

                    </xsl:if>

                </xsl:when>

                <xsl:otherwise>

                    <xsl:value-of select="$stringvalue"/>

                </xsl:otherwise>

            </xsl:choose>

        </xsl:template>

[/code]

Note: The rendered view in FrontPage will chop the first value off.  For some reason (a bug?) the interface places a semicolon ";" right before the first value when rendered over the web but FrontPage does not render that first semicolon.  To see this in action replace the substring-after function with:

[code]

<xsl:with-param name="stringvalue" select="@FIELDNAME"/>

[/code]

Good luck!

Free SharePoint Web Parts (3rd Party)

Tuesday, June 26th, 2007

Free SharePoint Web Parts (3rd Party)

FrontPage Resources

HowTo's and Tips

KBAlertz – SharePoint

MOSS Tools

MSDN Technical Articles

Office 2007

Other Tools

SDKs & Guides

SharePoint Newsgroups

SharePoint Resources (Microsoft)

SharePoint Resources (Non-MS)

SharePoint Service Packs

SharePoint Tools

HowTo: Using SharePoint Calculated Columns to Display a List Item as "X" Days Old

Tuesday, June 26th, 2007

 

HowTo: Using SharePoint Calculated Columns to Display a List Item as "X" Days Old

 

I've had numerious requests asking how to display a List Item's age.  Well, in order to do this you'll have to first refer to my previous blog post:

Using [Today] in a Calculated Formula (Birthday Lists) which explained how to enable the [Today] functionality within a SharePoint lists' calculated column.  The example provided explained how you could create a Birthday List to display a list of contacts who have birthdays in the current month.

Ok, now on to this task.  First you'll need to create your Today column as mentioned in the previous post.  Then you'll then need to create a new calculated column in your SharePoint list (“Post is X Days Old”) and include the following formula for the calculated column:

=YEAR(Today)-YEAR(Created)-IF(OR(MONTH(Today)<MONTH(Created),AND(MONTH(Today)=MONTH(Created), DAY(Today)<DAY(Created))),1,0)&" years, "&MONTH(Today)-MONTH(Created)+IF(AND(MONTH(Today) <=MONTH(Created),DAY(Today)<DAY(Created)),11,IF(AND(MONTH(Today)<MONTH(Created),DAY(Today) >=DAY(Created)),12,IF(AND(MONTH(Today)>MONTH(Created),DAY(Today)<DAY(Created)),-1)))&" months, "&Today-DATE(YEAR(Today),MONTH(Today)-IF(DAY(Today)<DAY(Created),1,0),DAY(Created))&" days"

Once that column is created, you can delete the “Today” column and view the list. The result of each list item will look something like this depending on the age of the item:

I hope this tip answers the questions I was receiving. :)

 

References: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q214094

 

I just had a comment below that I thought I would bring up to the article level. 

Question: Can you simplify this formula to just display days old?

Answer:  Yes, by simply using the following

= Today – Created 

Just make sure you format the calculated column to return a number and set the decimal to zero otherwise you'll get decimal places respresenting hours.

Note: Remember from the previous article that the formula will not calculate all list items on refresh but rather by the addition and deletion of a new “Today” column or by editing each of the list items individually.  However, you can code this to make it more dynamic but this is just a tip to get people in the right direction.  

 

Posted by Mark Kruger

Using [Today] in a Calculated Formula (Birthday Lists) – SPS/WSS 2003 NOT MOSS!!

Tuesday, June 26th, 2007

 

Using [Today] in a Calculated Formula (Birthday Lists)

For the last time, this is not MOSS!

 

Ok, we all know that SharePoint loves to complain about how you can't use [Today] in a calculated column.

 

"TODAY – Returns the serial number of the current date. The serial

number is the date-time code used for date and time

calculations.

Note  You can only use the TODAY function as a default

value; you cannot use it in a calculated column.")

 

Well, I can't take credit for this one but I found this thread in the forums by a gentleman named Pete Blair… I also was watching a thread at SharePointU so I thought it was worthy of a Blog post to answer once and for all! ;)

It is possible to use "Today" in a function as a reference to today's date

(despite what SharePoint tells you).  There is a very simple work around that

doesn't involve very much effort or complexity.

 

  1. First, create a new column in your list with the column name of "Today".  
    Click "OK".  (It doesn't matter what type of column or data it is, this is
    just a place holder and will be removed later).
    MK Note: Create column called Today… I also created a column called DOB (date field) where I will enter the birth date.
  2. Next, create a column with the data where you would like to use "Today" as a
    reference to today's date.  The column type should be "Calculated".  In the
    formula field, create your formula using "Today" as if it held the column date/time.
    SharePoint will calculate the formula based on the assumption that you will
    be using "Today" as a reference to the new column you just created.
    MK Note: I created a column called MonthCheck with the formula shown below:
     =IF(MONTH([Today])=MONTH([DOB]),"Birthday","NotBirthday")
  3. Next, edit the new column named "Today" that you created in the first step.  
    On the very bottom of the page,
    click "Delete", to delete the column.  In
    your formula, SharePoint will keep the reference to "Today" but it will
    change from referencing your column, to a reference to the current date.
  4. MK Note: Now you can create your new view in the list to display “This Month's Birthdays”.  Just apply a filter to Show only when the following is true: MonthCheck is equal to Birthday
    I've also created a BirthDay Column (Capitalized the “D” to note the difference) as well that is a calculated column: =DATE(YEAR(Today),MONTH(DOB),DAY(DOB))
    You can then create a view to display Today's Birthdays by filtering to Show only when the following is true:
    BirthDay is equal to [Today]

 

This can be used in any of the Date and Time functions, but I haven't tested

it beyond that.

 

Notes:

If you want to edit the formula (CheckMonth) containing "Today" SharePoint will not let

you, and will give you the same error about not using Today or Me in a

function.  To get passed this problem you have to temporarily create another

Today column (and then delete it again).

The same functionality will also work with [Me].

 

Ted Tang has a great post on using “< MONTH />” by making modifications within FrontPage:How to ONLY Display "This Month" Items in a List

2007 MOSS Resource Links (Microsoft Office SharePoint Server)

Tuesday, June 26th, 2007

 

2007 MOSS Resource Links (Microsoft Office SharePoint Server)

Here is an assortment of various 2007 Microsoft Office SharePoint Server Documentation / Reference Materials I've found thus far.  Check back often because I will be updating regularly!  Please feel free to add comments or suggest links so we all can benefit.  

 

Download SharePoint (11/16/06):

Download SharePoint Application Templates:

Download SharePoint Beta2 TR :

Download SharePoint Beta:

General Information:

Newsgroups / Community Resources

 

See MOSS in Action!:

 

      Admin and Planning Guides:

      SDKs / Starter Kits / Free Books:

 

Microsoft Videos / Web Casts :

Posters/Maps (via Andrew May):

 

Technical Information / HowTo's:

  • Features

Training Resources (Clinics / Labs / Courses / Exams):

Web Parts / MOSS Tools / Management Packs: