Sunday, December 25, 2011

Windows Server 2008 Tip #1: IE without restrictions

This is a very quick tip for Windows Server 2008, but very useful.

Ever had to download some sort of software to a server, but the download page had some sort of asynchronous behaviour with JavaScript? Or maybe the page had something more going on, that would just not work while using it in the server's Internet Explorer?

It happened to me recently, I wanted to download Microsoft's Productivity Hub SP1 and install it in a SharePoint farm. The server has a very good Internet connection and I was logged remotely (in a slow connection), so the best way to do it would always be downloading the files locally in the server (about 2GB).

The problem: I needed to login with my Live account to be able to download the files. Adding those sites to the Trusted Sites (they are all Microsoft sites) actually solved the login issue. But to download these files, I also had to fill in some register information, as these are not directly downloadable. That register page uses some asynchronous code that, even having the site as Trusted, would not run.

The solution is quite simple: go to the Server Manager and disable Internet Explorer Enhanced Security Configuration (IE ESC) for Administrators. Everything will work after disabling that. Some printscreens below.




References: here

Friday, December 16, 2011

SharePoint 2010 Tip #6: Saving Document Templates in Library

If you are saving your Document Templates in a SharePoint library, don't forget to load the appropriate Content Type to that Library, otherwise your Document Template will be attached to the "Document" Content Type, which only has the "Title" metadata field.

If you don't, your Document Template will lose the association with your Content Type. When you create a new document using that Document Type, the Information Panel will not load your Content Type and any QuickPart you have configured will not work well.

The error will only be fixed once the user tries to save the Document to the Library, and only in the case you have mandatory fields in your Content Type, as SharePoint detects there are missing mandatory metadata fields and block you from saving.

Wednesday, December 14, 2011

Use jQuery in Chrome Console

Since Chrome in gaining momentum (and Firefox losing it) I though I'd start using it in my new laptop and don't even download FF.

I have been quite happy so far, but I just discovered a caveat: if you are using the Console to quickly test some HTML / JavaScript / jQuery / CSS, then be aware that the Chrome Console will replace jQuery's $ function with it's own, that is actually an alias to getDocumentById.

To quickly check it, just use jQuery===$ and see the output. Or if you just enter $, Chrome should have changed that function to the following:

function () {
     return document.getElementById.apply(document, arguments)
}

That means if you select an id it would actually return what you expect, but everything else will fail. So just use jQuery() for your quick test in the Console, and that's it!

EDIT: this bug is already fixed (here), so the problem must be another one. In Twitter, @fbatista answered me with the most probable option: a misplaced $.noConflict()!

Monday, December 5, 2011

Search Requirements Gathering

Just stumbled upon a great presentation about Search Requirements Gathering, from Michal Pisarek (SharePoint MVP). You can see the slides here.

The first thing is to acknowledge the challenge: search is perceived as something that works out of the box and magically presents users with the most amazing results. Little or no time is expected to be spent analysing the quality of results and getting a governance plan together (yes, for search!). Also, in most projects, search requirements are pretty much reduced to knowing which Content Sources need to be in place.

To me, the most important thing is to focus on the value it can deliver. Specific business driven actions that are performed within the organization on a daily basis, that can be improved using SharePoint Search. Attainable goals.

Here are some interesting statistics (Source: Google / IDC):
Each worker currently spends, on average, 9.5 hours per week searching for information. And 3 hours a week recreating content that already exists!
According to the same study, having a high-quality enterprise search implementation will reduce the search time by 50%. That's more than 4 hours a week, or half a day!

How can you achieve these results? You must know what are users searching for and the perceived time they spend doing it. You must understand what is used on a daily basis and on a monthly basis. What is working fine and what is not working at all.
That's the most important step. Then, you have the information you need to build a search configuration focused on their daily needs that can massively improve their searching ability, by filling in the gaps and giving them an integrated system where they can find what they are looking for.

There is also additional value you can push with search. In a successful implementation, users will better understand the importance of metadata, so they may take extra care when categorizing a document. Having the people search box on the right hand side of the search page, can help them realize the value of filling in their "Ask me about" data. And going into someone's profile, may show them the utility of the Organization Browser.

