Wednesday, February 25, 2009

Tuesday, February 24, 2009

KWizCom sponsors the Markham .NET User Group

KWizCom believes in knowledge sharing and education. That is why KWizCom supports groups and institutions that promote these issues. The Markham .NET User Group is one such example.
The Markham .NET User Group was founded by Rostam Jarrah and
Reza Alirezaei, experts in content management, SharePoint and more. The two felt the lack of a .NET dedicated user group in Markham, Ontario and thus decided to create one.
The group focuses on various .NET technologies at each session such as mobile, web, Office, SharePoint and other emerging .NET technologies. The main goal in mind is to enable knowledge sharing, allowing members to learn from each other and gain new insights.
KWizCom, known for supporting grade school and college education, sees importance in promoting further studies for professionals. Group synergy like that in the Markham .NET User Group creates the atmosphere to bring about advancements and solutions that can, ultimately benefit
all. When education and community benefit calls - KWizCom is there, each step of the way.

Sunday, February 22, 2009

Add a web part to your web parts gallery using a feature

Want to add web parts to your web parts gallery using a SharePoint feature?
Let me show you the easiest way...


Background
If you want register a web part for a site collection, you should add the web part to the Web Part Gallery in the site collection.
The KWizCom Tagging Feature is convenient to use here as it allows you to see the Tags Cloud Web Part in the site collection where the Tagging Feature is activated.
It is important you understand everything in SharePoint 2007 is based on features. So - to add your web part to the web parts gallery you will need to create a special feature for your web part with the correct scope as well:
Let’s say you have sample web part named “MySampleWebPart”.
The first thing you need to do is create a folder named “MySampleWebPart” inside the Features folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MySampleWebPart
Now, copy your “MySampleWebPart .dwp” file inside the newly created folder and create 2 XML files named “elements.xml” and “Feature.xml”.
To complete your work you should modify both XML files and then install and activate the feature.
Open the “Feature.xml” file for editing (for example in notepad) and put the following XML there:










Note: Each feature must have a unique ID. Please make sure that you use your own generated GUID for it.
Open the “elements.xml” file for editing (for example in notepad) and put the following XML there:









Done!
Now, you can install and activate the feature that will add the web part you the Web Parts Gallery.


Install Feature
Run STSADM command:
“C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm” -o installfeature –name MySampleWebPart –force

Activate Feature
After installation, you should have this new site collection feature:





Activate the feature to see the web part in web parts gallery.

Result
If you did everything correctly, you will see your web part in Web Part gallery

Tuesday, February 17, 2009

How do I save a publishing site as a template?

You may have noticed that the “Save site as template menu” under “Look and Feel” site settings category is missing. This brings one to ask:
How do I get it back? And more importantly: Why was it removed?
In the following article I will answer these questions and give you tools to address this issue on your own.

Background

In WSS sites, when you go to site settings page, this is how your “Look and Feel” category looks:


