Showing posts with label microsoft. Show all posts
Showing posts with label microsoft. Show all posts

Sunday, November 25, 2012

Displaying custom User Name in the Welcome Menu

I have seen so much content about approaching this problem in several ways, which to me are kind of solutions that they either:

-Force you to spend un-necessary long man-hours,

-Write too much of custom codes (writing user controls, etc.),

-Makes you try to understand the Welcome.ascx user control (really?? why? Microsoft has already done that).

So eventually, I ended up writing this post for the benefit of all.

SharePoint is an awesome “PLATFORM”, yes, I call it a platform. Not a Tool, or Application or a CRM or a portal, or a …. and the list goes on. By calling it a platform, I am encapsulating all of them together.

So, with so many stuff already provided out-of-box, we only need to know how to leverage them in a best possible manner to our benefits.

By leveraging, I also mean utilizing the excellent work that is being done by one of the Microsoft’s biggest community, the SharePoint community. You’ll find tons & tons.

The one such work that I am referring to is the SharePoint Services Library on CodePlex. Please find it here.

By using this, I have gotten to get this working in the most minimal way that I could find. Below are the pieces of the code that you would need to get your Welcome menu read aloud “Welcome Tango Charlie”. Pre-requisites being that you have a properly configured User Profile (and of course, if your name is Tango Charlie).

Okay, so we are going to modify our SP 2010 Master Page and place some lines of code in the <head> section.

Step 1: You may download the .js file and insert a script reference to the SPServices library within your <head>…</head> tags:

<script type="text/javascript" src="/_layouts/scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/_layouts/scripts/jquery.SPServices-0.7.2.min.js"></script>

Pre-requisites:

a) You should make sure that you have a JQuery script references before referring to SPServices.

b) Refer the SPServices on CodePlex as the JQuery version requirements are strict for what version of SPServices you are using.

Step 2: Place the below script anywhere within your <head>…</head> tags as long as they follow the tags mentioned in Step 1.

<!-- Format the Welcome Menu -->
<script language="javascript" type="text/javascript">
        $(function() {
            var userFirstName = $().SPServices.SPGetCurrentUser({
                fieldName: "FirstName",
                debug: true
            });

            var userLastName = $().SPServices.SPGetCurrentUser({
                fieldName: "LastName",
                debug: true
            });
           
            var displaySection = $('span.ms-welcomeMenu').children('a.ms-menu-a').children('span');
            var textToShow = 'Welcome ' + userFirstName + ' ' + userLastName;
            // Set the text back to the Welcome Menu
            displaySection.text(textToShow);

          });

</script>

And that’s it. You have your name displayed with the “Welcome” prefix.

Try playing with the combinations/permutations of [fieldName: "FirstName"] and [fieldName: "LastName"] to get different text to display. Good Luck.

Friday, November 23, 2012

No item exists at http://servername/sitename/pagename.aspx?ID=88. It may have been deleted or renamed by another user

So, We have upgraded our MOSS 2007 to SharePoint 2010. One of the other challenges that we have been facing after this Database Attach process is that the links having query string parameters have started to fail (Surprisingly…..this error appears randomly on different links). The error it generates is : “No item exists at http://servername/sitename/pagename.aspx?ID=88. It may have been deleted or renamed by another user”

Well, as soon as I searched for this error, I got to see this Microsoft Support article having a resolution to this issue. You can find it here: http://support.microsoft.com/kb/972225

According to Microsoft, this is a know issue and this is what they suggest:

Change the query string parameter from ID to CustomID. Then change the details page from QueryString(ID) to QueryString(CustomID). Once this is done the page will display with no errors.”

So, when I changed my link URLs to “http://servername/sitename/pagename.aspx?BID=88” everything worked fine.

But here are a couple of questions that has kept me wondering, and I am still looking for an answer to them:

#1. My 2007 sites work perfectly with this piece of code. So does that mean, this issue has been introduced in SP 2010?

#2. Even in 2010, not all the links with query string parameters (?ID=nn) are failing. Some seem to work. This seems very weird. Any answers to this?

Friday, November 2, 2012