It is definitely a snowball.

Providing a major initial benefit for users working with the SharePoint platform (Search), can help gain buy-in from the users and you can later take advantage in other areas that, by themselves, wouldn't be powerful enough to bring users to the platform.

Another interesting read on this: Using Search Analytics (presentation).

Saturday, November 12, 2011

Humility and Code

What a great article by Phil Factor, in today's SQL Server Central editorial (find it here).

"Don't criticize code".

We all know how time constraints work. We all wished we just had all the time needed to make the best of a tricky problem, project or set of business requirements. But sometimes we don't. Sometimes there's no available time frame, things just have to work, from a high-level perspective. What happens beneath it (read: code), stays there.

So, when you are evaluating some previous work on a legacy system, it is important to be aware of this.
Coming in and just pointing out what's wrong is easy. Bashing is easy. Destroying is easy.
Making it better, or getting it right the first time, in similar situations...not so much. Being constructive, taking a positive approach and understanding constraints is a sign of experience and maturity. Also, quite possibly, a major key factor in enabling good flows of work, organizational adoption and, overall, getting better results.

Friday, October 14, 2011

SharePoint Fatigue Syndrome

I finished reading a great article about the "SharePoint Fatigue Syndrome". These are valuable thoughts on a subject that is not exclusive to SharePointers, but to many areas in IT and life. The 5th point is a must!

Read it here.

I'll have to say I don't feel I am being affected by that syndrome, as I believe I have good coping mechanisms for all of the mentioned causes.

Thursday, October 13, 2011

Yet another quick SharePoint Intranet checklist

I was checking an old blog post (Ago/09) from Joel Oleson (here) and the 10 points he raised back then remain current. It's about why your SharePoint deployment may be falling short. Here's a quick list to wrap his comments, with my own tweaking:
  1. Easy access, everywhere (the mobile and tablet market have gone huge)
  2. My Sites up and running
  3. Rich, complete and editable User Profiles
  4. Enhancing search with people and other systems
  5. Using blogs and wikis (enhanced editions)
  6. Presence enabled
  7. Easy navigation (browsing and searching)
  8. Avoid junk by expiring content, sites, lists, documents...
  9. Use tagging, rating and useful metadata
  10. Keep information dynamic and updated
There are some points more important than others, of course. But all of them should be in the back of your mind, whether you are planing a deployment of SharePoint, or if one is already up and running, but some of these areas have not been well thought or implemented.

Monday, October 10, 2011

Technical diagrams for SharePoint 2010

Whether you are working on your topology or the logical architecture of your solution, these resources from Microsoft may help you and make your job easier. Common example solution diagrams are provided and you can adapt and expand according to your specific scenario. Or use them just as guidance.

Provided as visio files for editing and also pdf for viewing, you can find the diagrams here.

Windows PowerShell Command Builder for SPS2010

Microsoft released a nifty tool to help developers build PowerShell commands. It was built using Silverlight and allows you to easily drag and drop commands (nouns and verbs) to a design area, where you can see the API documentation and fill the necessary and optional parameters in a GUI. A step in the right way.

You can find it here.

Friday, September 16, 2011

Usability in SharePoint

Nowadays, I believe developer teams are more and more used to the concept and importance of usability and design. Apple has clearly shown the way. Microsoft is adjusting to the new reality (i.e. Windows 8 Metro UI), but SharePoint still needs a lot of work.

Yes, I know, SharePoint is just a platform and can be built upon, which is great. But the out-of-the-box functionality should always provide not only a good, but a great experience for the user. Ribbon and having most actions asynchronous was just the first step. The overall usability needs a push.

I just finished reading a great article on EndUserSharePoint, Usability Issues in SharePoint 2010 My Sites: Social Design Patterns and Standards, by Marcy Kellar and Chris Poteet. Highly recommended!

Thursday, September 15, 2011

SharePoint Calendar with Outlook Reminders

This is a standard requirement, one that SharePoint does not fulfill out of the box.