Notice you have the “Save site as template” menu option there.
It is important to understand that everything in SharePoint 2007 is based on features. So – you would be correct to assume this menu option is also a feature:
Feature folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\SiteSettings
Feature file: SiteSettings.xml
Definition:
<customaction id="SaveAsTemplate" title="$Resources:SiteSettings_SaveAsTemplate_Title;" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" rights="AddAndCustomizePages,BrowseDirectories,ManagePermissions,ManageSubwebs,ManageWeb,UseRemoteAPIs,ViewFormPages" sequence="60"><customaction id="SaveAsTemplate" title="$Resources:SiteSettings_SaveAsTemplate_Title;" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" rights="AddAndCustomizePages,BrowseDirectories,ManagePermissions,ManageSubwebs,ManageWeb,UseRemoteAPIs,ViewFormPages" sequence="60"><customaction id="SaveAsTemplate" title="$Resources:SiteSettings_SaveAsTemplate_Title;" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" rights="AddAndCustomizePages,BrowseDirectories,ManagePermissions,ManageSubwebs,ManageWeb,UseRemoteAPIs,ViewFormPages" sequence="60"><customaction id="SaveAsTemplate" title="$Resources:SiteSettings_SaveAsTemplate_Title;" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" rights="AddAndCustomizePages,BrowseDirectories,ManagePermissions,ManageSubwebs,ManageWeb,UseRemoteAPIs,ViewFormPages" sequence="60"><customaction id="SaveAsTemplate" title="$Resources:SiteSettings_SaveAsTemplate_Title;" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" rights="AddAndCustomizePages,BrowseDirectories,ManagePermissions,ManageSubwebs,ManageWeb,UseRemoteAPIs,ViewFormPages" sequence="60"><customaction id="SaveAsTemplate" title="$Resources:SiteSettings_SaveAsTemplate_Title;" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" rights="AddAndCustomizePages,BrowseDirectories,ManagePermissions,ManageSubwebs,ManageWeb,UseRemoteAPIs,ViewFormPages" sequence="60"><customaction id="SaveAsTemplate" title="$Resources:SiteSettings_SaveAsTemplate_Title;" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" rights="AddAndCustomizePages,BrowseDirectories,ManagePermissions,ManageSubwebs,ManageWeb,UseRemoteAPIs,ViewFormPages" sequence="60">
<urlaction url="_layouts/savetmpl.aspx">
</customaction></customaction>
<urlaction url="_layouts/savetmpl.aspx"></customaction><urlaction url="_layouts/savetmpl.aspx"></customaction>
<urlaction url="_layouts/savetmpl.aspx"></customaction><urlaction url="_layouts/savetmpl.aspx"></customaction><urlaction url="_layouts/savetmpl.aspx"></customaction>

When you create a publishing portal site (internet facing or intra net collaboration portal) you will notice that among other changes, the “Look and Feel” site settings category has changed, a lot:


Notice, there is no longer the option to "save site as template".

So, keeping in mind that everything in SharePoint is controlled by features – think of a publishing site as a normal WSS sites that had some features activated in it (*this is not 100% accurate, but as it simplifies things we will say so, for the sake of the example).
Looking further in our Feature folder, you will easily find several feature folders that belong to the publishing site. One of these features calls you to hide the save as template menu from the site settings:

Feature folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\Publishing
Feature file: PublishingSiteSettings.xml
Definition:
<hidecustomaction id="HideSaveAsTemplate" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" hideactionid="SaveAsTemplate"><hidecustomaction id="HideSaveAsTemplate" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" hideactionid="SaveAsTemplate"><hidecustomaction id="HideSaveAsTemplate" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" hideactionid="SaveAsTemplate"><hidecustomaction id="HideSaveAsTemplate" location="Microsoft.SharePoint.SiteSettings" groupid="Customization" hideactionid="SaveAsTemplate">

Notice the use of the HideCustomAction tag, with the corresponding HideActionld “SaveAsTemplate”.

Why is the “Save site as template” menu option removed from publishing sites?


Many of my customers use publishing sites. A lot of them tried to use the save as template option (some using code, some using a feature like the one below) and we all came to the same conclusion:
Since publishing sites have pages in them and layouts that are all connected to a content type that is configured at the top level site of the site collection, and because these content types are not saved and moved within the site template STP file – the STP file not, as one would expect it to be, a true reflection of the original site.
This means that if you save a publishing site as template and use it in the same site collection, providing all site content types it uses remain unchanged, the site template will work properly.
The problem arises when you try to move the site template to a different site collection, or when you've changed or deleted some content types in your current site collection – this will result in unexpected behaviour (that from my experience is irritating but fixable, with some work).
So, if you want to use the site templates within the same site collection, or if you use only the out of the box content types (welcome and article) with no changes, you should have no difficulties.

How do I add the “Save site as template” option back to publishing sites?


