Monday, October 26, 2009

Book Review: Professional SharePoint Designer 2007

Finally, a book (and a great one in that) covering SharePoint Designer! I recently finished reading Professional Microsoft Office SharePoint Designer 2007, authored by MVPs Woodrow Windischman, Bryan Phillips, and Asif Rehmani. With Microsoft making SPD 2007 available as a free download, it’s important that users of the product understand how to use it properly.

The authors did an incredible job covering the aspects of SPD from multiple perspectives. I enjoyed how they even included sections on developing solutions with Visual Studio. It was apparent those sections were added with the intent on getting readers familiar with the various options and methods they have available for developing extended functionality outside SPD, so don’t be disappointed if you don’t feel it’s advanced enough – remember that this isn’t a core development book.

The one thing I loved the most about the book was the style of writing; the authors did a great job simplifying walking through the features of SPD without losing my attention. The level of detail and simplicity was balanced very well throughout the book. I learned a lot of things reading this book and I believe any user, no matter how good he/she is with SPD, can learn a new thing or two from reading this book as well.

SharePoint Designer 2007 is a tremendous and powerful software. With Microsoft making it available to download for free, users need to have a strong understanding of how to work with it, and more importantly, how to avoid running into problems with it.

Tip: How to delete the default Shared Services Provider (SSP)

Here’s a quick tip for anyone new at administrating MOSS 2007.

When attempting to delete the default SSP through Central Administration, the “Delete” option is grayed out. To work around this, run the below command using STSADM.

stsadm –o deletessp –deletedatabases -force
The “–deletedatabases” parameter is optional. The “–force” parameter is required when deleting the default SSP. It’s optional when deleting any other SSP, and is used to force the timer job to complete the deletion.

Sunday, October 4, 2009

Business Data Catalog in MOSS 2007

Overview
As per Microsoft, Business Data Catalog (BDC) is a “new business integration feature available in Microsoft Office Sharepoint Server 2007. It is a shared service and it enables MOSS 2007 to surface business data from back-end server applications without any coding.”
Why BDC?
All the data entered into the Sharepoint system gets stored in the content database of that particular Sharepoint application. So by default, a Sharepoint site will get information from its content database. But it is quite natural for an organization to have information stored in multiple databases by numerous applications throughout the organization. For example, inventory software stores its data in a database that is different from a CRM software storing data in a database. But people will find is extremely useful if provided with a space where they can have every bit of information from each and every department in the organization ranging from the up-to-minute logistics information to the up-to-date sales analysis. The BDC feature of Microsoft Office Sharepoint Server 2007 provides the needed business integration for integrating the line of business (LOB) applications with the Sharepoint.
What is BDC?
Business Data Catalog provides built in support for displaying data from two data sources.
· Databases
· Web Services
Microsoft promises a “no coding” approach for integrating LOB applications with Sharepoint. Business Data Catalog provides access to the data sources through a metadata model that provides a consistent and simplified client object model. So it is the metadata authors who describe the API of the business applications in xml. After this, the administrators will associate this metadata with the Sharepoint application after which the LOB data is available in the Sharepoint system.

Creating Lists using Sharepoint Object Model

before starting with the article first go through http://dotnetdreamer.com/2009/05/24/creating-sites-using-sharepoint-object-model/

Listed below are the Sharepoint site components and their corresponding object in the sharepoint object model.

Sharepoint Site Architecture Component Object in Sharepoint Object Model
Site Collection SPSite
Site SPWeb
List Collection SPListCollection
List SPList
List Field Collection SPFieldCollection
List Field SPField
List Item Collection SPListItemCollection
List Item SPListItem
Steps to create a new Sharepoint List:

Open Visual Studio. Create a new Windows Forms project.
Add a textboxes, one to accept the name of the site collection and another to accept the name of the new site to be created under the site collection.
Add a button that creates the new site.
Add reference to Microsoft.Sharepoint dll. This dll is represented by the name Windows Sharepoint Services in the Add Reference dialog box.
Add the namespace of Microsoft.Sharepoint dll like this.
using Microsoft.Sharepoint;
In the button click event, open the site collection.
SPSite siteCollection = new SPSite(txtSiteCollectionUrl.Text);
Now open the top level site of the site collection.
SPWeb site = siteCollection.OpenWeb();
If you want to open a different site under the site collection other than the top level site, you can use the overloaded methods of the OpenWeb() method that accepts the name of the site as argument.
The Lists property present in the SPWeb object will return all the lists that are present in that site as an SPListCollection object
SPListCollection listCollection = site.Lists;
In order to add a new list, use the add method of the SPListCollection object.
listCollection.Add(”listname”, “list description”, SPListTemplateType.GenericList);
Note that the third argument accepts the template in which the list should be created. GenericTemplate represents the custom list. We can choose the template we need from the SPListTemplateType enum.
Close and dispose and the site and site collection
site.dispose();
siteCollection.close();
The complete code can be found below..

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SharePoint;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