All the people out there that are using calendars and relying on them for their daily schedule, know that reminders are a central option. Even those (like me) who use it frequently but do not depend on it on a daily basis, have that one task they have to do every month, when the Outlook reminder rings the bell.

So, telling users how great it is to have a common calendar in SharePoint and then telling them "No, there are no reminders, but you can copy-paste the event to your personal calendar" is a no-no. There are solutions, not all of them are pretty or easy as they should. The one I will present is my preferred one. Ultimately, you will have a SharePoint RSS feed exposed in Outlook with reminders whenever something pops up. And something also needs to be done to have that RSS feed being refreshed more than once an hour.

This solution came together from a lot of different sources of information, improvements and workarounds users found for each specific aspect they needed to solve in SharePoint. But no one actually set a complete guide and how-to, for something I believe is a very common requirement. So, that's what I will do, in 3 steps.

Requirements:
  1. Have a new field while adding a new event to the calendar, where users set their reminder date;
  2. Have Outlook popping reminders up, when that date is reached.

Solution:
  • Step 1: Create the "Reminder date" field and the "Outlook reminders" view
  • Step 2: Configure the RSS feed in Outlook with reminders
  • Step 3: Getting a faster refresh on the RSS feed

Step 1: Create the "Reminder date" field and the "Outlook reminders" view

You should start by reading the first part of the great post by Paul Liebrand, it's in here. It shows how to create the field, add the view and get the RSS feed Url.

In my specific scenario, I made some changes:
  • The field is not calculated, it is user defined;
  • The view shows all the past reminders, not just the ones from today;
  • The view works with the time also, not just the date.
Follow these steps:
  • Create the field with type "Date and Time";
  • Change the view's filter from "is equal to" to "is less than or equal to";
  • Edit the view with SharePoint Designer to include the option "IncludeTimeValue" in the filter, as described by Nick Grattan, in here.

Step 2: Configure the RSS feed in Outlook with reminders

Add the feed and then configure a rule so that Outlook warns you when a new item arrives. Just follow the second part of Paul Liebrand's article, all in there, step by step.

Step 3: Getting a faster refresh on the RSS feed

Having reminders being refresh once an hour is not OK. So there is a solution for it, disabling the update limit and creating a new send/receive group with a custom schedule for the updates (5 minutes in my case). I got this information here. The first step, you can do it after adding the feed, by going to "Account Settings > RSS Feeds > Change".

There you go!

Wednesday, September 14, 2011

SharePoint 2010 Managed Metadata Columns problems

Beware!

Managed Metadata Columns are a good addition to SharePoint, but the integration with the rest of the products and features is still very scarce. Multiple things may go wrong.

The project I'm working on had a column which would be better off with Managed Metadata, and not a Choice field. I've been searching and searching, drilling and drilling, and can't make it work correctly. I navigate through the term set but the value never gets saved. Can't really tell why.

But I did find many caveats while searching for information: it will not work with Workspace, InfoPath, Datasheet View, "Begins with" and "Contains" filters in Views and Calculated Fields. Also, they'll be hard to use in SharePoint Designer Workflows. And if your root site uses the Blank template, the hidden feature supporting this functionality will not be activated by default.

All the info here and here.

Tuesday, September 13, 2011

SharePoint 2010 Tip #5: editing the NewForm.aspx in a list

If you need to edit the NewForm.aspx in a list and open it in SharePoint Designer, in advanced mode, you will notice that the webpart where the item adding happens is not configurable. It just displays a sample of what you'll get rendered in the page.

The reason for this is the default webpart used here is from the type ListFormWebPart, whose behavior is to automatically render the fields and controls needed according to the list definition. No customization here.

You'll need to add the DataFormWebPart, where these fields and controls will be fetched directly into your aspx page and can be edited. To do it, just go to "Insert > SharePoint > Custom List Form..." and choose your list, content type and the action you want to perform (new, edit, display). The old webpart can be deleted.

Warning: new fields will not be added automatically to this webpart.

Monday, September 12, 2011

SharePoint 2010 Tip #4: "Columns that require data are not included" in Datasheet View