Here is what you need to do to add this option back to your publishing site. It's very simple; it will take approximately five minutes of work!
Simply create, install and activate a feature that will bring this menu option back to life!

Create feature
Create a feature that re-registers a “save as template” action to site settings. I said 5 minutes, right? So here is a feature ready to use (it's my free gift to you! ;)
Save the folder inside the ZIP file, under your server’s features folder.

Install Feature
Run STSADM command:

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm" -o installfeature -name AddSaveTemplateToPublishingSiteSettings –force

Activate Feature
After installation, you should have this new site collection feature:


Result
If you did everything correctly, your new publishing site settings “Look and Feel” section will appear like this:


You will now be able to "save site as template".
Easy, huh?!

* There may be other side effects of saving a publishing site as template. This article is for the community information benefit only and will not hold KWizCom responsible to any issues caused by this. It is strongly recommended you test on a pre production environment before you use this tip in a production server.

Sunday, February 15, 2009

CARE benefits from KWizCom's innovative SharePoint Solutions

KWizCom granted CARE, a leading humanitarian organization, an open license of KWizCom add-ons for SharePoint.

Nimrod Geva, KWizCom's VP Sales and Marketing says, "We are honored to support CARE's efforts to help others. KWizCom's goal was to free CARE to focus on the central issue – making the world a better place – rather than wasting precious time on administrative issues. We are glad to know that our add-ons are making CARE's important work that much easier."

you can read more about CARE's use of KWizCom add-ons here

Thursday, February 12, 2009

Search Scopes & Contextual Search Scopes

By Sveta Yerpilev - SharePoint Technical Consultant
KWizCom Professional Services – http://www.kwizcom.com/

Summary
Part 2 of 3 part SharePoint Search Customization series .

*****************

Search Scopes:
You can crawl all items under a certain URL and choose to specify search scopes for your users i.e when they search it will only be in the areas you defined.
For example: You have a site http://server/ and sub-sites of this site, http://server/subsite1 and http://server/subsite1. You crawled all of http://server/ including the sub-sites but in the search scopes you can create a special scope for http://server/subsite1 and another scope for the http://server/subsite1.
You can create scopes on the server level (which will be applied on all Web Applications). You can also define scopes in a Site Collection.
To create a new scope - open the Scopes page in the Search Settings page or the Search Scopes page into the Site settings under the root site of a Site Collection. You can set a Scope name, add the Scope to display groups (you can connect a display group to the search box and give your users the option to search only in specified scopes) and then set the target results page.

After you create a scope you need to add a rule or rules to this scope.
Like crawl rules, here you can include or exclude items or sites but you have an additional option: “Required”. This option directs the search scope to require the rule query from every item in the scope. So if you add all content to the scope but the “Document” content type is required you will see only documents in the search result.
You can create rule that looks for a specific property. To add additional properties to this option you need to open the Metadata Property Mappings and find your property.



After that just switch the “Allow this property to be used in scopes” checkbox to “Yes”.

If you don’t find the property you are looking for in the list you need to add it to the list.
You can define that only site columns become a managed property. To do so, go to “Crawled Properties” and find your property (column) in the list (if it’s a site column it will be under the SharePoint folder).
Enter the property and verify that the “Include in Index” checkbox is checked. If not, check this option and run Incremental Crawl to see this property in your scope. Afterwards go once more to the "Metadata Property Mappings” page and create a new managed property.
Add mapping to the crawled property you created before and allow this property to be used in scopes. Now you can use this property in all search scopes.

Contextual Search Scope :
Sometime you will see a scope named “This Site” or “This List”. These names signify that within the search scope there is a contextual search scope added by SharePoint.
This is a useful option when you want to enable your users to search only in the area they are working in at the time of their search (why waste precious time crawling other locations if you know that what you are searching for is somewhere within your current location?).


If you want to remove an existing contextual scope you may find this post useful:
http://littletalk.wordpress.com/2008/10/23/removing-contextual-this-sites-cope-from-simple-search-box/



If you like and use this function and you customized your search results page you may encounter some problems. You can’t really tell the contextual search scope to send a query to a customized results page. Contextual search scope always uses a default results page - _layouts/osssearchresults.aspx.
You can customize this page but if you have more than one SharePoint Portal the correct thing to do is to redirect your user to the appropriate, customized search results page. When the user types a search query and presses “Go” the search page redirects the query to the results page using URL parameters. In the address bar of the results page you can see parameters like “k”(search query) and “u”(URL). You need to redirect users from osssearchresults.asx page to customized results page using the same parameters. The "u” parameter can be indicator, pointing to the site from which the search query originated.
Below is code that will help you perform the redirection:

function getParam( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];
}