SPSite siteCollection;
SPWeb site;

private void btnCreateSite_Click(object sender, EventArgs e)
{

try
{
siteCollection = new SPSite(txtSiteCollection.Text);
site = siteCollection.OpenWeb();
SPListCollection listCollection = site.Lists;

listCollection.Add(txtListName.Text, “list description”, SPListTemplateType.GenericList);
}
catch (Exception)
{ }
finally
{
site.Dispose();
siteCollection.Close();
}
}

}
}

Hope this is useful.

Friday, September 18, 2009

jQuery and jCarousel in SharePoint

I recently had to integrate jCarousel into a SharePoint web part. Since jCarousel is a plugin for jQuery, it means I also had to get jQuery integrated with SharePoint. In order to accomplish this, I followed some good feature packaging instructions found from a few different blog posts:
SharePoint jQuery Deployment Feature
SharePoint + jQuery = Stay Here Feature
SharePoint Slideshow Web Part
After figuring out how to package jCarousel and jQuery using SharePoint delegate controls, I was ready for business with the implementation of the web part.
The web part itself was nothing fancy. I used a Repeater control to generate the list item (LI) elements with the content I needed in the carousel. I wrapped the Repeater in an unordered list (UL) which was wrapped in a DIV tag that had the runat attribute set to server. So basically, I just followed the mark up instructions provided in the jCarousel documentation.
The wrapping DIV tag was used in my webpart code to initialize jCarousel. The code snippet below shows how I implemented it:

protected override void OnLoad(EventArgs e)
{
if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(), this.ClientID))
{
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, @"

");
}
}

Thursday, September 10, 2009

18 ways to improve your Body Language!!!

There is no specific advice on how to use your body language. What you do might be interpreted in several ways, depending on the setting and who you are talking to. You’ll probably want to use your body language differently when talking to your boss compared to when you talk to a girl/guy you’re interested in. These are some common interpretations of body language and often more effective ways to communicate with your body.

First, to change your body language you must be aware of your body language. Notice how you sit, how you stand, how you use you hands and legs, what you do while talking to someone.

You might want to practice in front of a mirror. Yeah, it might seem silly but no one is watching you. This will give you good feedback on how you look to other people and give you an opportunity to practise a bit before going out into the world.

Another tip is to close your eyes and visualize how you would stand and sit to feel confident, open and relaxed or whatever you want to communicate. See yourself move like that version of yourself. Then try it out.

You might also want observe friends, role models, movie stars or other people you think has good body language. Observe what they do and you don’t. Take bits and pieces you like from different people. Try using what you can learn from them.

Some of these tips might seem like you are faking something. But fake it til you make it is a useful way to learn something new. And remember, feelings work backwards too. If you smile a bit more you will feel happier. If you sit up straight you will feel more energetic and in control. If you slow down your movements you’ll feel calmer. Your feelings will actually reinforce your new behaviours and feelings of weirdness will dissipate.

In the beginning easy it’s to exaggerate your body language. You might sit with your legs almost ridiculously far apart or sit up straight in a tense pose all the time. That’s ok. And people aren’t looking as much as you think, they are worrying about their own problems. Just play around a bit, practice and monitor yourself to find a comfortable balance.

1. Don’t cross your arms or legs – You have probably already heard you shouldn’t cross your arms as it might make you seem defensive or guarded. This goes for your legs too. Keep your arms and legs open.

2. Have eye contact, but don’t stare – If there are several people you are talking to, give them all some eye contact to create a better connection and see if they are listening. Keeping too much eye-contact might creep people out. Giving no eye-contact might make you seem insecure. If you are not used to keeping eye-contact it might feel a little hard or scary in the beginning but keep working on it and you’ll get used to it.

3. Don’t be afraid to take up some space – Taking up space by for example sitting or standing with your legs apart a bit signals self-confidence and that you are comfortable in your own skin.

4. Relax your shoulders – When you feel tense it’s easily winds up as tension in your shoulders. They might move up and forward a bit. Try to relax. Try to loosen up by shaking the shoulders a bit and move them back slightly.

5. Nod when they are talking – nod once in a while to signal that you are listening. But don’t overdo it and peck like Woody Woodpecker.

6. Don’t slouch, sit up straight – but in a relaxed way, not in a too tense manner.

7. Lean, but not too much – If you want to show that you are interested in what someone is saying, lean toward the person talking. If you want to show that you’re confident in yourself and relaxed lean back a bit. But don’t lean in too much or you might seem needy and desperate for some approval. Or lean back too much or you might seem arrogant and distant.