If you have this error and are absolutely sure you are filling every required field, then this may well be the reason. If you activate the option to manage content types in a list and then change the type of one of the columns in the Content Type from Required to Optional/Hidden, it will erroneously leave the list field as required.
You must go to the field definition in the list and set it correctly.

SharePoint 2010 Tip #3: Workflow not starting automatically

This one is a classic. If you are logged in with the System Account, among other things, workflows do not get started automatically with your actions, such as creating a new item or editing an existing one. You have to use a different account.

SharePoint 2010 Tip #2: The Managed Metadata Service or Connection is currently not available.

I had this problem in my development machine (Windows 7). This problem was in the Managed Metadata Service (which I was trying to configure at the time), but it may affect all the others too. The message I got was: "The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator."

The reason was using my AD account to install and run the services and application pools of SharePoint. Since this was a development environment, I did not make extra accounts for a fully fit farm configuration. Due to security restrictions, passwords in our AD need to be changed on a regular basis and that generated the error above. The account was having log in problems, since the password was not a new one. Re-configuring all the services and applications pools to use a different account or resetting the password solved it.

SharePoint 2010 Tip #1: "This control is currently disabled" in Central Administration

In the central administration, if you are logged with the administrator account, but still don't have access to most of the options that should be available (like creating a New Web Application, etc), don't forget to check if you are running Internet Explorer as Administrator.

Friday, September 9, 2011

Install SharePoint Language Packs in Windows 7

If you are developing directly in your machine, in a Windows 7 environment, and try installing a Language Pack, it will fail because of the default requirements (Windows Server 2008).

To make it work, you need to extract the package and the change a configuration file.
  1. Execute "ServerLanguagePack.exe /extract:<your_dir>"
  2. Open <your_dir>\Files\Setup\config.xml and add the directive "<Setting Id="AllowWindowsClientInstall" Value="True"/>"
That's it!
There is a post about this in MSDN, here.

Updating list items without changing the Modified field

In some situations, we want to programmatically update some fields in a list item without users knowing about it. The reasons may be varied; for instance, maybe you are only filling some control fields to record some action performed in a workflow and not editing the "true" metadata of your document/item.

The SharePoint Server API has 2 solutions for this, in our SPListItem object (MSDN quote):
  1. UpdateOverwriteVersion(): updates the current list item without creating another version of the item.
  2. SystemUpdate(): updates the database with changes made to the list item without changing the Modified or Modified By fields.When you call the SystemUpdate method, events are triggered and the modifications are reported in the Change and Audit logs, but alerts are not sent and properties are not demoted into documents.
In my scenario, I used UpdateOverwriteVersion(), since I was actually creating a way to copy discussions between lists and was setting the Author, Created and Editor explicitly. I just needed to avoid having the Modified dates getting messed up, and this method solved it.

From other information I could collect, SystemUpdate() may be very useful to use in custom workflow actions where the Update() would make the workflow call itself recursively.

Tuesday, September 6, 2011

Deploy external DLL's to SharePoint

With the 2010 version, things got so much easier, in terms of deployment. So this is just a reminder.

If you need to deploy some external DLL to the GAC or /bin folder, along with your solution, just go to your Package.package file and choose the "Advanced" tab to configure everything you need. Like the Safe Controls directives for the web.config.

Archive or Copy Discussions in a Workflow

In the project I am currently working on, I have a requirement about archiving a discussion in a SharePoint Workflow. Actually, it is more complicated than that, as some information is also registered in a different list and the administrator/responsible for the discussions will also need to validate whether the discussion got a positive or negative feedback (which will influence the outcome of the workflow).

The main challenge here was the complex structure that discussions lists have. Each discussion is a folder and each reply an item inside that folder, from the type Message. All I wanted was to move the discussion from the original list to other one, archiving it. Using the workflow action to delete the item works, but not copying. So I created a new SharePoint Designer Action, the "Copy Discussion" action.


The set of articles "Working with SharePoint’s Discussion Lists Programmatically", from Itay Shakury, were very useful. You can find them here. It explains how stuff work and gives you code samples on how to access and create discussions and replies. It is for the 2010 version of SharePoint. Spot on. This was exactly what I was looking for. I then made my own version of it, according to my needs and got my custom workflow action going.