Setting up SharePoint 2013 Development Environment - Part 5

This is the Part 5 of the series for setting up a development environment for SP 2013 on a VM. As we know, this is the latest release for the new Microsoft stack of products that involves Windows Server 2012, SQL Server 2012, Visual Studio 2012 and SharePoint Server 2013 (or SP 15).
In this part 5, we will focus on the configuration of the PowerPivot for SharePoint 2013 using the PowerPivot for SharePoint 2013 Configuration tool.

Let’s start the PowerPivot for SharePoint 2013 Configuration tool.

clip_image002

Bummer!!! – We have an Error on the very first step.

image

Why 14.0.0.0?? Please note that there are 2 versions of this tool as described here.

So we incorrectly ran the PowerPivot for SharePoint Configuration tool. (Note there is no 2013 here).

Let’s try again and run the correct version this time, PowerPivot for SharePoint 2013 Configuration tool.

Nope, still seeing the same error!

Okay, let us try to see the Configuration Tool screen right behind this error message:

image

Can this be a pointer to an incorrect version of SQL Server? Let’s verify this with the standard MSDN post here.

Here’s the image for a quick reference:

image

Hmm…. That looks weird. I have “2100.1”, whereas MSDN says “2853.0”.

Okay, got it. I actually forgot to install the SQL SP1 CTP4 feature. Let’s go back and install it now from location: (www.microsoft.com/en-us/download/details.aspx?id=34700).

image

Once the install completes, start PowerPivot for SP 2013 Configuration Tool again.

You should be able to see this screen:

image

Click Ok. Next provide the appropriate Pass-Phrase and the PowerPivot Server for Excel Services Name:

image

See here if you want to learn more about this screen.

Then Click Validate. If you provided all correct information you’ll see the validation success message, Click OK. (Else follow the details on the error screen to fix the errors)

image

Click Run; click “Yes”, if you get a warning message:

image

This should start the process:

image

Once done, this completes the configuration process and it also completes this 5 Part series that I started almost a couple of weeks back.

Now you may go back to the creation of the SP Site Collection and start exploring the whole new world!!

Wednesday, October 31, 2012

Setting up SharePoint 2013 Development Environment - Part 4

This is the Part 4 of the series for setting up a development environment for SP 2013 on a VM. As we know, this is the latest release for the new Microsoft stack of products that involves Windows Server 2012, SQL Server 2012, Visual Studio 2012 and SharePoint Server 2013 (or SP 15).
In this part 4, we will focus on Installing SharePoint Server 2013 (popularly known as SP 15).
- Start the SharePoint installation.
image
image
After restarting and initial install of the preparation tool:
clip_image002
The server restarts again to complete the pre-requisites install:
clip_image003
Next, start the SP 2013 installation again and click the next link “Install SharePoint Server”.
If you see this error screen, you must restart the server before proceeding.
clip_image005
Once restarted, start the setup again, provide the keys, and accept the License Agreement.
On the “Choose a file location” screen, note the new path that SP 2013 is going to install itself. (I was wondering why I didn’t get to choose from the Install type: “Complete” or “Stand Alone”?).
clip_image007
Click “Install Now”. Once you see the completion screen, let the check-box be selected and click Close.
clip_image009
This should start the Configuration Wizard.
Click Next. Click “Yes” on the Services restart pop-up.
clip_image010
clip_image012
Click Next. Verify the Wizard Summary and click Next. The setup takes a while before you see the completion wizard step. Click Finish. This brings up the next screen, click “Start the wizard”:
image
Choose the “SPConfigAcct” service account created earlier from the “Use existing managed account” drop down, leave all the services selected as-is and click Next.
image
image
IMPORTANT: As discussed earlier, please do not create a Site Collection at this point of time. We need to first get back to the PowerPivot configuration tools and complete the remaining steps.
So, hit “SKIP” now to come to see this screen:
image
This completes the SharePoint Server 2013 installation.
At this point of time, let’s take another snapshot of the VM.
We will now move to the Part 5 of this series, where we will get back to finishing the configurations of PowerPivot for SharePoint Integration modes, as discussed in Part 3.