function redirectTo()
{
urlTmp=getParam("u");
if(urlTmp.indexOf("site1url")>0)
{
window.location="http://
customresultspageurl.aspx?k="+getParam("k")+"&cs="+getParam("cs")+"&u="+getParam("u");
}
}

redirectTo();

Just replace the “site1url” and “customresultspageurl” with your values and put this code into the osssearchresults.asx.

Coming next week:
Part 3 of the 3 part SharePoint Search Customization series: "Search Results" where we will discuss customization of your search results page.

Tuesday, February 10, 2009

How to colorize your SharePoint List

By Sveta Yerpilev
SharePoint Technical Consultant
KWizCom Professional Services – www.kwizcom.com

******
Our work often necessitates creating solutions as we go.
One day I was asked to show the status of the items in a SharePoint list with colors or, in other words, to categorize by colorizing.
The idea was for users to populate the list by choosing the status from a checklist (simple) and then be able to see the color coded status on the homepage automatically (how do you do it?).
This is the solution I came up with:
First I created a list with column labeled “Status” that could get the values “Ready”, “Not Working” or “Not Ready”.
Then I created an additional column labeled - “Status Icon”. I made this a calculated column – each field gets their value according to the value of the “Status” field of same item. This column actually contained links to pictures where the link changes according to the value in the “Status” field.

Here is the formula for the calculated column:

=IF(Status="Ready","pictureLibrary/ready.jpg",IF(Status="Not Ready","pictureLibrary/notready.jpg",IF(Status="Not Working","pictureLibrary/notworking.jpg","Not Working")))

Ok, now we have a link to the right picture, but how do we see this picture on the page?
To do this we need to use the Data View Web Part that is available only in SharePoint Designer, so we must edit the page in the SharePoint Designer to add Data View.
After adding this web part we need to add columns from our list to the web part.
Note - we add the “Status Icon” column ONLY and NOT the “Status” column!
After we do this we need to change the format of the “Status Icon” values to “Picture”. Now we will see all of the values in the “Status Icon” column as images.We can also change the title of the column to “Status”.

Here is how it looks in the end:


Post Script - the scenario detailed here occurred before I learned that calculated fields can contain HTML. Utilizing this option enables us to avoid SharePoint Designer all together although my solution was fairly simple so I suggest picking whatever you are most comfortable with – either way will do the trick!

You can find more information on this subject at this great blog:
http://pathtosharepoint.wordpress.com/category/calculated-columns/
****************************
For more helpful tips and guidelines please visit our blog: http://kwizcom.blogspot.com/ You can try KWizCom add-ons free of charge at: http://www.kwizcom.com/

Saturday, February 7, 2009

KWizCom announces CRM SharePoint Connector version 2.2.00

KWizCom recently released our CRM SharePoint Connector version 2.2.00.
You can read more about it and its business benefits
here.

If you are interested in being updated on KWizCom new releases as they come out please register for the official KWizCom rss feed here.

Tuesday, February 3, 2009

Load Your SharePoint "View" Page Faster