There is also another solution for archiving a discussion, using SPExport/SPImport. I found a topic on TechNet about the subject, in here. In my case, I prefer to do it programmatically, as it makes more sense in a workflow, than working with exports and imports.

Saturday, August 27, 2011

Warming up your farm

Every SharePoint developer knows how slow the first load of a page is for users, after resetting the IIS or just recycling the application pool.

There is an option to prevent the delay in the first load: warmup scripts. There are some scripts using stsadm, both for the 2007 and 2010 platforms. In this last version, PowerShell scripts are now also available.

Check one of them here, by Martin Laukkanen.

Thursday, August 25, 2011

Time estimation using PERT

Although there certainly are more complex and structured ways of estimating time, there is a rather simple method to estimate time that has proven interesting to me in many scenarios: PERT.

Basically, you'll have to do 3 estimations for each task: optimistic (O), most likely (M) and pessimistic (P).

These estimations are obviously dependent on how you evaluate the hardness of a task and on the people (or profile) you believe will perform them. One of the most important steps here, is defining as much sub-tasks as possible. Be as granular as possible, so that nothing is forgotten or wrongly evaluated.

After doing your set of estimations for each task/sub-task, you should apply this formula to get the expected time (TE):

TE = (O + 4M + P) ÷ 6

Also,one of the most important things in time estimations, is to keep track of your own estimations and the time they really took. Nothing like a reality check to improve your estimations. One of the aspects that should be taken into account is the person who performed the task and their level of seniority.

Monday, August 22, 2011

SharePoint 2010 CSS Reference Chart

If you ever had some challenges with the design and default CSS of SharePoint, you probably know who Heather Solomon is. Considered by most as the biggest SharePoint branding expert, she released recently the 2010 version of the SharePoint CSS Reference Chart.

If you are struggling with the SharePoint design, check this out, here.

Distributed cache platform with Windows Server AppFabric

Just run into an interesting post by Wictor Wilén, on the use of an extension to Windows Server called Windows Server AppFabric.

Every web project needs to take into account performance and one of the tools we have to improve it is caching. In a farm, we have multiple servers managing their own cache, leading to possibly different results in performance. Also, there is no sharing of resources among different applications, since caching is made in the process level.

This framework allows a wider definition of the caching policies, along with some interesting options, such as the use of dedicated servers for this task and not being restarted in each application pool recycle.

See the article here, with some hands-on instructions on how to set the environment and use the framework.

Saturday, August 20, 2011

Re-branding - done

I am no designer. But I wanted a clean layout for the blog. And no complications.
This was the result, using only the tools provided by the Blogger platform - no HTML editing whatsoever.

Feels better ;)

Friday, August 19, 2011

Code Reviewing - do you do it?

My personal experience is solely based on the Portuguese standard. We, as a nation, tend to be more relaxed about planning and procedures. Well, not all of us, and definitely not all of the companies also, but certainly a lot.

Portuguese rely and brag on their ability to quickly solve problems in real time, as they appear. It is something we call "desenrascar" and can not be easily translated to a word in English. It is what it is: find a quick (and very often suboptimal) solution for a problem.

But...aren't we talking about Code Reviewing? Of course. The introduction is just to say that it is very usual to make it work and then fix performance problems as they come along. Every project has unit testing, whether very explicitly well defined or not, throughout the development phase, but most will leave performance tests for later. And when you find problems in that phase, your work to correct them will certainly be hard.

What can you gain from Code Reviewing and how can you do it? If you have a nightly build or continuous integration process, you should integrate the basics there. Most of the times, you will find that there are already some tools to do what you need automatically (in SharePoint, the most basic piece will be the SPDisposeCheck). You should also include some performance metrics here. They can help your early and correct detection of problems.

In terms of architecture and best practices, you and your co-workers should always keep a thinking mind in place. Don't just code, think about what that code means and what it will do. Don't just implement. If you believe there is a better solution, talk it through with who made the system's architecture. It will help become a better and more complete developer. If you are an architect, you probably already know you should always try to improve your way of solving the problems and see how others nail it.