8. Smile and laugh – lighten up, don’t take yourself too seriously. Relax a bit, smile and laugh when someone says something funny. People will be a lot more inclined to listen to you if you seem to be a positive person. But don’t be the first to laugh at your own jokes, it makes you seem nervous and needy. Smile when you are introduced to someone but don’t keep a smile plastered on your face, you’ll seem insincere.

9. Don’t touch your face – it might make you seem nervous and can be distracting for the listeners or the people in the conversation.

10. Keep you head up - Don’t keep your eyes on the ground, it might make you seem insecure and a bit lost. Keep your head up straight and your eyes towards the horizon.

11. Slow down a bit – this goes for many things. Walking slower not only makes you seem more calm and confident, it will also make you feel less stressed. If someone addresses you, don’t snap you’re neck in their direction, turn it a bit more slowly instead.

12. Don’t fidget – try to avoid, phase out or transform fidgety movement and nervous ticks such as shaking your leg or tapping your fingers against the table rapidly. You’ll seem nervous and fidgeting can be a distracting when you try to get something across. Declutter your movements if you are all over the place. Try to relax, slow down and focus your movements.

13. Use your hands more confidently – instead of fidgeting with your hands and scratching your face use them to communicate what you are trying to say. Use your hands to describe something or to add weight to a point you are trying to make. But don’t use them to much or it might become distracting. And don’t let your hands flail around, use them with some control.


14. Lower your drink – don’t hold your drink in front of your chest. In fact, don’t hold anything in front of your heart as it will make you seem guarded and distant. Lower it and hold it beside your leg instead.


15. Realise where you spine ends – many people (including me until recently) might sit or stand with a straight back in a good posture. However, they might think that the spine ends where the neck begins and therefore crane the neck forward in a Montgomery Burns-pose. Your spine ends in the back of your head. Keep you whole spine straight and aligned for better posture.


16. Don’t stand too close –one of the things we learned from Seinfeld is that everybody gets weirded out by a close-talker. Let people have their personal space, don’t invade it.


17. Mirror - Often when you get along with a person, when the two of you get a good connection, you will start to mirror each other unconsciously. That means that you mirror the other person’s body language a bit. To make the connection better you can try a bit of proactive mirroring. If he leans forward, you might lean forward. If she holds her hands on her thighs, you might do the same. But don’t react instantly and don’t mirror every change in body language. Then weirdness will ensue.


18. Keep a good attitude – last but not least, keep a positive, open and relaxed attitude. How you feel will come through in your body language and can make a major difference. For information on how make yourself feel better read 10 ways to change how you feel and for relaxation try A very simple way to feel relaxed for 24 hours.


You can change your body language but as all new habits it takes a while. Especially things like keeping you head up might take time to correct if you have spent thousands of days looking at your feet. And if you try and change to many things at once it might become confusing and feel overwhelming.


Take a couple of these body language bits to work on every day for three to four weeks. By then they should have developed into new habits and something you’ll do without even thinking about it. If not, keep on until it sticks. Then take another couple of things you’d like to change and work on them.

Tuesday, September 8, 2009

Creating tabbed windows in Sharepoint with jQuery

To get this working you need a Page Layout. I use one for our Home Page, called SiteHomePage.aspx. Open the page in your favorite editor (or take Sharepoint Designer), grab a cup of coffee and get started!

Set up the base structure with XHTML
I first started by creating the base structure. This is basically nothing else than a list with the Tab-titles and some DIVS for the Tab-content. The Tab-content will be added later using Web Part Zones.


Adding layout using CSS
Next, you need some CSS to make it display like tabs. I used these styles:

#tabs ul.tabNavigation{
margin: 0;
padding: 0;
list-style: none;
height: 22px;
/* Push the tabs 1px down to hide the top-border of the tabbedWindow */
position: relative;
top: 1px;
}
#tabs ul.tabNavigation li{
float: left;
padding: 0;
margin: 0 5px 0 0;
background: none;
}
#tabs ul.tabNavigation a{
background: url("tab_out.gif") no-repeat 0 0;
width: 172px;
display: block;
padding: 4px 0 3px;
}
#tabs ul.tabNavigation a.selected{
background-image: url("tab_click.gif");
}
#tabs ul.tabNavigation a span{
padding: 0 10px;
}
#tabs div.tabbedWindow{
padding: 10px;
background-color: #ecf4f2;
border: 1px solid #998b7d;
}
And finally, jQuery
Now you only need the magic to get this clickable - and that's where jQuery jumps in. I use the PlaceHolderAdditionalPageHead to load the jQuery library and the JavaScript functions in the header of the page.





That's all it takes to get it working. Smooth, easy and simple. And highly effective, I really like the way it works!