Saturday, October 6, 2012

Adding Content to a SP 2010 Master Page

 

There are situations when we need some external content to be displayed in the master page, and at the same time allow users to easily update this content without much hassles of code-changes to the master page. I went hunting for the same and eventually identified a few of them. Here’s a compilation of what I felt beneficial to all. Let me know, if you have more on your list.

#1. You can create a user control and insert into the Master page footer. Click here for more details.

#2. You can insert the webpart directly into the Master page footer. Let’s see how.

<table cellpadding="0" cellspacing="0" width="875" align="left">
  <tr><td>
      <WebPartPages:ContentEditorWebPart AllowClose="true" AllowEdit="false" AllowHide="false"
                    AllowMinimize="false" AllowRemove="false" AllowZoneChange="false" ChromeType="None"
                    ContentLink="/Documents/Footer.htm" ID="vha_simple_footer" runat="server"
                    __WebPartId="{9AADFFEC-FA65-4BB7-BAE6-4DA3A85A56A0}" WebPart="true"></WebPartPages:ContentEditorWebPart>
   </td></tr>
  </table>

#3. In case your site pages are all based upon few Page Layouts, you “might” place some ContentPlaceHolders on these page-layouts, and then add the footer code into a content editor web part on a page that is based upon the Page Layout. Refer this article from Bamboo Solutions for a complete details on creating a custom page layout for a Publishing Site using Visual Studio 2010

#4. You may also use “Reusable Content” in SP Publishing HTML fields to achieve the same. Find here.

#5. Then there are IFrames, the old ways of displaying a web page content. Well, I know, most of us would start a discussion around the SEO, when we talk about IFrames on the pages. But it still works and provides another way to get external content into a master page. (Although, I personally know, how powerful iframes programing can be. Check here.)

This is how to get this in place. Insert the below piece of code, in the footer section of the master page:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr><td>
       <iframe src="/Documents/Footer.htm" scrolling="no" frameborder="0">[Your browser does not support frames or is currently configured not to display frames. Please use an up-to-date browser that is capable of displaying frames.]</iframe>
</td></tr></table>

Next, upload the “Footer.htm” file with appropriate code in the [Documents] document library of the root site. I have a sample code for this file as:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head></head>
<body>
<div align="center"><span style="font-size:10pt">External footer content example</span></div>  </body>
</html>

I agree, this one is not the best of the practices, and I would advice not to consider this as a first hand solutions when other options might be more suitable for similar scenarios.

Sunday, August 26, 2012

Office 365 Enterprise Preview & SP 2013

So….now we are all talking about Apps in SharePoint 2013 and its integration with Office 365. Well it’s all about developing in the “Cloud” and more like what we are used to hear about SharePoint Online, Apps, Agave, Napa, etc.…..

Microsoft has introduced so many new terms that it is becoming really challenging for all developers (and for the whole SharePoint community) to keep pace with the whole new stack of new technology. So you might be wondering…what are we trying to come out with here!

Well….I am going to simply bring some basic concepts of “Getting There”. Not try to deal all at once and confuse you all, lets try to begin with Office 365.

First of all we need to have an account to start using this. Microsoft has this Office 365 Registration Form where you can get an account created quickly. And this being the “Enterprise Preview”, you have the leisure of using it until the Preview is made available by Microsoft.

Once you have your account setup, your Dashboard should look like this:

image

Click on “service settings” from the left navigation. This will bring up a new top navigation bar, click “sites”. On the next page, click “Create site collection”.

image

Click OK and you’ll be taken to the below SharePoint Administration Center page:

image

If we open the first URL in the Site Collections, which should read something like: https://yourcompanyname.sharepoint.com

And because you are the Administrator of this site, you can see the Home page of your site.

image

Disclaimer: The steps mentioned in this post are for the “Office 365 Preview” only. Things are expected to change and may not be the same after the Preview ends and Microsoft moves on to a new release.

So this is all in this part. I’ll talk more about how and what we can do with the available Apps and Downloads sections that we see here.

Friday, January 7, 2011

Working with PowerShell “cmdlets”