By Roi Kolbinger - SharePoint Consultant KWizCom Professional Services – www.kwizcom.com

Did you ever notice that SharePoint pages that display "views" loads slower if you have set a default site direction?

When I open a list view (allitems) with Firefox it loads in a second, with Explorer the same page loads in three seconds. Why?

When considering it two extra seconds may not seem like a lot but the extra moment here and there end up being wasted hours sucked up by the computer. Who have us hasn't sat down to work on a project and after what feels like moments, raised eyes to the clock only to find that in actuality hours had flown by? Every moment is precious and I wanted to discover why the page was loading so much slower…

Curious, I decided to investigate… I began by debugging the JavaScript page using a small function called "FixTextAlignForBidi". This function verifies that your browser is Explorer. If it is, this application runs all the elements on your page and changes the textAlign (left or right) according to what you defined when you created the list.


If you use "none" as your default this function will not run and your page will load faster.

If that doesn't work then a different solution is needed.

Once I discovered the source of the difficulty I was able to figure out how to fix it:

If you use one language on your sites, go to init.js, find the function and add a return method at the beginning like so:

function FixTextAlignForBidi(value)
{
return;
if (!browseris.ie)
return;
...


After this, go to core.css (or your style file) and add this code to create a default textAlign:

Left alignment:
/* FixTextAlignForBidi(left) on init.js */
.ms-vh-icon, .ms-vh-icon-empty, .ms-vh2-nograd, .ms-vh2-nograd-icon, .ms-vh2-nofilter, .ms-vh2-nofilter-icon, .ms-vhImage
{
text-align: left;
}


Right alignement:
/* FixTextAlignForBidi(right) on init.js */
.ms-vh-icon, .ms-vh-icon-empty, .ms-vh2-nograd, .ms-vh2-nograd-icon, .ms-vh2-nofilter, .ms-vh2-nofilter-icon, .ms-vhImage
{
text-align: right;
}



If you use two directions on your site you can attack the problem a few ways.

One way is to create two style sheets and add to the files the code as appears above.
An alternative is to allocate the faster speed to the main alignment direction you are using, for example:

If you choose the left side to be the faster one you add the left style to the css file, and in the JavaScript function you add if
function FixTextAlignForBidi(value)
{
if (!browseris.ie)
return;
if (value == "left")
return;

...

If you chose the right side, do the opposite.

After that you should have no more difficulties with the loading speed of your pages.

******************
For more useful tips and guidelines please visit the KWizCom blog at: http://kwizcom.blogspot.com/
You can try KWizCom SharePoint and Dynamics CRM add-ons free of charge: http://www.kwizcom.com/

Search Content Sources

By Sveta Yerpilev , SharePoint Technical Consultant
Part 1 of 3 part SharePoint Search Customization series

SharePoint allows you to index (crawl) different content sources including:

· SharePoint Sites
· Web Sites
· File Shares
· Exchange Public Folders
· BDC content

Want to add a new content source to your search?

To add a new content source to your SharePoint server open the Central Administration of the server and enter the relevant Shared Services.


  • Open the Search Settings page and open the “Content sources and crawl schedules” link.
  • Click the “New Content Source” button and enter all relevant data for the source you want to add to your search.
  • Press “OK”.

Congratulations!
You now have a new Content Source that will be crawled next time you run a Full or Incremental Crawl for it.

But what if you don’t want to crawl all sites under this Content Source?

You can exclude a web address from the crawl using Crawl Rules.

  • Enter the Crawl Rules in the “Search Settings” page and add new crawl rule.
  • Type in the URL you want to exclude or include from the crawl.

To check whether or not a URL will be crawled simply, type the URL in the URL text box on the Crawl rules page and click “Test”.


Coming next week:
Part 2 of the SharePoint Search Customization series: "Search Scopes & Contextual Search Scopes" where we will discuss defining different search scopes for your SharePoint search.

KWizCom Professional Services

www.kwizcom.com