Where did this all came from? This great article in NBSP, My Top 10 sanity checks when performing SharePoint code review, by Stephane Eyskens. If you are into SharePoint, read it, even if you are aware of these issues. Always good to review and see different points of view

Thursday, August 18, 2011

SQL Server performance

Something that appeared as a central point of discussion among same colleagues: are views in SQL Server materialized?
By default, no. If you want to materialize views, to increase performance, you should look for indexed views.
It is almost unnecessary to say when to use them: if you have some data being pulled very frequently from a subset of tables joined by some logic, with few updates. You will need more disk space, but the performance will certainly increase.

Some reading links on the subject:
Creating an Indexed View in SQL Server 2005 and 2008
Chapter 14 — Improving SQL Server Performance

Re-branding

Soon I will be making a full re-brand on this blog - as soon as I have the time (and will). Each day that passes, I'm enjoying more the way things have been evolving worldwide, in this matter: simple and clean pages, with great lettering to provide a good experience while reading the contents.

Nowadays I fell this layout is too cluttered and some of the experiences I have used this for, have now reached their final destiny! And I have been feeling quite like writing...

SharePoint as a platform, not only a solution

Great article, from someone I had the pleasure of seeing in a live presentation (here in Lisbon): Dan Holmes on Lessons Learned from Enterprise SharePoint Adoption Trends.

To sum things up, I totally agree with him: nowadays, SharePoint should be used as a platform to centralize the communication and workspace between collaborators. No matter how many systems you may rely on for your daily activities, they should be easily accessible in one place. A place where you can add value, by helping everyone do a better and more informed job. Where one can easily find help on any subject, either from documents, processes or people.

In my company, we have been helping others in doing it - and with great success. My latest SharePoint 2010 project was actually used as the first Microsoft Portugal Case Study on Intranets built using SPS2010. It was in a lawyer firm and, besides a great environment to work in, everything went smooth and with everyone heading the same (and right) way! Isn't it great when clients take the full potential of what you can offer?

Tuesday, August 16, 2011

Continuous integration (automated builds) for SharePoint 2010

Great set of articles being build by Chris O'Brien (once again), Kirk Evans and Mike Morton (Microsoft).

First important thing to notice: when to really consider using automated builds (quoting Chris O'Brien):

  • "Development-oriented – perhaps with more than, say, 3 Visual Studio projects
  • Multiple developers
  • Fairly long-running (e.g. > 2-3 months; to give the team a chance to implement CI alongside the actual deliverables)"
Most projects you are involved in will probably meet these requirements, which means, "YES, I need it!".

Read the articles already released: first part by Chris O'Brien on the reasons to do it and the second by Mike Morton regarding the installation of TFS.

From my point of view, it is a great investment that will pay off in the end of the project, with a more robust, streamlined and responsible development strategy. It is definitely true that doing it with a SharePoint project is a much more challenging process that with a plain .NET development, but not doing it will most certainly lead to a worse final result. Keep that in mind, and don't be lazy!

Something that has been on my mind for the last days, that I will pursue with further investigation, is developing all the SharePoint objects using PowerShell scripts. This is a usual practice for SQL developers, so why not make it usual in SharePoint dev? It ensures that all developers can have an updated version of your portal in their own machine/dev environment and that you can, at every point in time, check what went wrong or quickly reset a specific build to see if an erratic behavior was already present.

Monday, August 15, 2011

Some reading notes...on the Management Part of Projects

How much time should you spend on requirement gathering? 30%.
(read article here)

Interesting comment about a book written in 1975, stating (event then!) that the average should be:

1/3 - Planning
1/6 - Coding
1/4 - Component Test and Early System Test
1/4 - System Test


Also, from the same author (Chris Wright - http://www.sharepointblog.co.uk/), interesting thoughts about taking ownership of a project (read article here).
I also believe this is a very important question everyone should continuously address in their own projects, no matter the specific role you may have. In the Portuguese companies/projects I have worked in, there is a slight difference. The "consultant" job is usually done by someone that will also lead the technical team. With that in mind, I believe this is the guy that should "own" the project, having the PM as a backup for the though decisions.