Monday, September 26, 2011

Extend Web Application

Extending a Web Application is just a couple of clicks in Central Administration. Lets say I want an extranet for the portal.aune.local created in the previous post.

Extend the SharePoint - 80


Open Central Administration and go to Manage web applications:

 Chose the SharePoint - 80 and click Extend on the Ribbon:


Configure:

Note: I haven't used any different Security Configuration, so this only show how its done. But obviously for an extranet the SSL would be a choice to consider.


Configure DNS


Make sure to configure your DNS records, I have used a CNAME, but you could just use a A record too.





Just for good measure, Reload:



That's all, now you can access the site at extranet.aune.local.

Sunday, September 25, 2011

Network Load Balancing

In this post I'll cover the basics of setting up Network Load Balancing with the free Feature included with Windows Server 2008. The goal with this is that you can take one server down without the users noticing it, and of course to balance the load between them for best performance.

Read more about NLB on technet.

In this scenario I have two SharePoint 2010 Servers in one Farm (AUNE-SH01 and AUNE-SH02). And I'll set it up the cluster to use portal.aune.local at IP 192.168.2.105. 

First you need to activate the feature on both servers, this is done with Server Manager.

Install NLB

     Open Server Manager and add feature:

     Install the Network Load Balancing Feature



Repeat this on both servers


Configure the Network Load Balancer

This part can be done on either of the two servers.

1. Open the Network Load Balancing Manager:


2. Right-click the cluster node and click; New Cluster

 3. Type in the name of one off the servers and click connect:


4. Chose an IP for the new cluster, in this case 192.168.2.105 is used, just make sure its an available IP.


5. The parameter for the cluster I have entered a Full Internet name and changed the mode to Multicast.

6. Under the port rules you can specify ports that will be balanced, I didn't change this. But in a production environment you could for example balance port 80/443.


7. Now the cluster is in place and the second server needs to be added, AUNE-SH02. Right click the new cluster and click Add Host To Cluster.




Configure the DNS

You'll need a new record for the cluster, 192.168.2.105. 

Open the DNS Manager, find your Forward Lookup Zone and right-click and New Host:




Configure IIS Bindings

Not done yet, the IIS server needs to be edited on both servers to set correct bindings.

Open the IIS Manager, find your SharePoint site and right-click and then Edit Bindings...:


Edit the entry already there and change the host name to the new portal.aune.local:


Configure SharePoint
The final part, configure the Alternate Access Mappings. 

Open Central Administration and find Configure alternate access mappings under System Settings:
Edit Public URLs for your collection, this example the SharePoint -80 is used.

Change the Default value to http://portal


That's it, your should now be available to connect to http://portal.aune.local.

Note: Just to be sure, restart both IIS servers.


In a later post I'll cover failover clustering the SQL server.

Thursday, September 1, 2011

SPD Workflow: Get Quarter based on Date

From time to time you need some output data that are not obviously available in SharePoint Designer when using out of the box actions. Such an output was needed the other day, and it was setting which quarter the current item was updated. The quarter should be used for different aggregations. With only SharePoint Designer and OOTB actions it didn't look like an easy task, but it turned out it was.

What was need was an constant variable, constant in the terms of characters returned. After some testing on different return types I figured out that ISO Formatted always returns the same amount of characters. And with another OOTB action, the Extract Substring of String from Index with Length.

First create a variable of type String, in the example its called "finnMnd":


I have used a parameter of type Date, "Start Dato", this could be any field of type Date. And the Return field as should be ISO Formatted.















After that we need to extract the month, and the month is always starting on position 6 with length of 2.












We have the number for the month in the variable "finnMnd". Now its only needed to do some checks and set a variable to 1. Quarter  2. Quarter etc with use of the condition "If any value equal value".























Tuesday, August 30, 2011

Using the built in Overlay Media player in SharePoint

This is a simple and cool feature to add some impressing features to your site.

And it can be all done from a Content Editor Web Part if you like by using a <div> and the built in mediaplayer.js script shipping with SharePoint.

Here is an example on how it could be used:





Friday, August 26, 2011

Open Edit form directly from Content Query

Some background for why I wanted this. I had a content type for registration of different tasks, and for underlying reasons I needed to split it into different SharePoint Lists. I wanted an easy way for users to register some data for the "tasks". Anyway I thought about setting up a CQWP on the users "Dashboard" querying for all the tasks of the content type, and link it directly to an edit form created with InfoPath.

1.
Its actually pretty easy to do this, first you'll need a template set up in ContentQueryMain.xsl. Search for the OuterTemplate.GetSafeLink, and copy and paste it right below. Now all you'll need to do is ofc change the name of the template, I just named it OuterTemplate.GetEditLink:

<xsl:template name="OuterTemplate.GetEditLink">
 <xsl:param name="UrlColumnName">
	<xsl:if test="$UseCopyUtil = 'True'">
	 <xsl:value-of select="concat($RootSiteRef,'/_layouts/CopyUtil.aspx?Use=id&amp;Action=editform&amp;ItemId=',@ID,'&amp;ListId=',@ListId,'&amp;WebId=',@WebId,'&amp;SiteId=',$SiteId,'&amp;Source=',$Source)">
	 </xsl:value-of>
	</xsl:if>
	<xsl:if test="$UseCopyUtil != 'True'">
	<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
	<xsl:with-param name="UrlColumnName" select="$UrlColumnName">
	</xsl:with-param>
	</xsl:call-template>
	</xsl:if>
 </xsl:param>
</xsl:template>

The only change made to template other than the name is the Action=, changed to editform, that's it.

2.
Now for using it in a CQWP you'll need to set up an ItemStyle to use it. Make a variable to use the new template.

<xsl:variable name="SafeLinkEditUrl">
   <xsl:call-template name="OuterTemplate.GetEditLink">
      <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
   </xsl:call-template>
</xsl:variable>

3.
And then its set to use with xsl:value-of.

<a href="" title="{@LinkToolTip}" 
      onmouseover="javascript:this.style.cursor='hand';"
      onclick="javascript:SP.UI.ModalDialog.ShowPopupDialog('{$SafeLinkEditUrl}');return false;">
          <xsl:value-of select="$DisplayTitle"/>
</a>