Pronounced “Command-lets”, cmdlets are a great way of scripting Administrative tasks in SharePoint 2010. I personally feel that I was missing such a tool till last year working with MOSS 2007. But with cmdlets, it looks extremely promising that Microsoft has ultimately provided the SharePoint Administrators – a single platform to script their tasks and run commands remotely/locally.

Recently, I was trying to look into these cmdlets and here are some quick view into some of the most basic ones.

Interestingly, these cmdlets are in a format that resembles the verb-noun pair. The noun generally starting with a “SP” for all SharePoint cmdlets.

#1. Get-SPContentDatabase: This gives you a list of all the Content DBs in your farm, with information on ID, Name, Server and Site count.

Okay, now you must be thinking that I am going to get nasty by listing down all these cmdlets, uhh… you are definitely wrong.

Instead, I just figured-out how to retrieve a list of such SP cmdlets and also how to pull more information about each of them.

Get-Command and Get-Help can be really handy for anyone starting on these. Here’s an example of how to use the Get-Command.

Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell”

Further-more, if you start creating your own scripts, you would also need to start using these two very often:

> Measure-Command: This gives you the cmdlets execution time.

> Trace-Command: gives you the ability for debugging short scripts.

Technorati Tags: ,,

Monday, June 1, 2009

Microsoft Search "Bing" launched today

The most surprising news for today I came to know is that of Microsoft going live this morning with the new "Google Rivalry", ahead of its scheduled June 3rd launch date. Well, MS has already invested a lot to distinguish itself from the earlier efforts in search. Certainly there’s far more verb potential in Bing than “Microsoft Live Search,” the service it’s supposed to replace.

So if you visit www.live .com today you'll be redirected to the www.bing.com as here:

image

Cool !!! Head-to-head with Google.

This is a quest for survival. MS knows it got to take this on.

So few people believe that the term "Bing" could actually have been derived from "Bing Is Not Google".

Now that means business to Microsoft.

Technorati Tags: ,,,,

Monday, February 9, 2009

Installing Windows 7 Beta on my VPC

Great !!! So last week-end I was successfully able to install Windows 7 Beta on the Microsoft Virtual PC 2007.

Pretty slick ! Based on the similar lines of Vista, Windows 7 follows a very much identical approach to getting things started up and running.

I will try to get the walk-through document and upload here very soon. This would include the screen-shots of each step I captured during the install.

Stay tuned !!!

Technorati Tags: ,,,,,

Monday, February 2, 2009

SharePoint Dispose Checker Tool

This one was a long awaited from Microsoft. They have released "SPDisposeCheck" which looks at the code in SharePoint and confirms that there are no memory leakages or extra memory consumption. As we are all aware of, this has been an issue since long going un-noticed into the deployment. So let's use this tool to run our projects through this checker before we go for any deployments.

Visit the MSDN code page and download SPDisposeCheck

Technorati Tags: ,,,

Friday, January 30, 2009

Web Development Helper

This is a good one!!!

We as a Web Developer may want to leverage this awesome HTTP sniffing tool.  This tool is a great asset when doing web client development like Flash, Silverlight, AJAX, and other likes.  As a Microsoft developer we have these two tools, and they are free :-) Fiddler and Web Development Helper.  I’m getting to like this Web Developer Helper.

It actually sits is your browser.  So you just need to turn it on and  get an explorer bar at the bottom showing all that you need.

Take a look at it.

Technorati Tags: ,,,

Tuesday, November 6, 2007

What has Bill Gates to offer as a latest Technology

The latest from Microsoft !!!!

Bill Gates has announced a new vision from Microsoft Stacks which may open a new window towards the Unified Communications.

Announcing the availability of Microsoft RoundTable, an advanced video and VoIP conferencing device that provides a 360-degree view of a meeting room, along with wideband audio and video that tracks the flow of conversation between multiple speakers. With RoundTable and Office Live Meeting or Office Communications Server, meeting participants in different locations will be able to converse and share information as if they were in the same room. RoundTable also enables companies to record meetings for later use.

http://www.microsoft.com/mscorp/execmail/2007/10-16unifiedcommunications.mspx