Monday, June 22, 2009

Making SharePoint not look like SharePoint: An Odyssey - Part 1

Like I posted earlier, I have been working with a SharePoint design/branding project. I have to say that the available documentation for this is pretty vague. There is a lot of “you could do A, or B, or C” high level talk but very little details of the technical implementation of each option. Maybe it is because there are too many variable to write a comprehensive book.

Regardless, I am going to walk you through the way I did it. I doubt this is the best for everyone but this is low-code/minimum complexity way to create custom master page. In this project, I attempted to mimic an existing, public facing website for an internal portal. I did this by adding one customized master page, one CSS file, and a handful of graphics. I made no custom JavaScript and never fired up Visual Studio – this was done entirely from SharePoint Designer 2007.

After reading a lot of books and how to articles, I decided on some general rules for anyone tackling this for the first time:

Do not modify the basic SharePoint objects. Open and save as but do not just directly edit the default CSS styles, master pages, or graphics. It is highly likely that service packs or other upgrades will overwrite your changes. Also, it is sometimes hard to go back.

Double check your backups before you start. You have a pretty good chance to really screw things up so make sure you are backed up and run a test restore before you get started.

Never delete a tag from the master page. The master page forms the ultra-flexible “skin” for the website and these place holder objects tell other pages where you want things parked. If you are missing a placeholder, you get error messages. You can move place holders around and apply formatting but you have to publish with all of them. I create a panel at the bottom of my web pages that is hidden and park all of the placeholders I do not want to have displayed down there.

Don’t start from scratch. There is Microsoft TechNet article that tells you how to create an empty master page and you can design to your heart’s content. If you are new to this, like I was, “green field” development is tempting but just say NO. Open an existing master page and save as. You get some junk you don’t want but you will start with something that works.

SharePoint likes nested tables - live with it. I know that current web design treats nested tables as the dark spawn of Satan that leads to ultimate damnation but, unfortunately, SharePoint behaves better with nested tables. I am not sure why that is the case, but much of the pre-installed web components appear to assume that you are in nested tables where their CSS formatting is going to be isolated from the rest of the page. When the different styles become intermixed, you get some very entertaining results.

Test the Edit Page functions often. When trying to get the branding to look right, create the look, tweak the CSS, adjust the graphics, and take a look at the final page. Do yourself a big, big favor and select “Modify Web Part”, “Edit Page”, or any other site administrator function on the page. You may have accidentally shrunk, hidden, or mangled the toolbars that people need to actually get work done.

Monday, June 01, 2009

SharePoint Customization and Branding

I found a really good SharePoint related site from a consultant in called Clever Workarounds. I read through his four part series on SharePoint branding and made some additional experiments.

Whenever you want to change look and feel of a website, you normally want to adjust the CSS files that control it. Cascading Style Sheets are relatively straight forward and seem to behave logically. For example, you can have multiple definition of a paragraph and whichever style is applied last wins. It would seem that if you added your own CSS link, tweaked the settings you want, you wouldn’t make any changes to the preinstalled files. That way, patches and upgrades wouldn’t destroy your work - simple, right?

However, SharePoint has a big problem with this. The key problem with custom branding for SharePoint is that a large part of the functionality in SharePoint is defined by the CORE.CSS style sheet. No problem, right? You just need to add another CSS file below it in the header, and you’re done. Well, actually, it is not that simple. Unfortunately, the way that SharePoint builds the pages, the CORE.CSS file is always last - thus making it always be dominant.

Looking at the Clever Workarounds pages, it looked like getting around that would be very, very complicated. However, in reading the comments, there seemed like their might be a good way around it. Here is the comment (edited slightly for length):

Remember the Cascading part of cascading style sheets and the specificity of each rule. It doesn’t matter if your css rule appears before or after core.css If you want your rule to win you make it more specific. I have used this approach since SharePoint 2001 and have never had any problems. I place a unique, short ID attribute on my body element in the master page. Example Then when I find a rule that I want to override that core.css is currently rendering I create a duplicate rule in my stylesheet but place #dm in front of the rule. So for example .ms-WPHeader in core.css becomes #dm .ms-WPHeader in my stylesheet. Now that I have a more specific rule my style rule wins. Works every time … and it requires no custom code or major modifications to SharePoint.

So, I gave this a shot:
  • You create your own CSS page and link to it.
  • At the body level, inside a table tag, or whatever makes since, add the ID tag (the commenter used DM for his example but it can be anything)
  • View your pages and see what CORE.CSS styles need changing
  • The internet explorer Developer Toolbar is very useful for this
  • In your custom CSS page, create rule with the same name and add the #ID in front of the definition
  • Save and refresh – repeat as necessary.

Doing some development work

Recently, I’ve doing some development work instead of my more normal systems administration work. I’ve always done VBScript scripting of administration tasks, started fooling with PowerShell, and have always been messing around with websites but I’ve been going past that, recently. I’ve had a couple of things I’ve been working on:

  • Creating custom “look and feel” to SharePoint sites
  • Creating web parts for SharePoint sites
  • Creating a C# web application for linking an outsourced CRM system to Groove
  • Creating a C# console application to read three different calendars and then create a survey questionnaire based on information inside the meeting

It has been a real challenge I’m going to try and write some posts based on what I learned. For those of you with real developer experience, you will probably laugh over some of the things I had trouble with. Hopefully, if there is any other sysadmin that needs to do some quick prototype code, they can benefit from my experiments.

Tuesday, April 21, 2009

Thoughts on Japan

I have been here for over a year now, and I have come to appreciate a lot of the little things about Japan. Sure Tokyo is a noisy place, things are a bit crowded but there are so many things that make life easy:
  • Our condo has 24x7 automated lockers. When a delivery comes and we're not home, they put the box in this locker and code in our address. We can open it with this special card when we get home. You can use that locker to send boxed and dry cleaning, too, and they auto-bill our credit card.
  • Chiho found a company called Yoshikei ヨシケイ千葉 that does grocery delivery. The offer a menu of four meals per day and you order whichever one you like and they deliver the pre-measured ingredients to your day. There is almost no additional cost and there is no wastage.
  • We have a bread store at our train station and at a nearby grocery store that is way better than anything you'd find in Seattle. All of the French people in my office say that Japanese bakeries are as good as Paris bakeries - some are even better.
  • Most utility bills can be paid by direct bank deposit but you can pay all the others at any convenience store - with immediate credit for payment and no additional fee.

And that is just a short list. I will add some of the nice things in Japanese houses later.

Found an answer to my SharePoint question

I posted earlier about the odd behavior of the Advanced Search web part and I think I found my answer. That webpart assumes that you have a Enterprise Search site that was deployed from the MS stock template. There is a results.aspx page that works correctly.

Now, for my next project is to figure out how to get that to work without the Enterprise Search site, since that template is not available.

Thursday, April 09, 2009

Clever Workarounds

I found a good SharePoint and IT Project Management website recently called Clever Workarounds http://www.cleverworkarounds.com/. Really a good read on the project management side. Some of his SharePoint tricks are slightly out of date but 90% of them are really good. His project management stuff seems to be pretty much dead-on to me.

It is spring in Tokyo now

Things have been warming up and it is cherry blossom season here in Tokyo. We hit 19 degrees C so right around 70 degrees F yesterday and today. It is quite pleasant around here - almost time to pack up the sweaters and the heavy coats. I didn't take any pictures of the cherry trees and it is already past the best time for pictures - maybe next year.

Monday, April 06, 2009

Indexing PDF files with SharePoint

By default, neither MOSS 2007 or SharePoint Service v3.0 will index the contents of PDF file. The setup process is pretty simple and is outlined on Steven Van de Craen's Blog on an old post of his. I'm made sure to keep of copy of that one around.

Bought a Netbook

We just picked up a netbook for Chiho to use for studying. We picked up a ASUS 1000HE from BIC Camera and took advantage of a promotional from EMOBILE. They are a cellular data provider and if you sign up for a two year data contract, they discount the netbook - just like buying a cell phone, really. The list price of the laptop was just under $450 USD and by signing up for the data plan, the cost was about $30 instead.

EMOBILE's service is Tokyo is really pretty good and they offer 7.3mbs connections. I routinely speed test mine at over 5mbs which seems very good to me. The coverage area is cities only, not up on the mountains, but it covers all of the areas we are likely to travel.

Friday, April 03, 2009

Is Microsoft's technical documentation gettting worse?

I've been assigned a new project, recently, trying to assess Microsoft Office Communications Server 2007 R2 and I've been digging through the TechNet information. I'm just doing an inital pass, really, nothing in depth, and the documentation is kind of depressing. They have several reference topologies and these little case studies scattered about and they are just pitiful. The reference topolgy diagram is missing some important info - like the number of employees that the topology was designed for? Kind of important to know if the diagram is applicable to 5,000 users or 50,ooo users but that is not there.

I wanted to find out just a few things:
  • Is virtualization supported (hyper-v or vmware)
  • If so, which roles are good candidates for virtualization
  • As you move from simple to complex or small to big, which role can be combined onto one server and which should never be.
Isn't that fairly basic information? Or am I expecting too much for something that is new?

Wednesday, March 25, 2009

Finally got my Japanese drivers' license

It felt like it took forever but I finally got Japanesed drivers' license on Monday. I finally passed on my third try - boy these guys are picky, picky, picky...

Wednesday, March 18, 2009

Nice step-by-step for Outlook passwords

I found this one today and I was digging through Outlook 2007 password prompt issues for someone at work: http://www.petri.co.il/save-your-exchange-password-in-microsoft-outlook-2003-or-2007.htm

Odd ball error on SharePoint

I've come across a very odd error with Microsoft Office SharePoint Server 2007 (MOSS 2007) that I just can't figure out. On line searching is leading me around in circles.

With MOSS 2007, there is a default search page, _layouts/OSSSearchResults.aspx and you just paste in that URL into the Simple Search web part or the Advanced Search web part. The first page of results will display just fine using either web part. However, the "next page" link fails for the Advanced Web Part.

When you use the Simple Search web part, you get a long URL:

/_layouts/OSSSearchResults.aspx?k=test&cs=This%20Site&u=http....

K = the info you put into simple search
CS = scope for the search

When you hit next, the JavaScript appends more stuff to the URL and off you go - no problems at all.

/_layouts/OSSSearchResults.aspx?k=test&cs=This%20Site&u=http....&start1=11

The advanced search does not format a long URL. When you hit Next, you get a blank page. I have been looking through everything I can find about this web part and I have gotten nothing out of it. It seems that 90% of developers out there roll their own search web parts instead of use Microsoft's. Even on the office.microsoft.com search, the top articles are how to make your own.

Come on... can't I just used the built in one?

Friday, March 13, 2009

Crackberry withdrawl...

I didn't actually have a Blackbery, I had an HTC Windows Mobile phone, but I have to say good-bye to being connected to my work e-mail 24x7 for the first time in years. The phone is over two years old - almost three - so I guess it is time for some hardware issues to crop up. I can't figure out if it is related to the sliding keyboard or something internal to the phone but it turned off when bumped. Wedging the battery in place didn't work, either so it is off to the repair shop.


Though, it may not be. Our main office recently selected the iPhone as our default corporate phone - right before the global down turn frozen everyone's budget. So, there is a chance I will get something totally different, instead. In Japan, the iPhone is still restricted to a single carrier (SoftBank) and they are still charging a little extra for the iPhone data plan. That makes it a lot harder to justify it as a business expense.


You can buy 100% legal, unlocked iPhones from the Hong Kong Apple Store, as long as you have it shipped to a location in Hong Kong. We have sales guys traveling to Hong Kong all the time... very, very tempting...

Switched my commute around

This week, I decided to change the way I get to work. Instead of taking the Yurikamome (ゆりかもめ) I am taking the regular subway, connecting through the Yurakucho/Hibiya (有楽町&日比谷) stations.

It made me realize how well-connected the Tokyo area actually is. I have three different ways to get to work that get me there about the same time plus a couple of alternates that are little slower. I have a half dozen different ways of getting to work that do not involve a single car. Coming from Seattle, that is kind of a shock. I suppose that Seattle is getting better, and I know that Seattle is smaller, but still...

Wednesday, March 04, 2009

Week numbers

My current company has an interesting method for coordinating work: they assign week numbers as the targets and deadlines. Instead of saying "finish Phase X by April 15th" they will say "finish Phase X by week 15". I hadn't encountered that in an American company before so it struck me as odd.

We did have some fun this year, though. The ISO standard for week numbering did not match the USA formatting for week numbers so we had a little be of conflict this week.

Tuesday, March 03, 2009

Training in Nagoya

I took a bullet train(shinkansen - 新幹線) trip this morning to Nagoya(名古屋)run an afternoon of training classes today. The trip was about 2 hours and my E-Mobile wireless network card kept the connection almost the whole way. It only dropped connection in the tunnels and smoothly reconnected on the other side. Very impressive, really. Even though I'm zipping along at 200mph, the cellular card handled everything.

Tuesday, February 17, 2009

Japanese Drivers License

I took a half day off today and a half day off last week to take care of getting a Japanese drivers license. When you are a permanent resident, you can only use an International Permit for your first year. After that, you have to get a Japanese drivers license.

If you are from Europe, Australia, Hong Kong, or another half-dozen countries, this is a simple paperwork process. Those lucky people do not have to take any tests. Americans do have to take a written and practical driving test, though. Based on what I could research on the Internet, this is because drivers licenses are issued by the states and not the federal government so Japan cannot create a single, unified rule for all American drivers licenses. Americans still have a paperwork process to go through, though. You have to get your driver’s license translated at the Japan Automobile Federation (JAF) and then bring that, your foreigner registration card (外国人登録証明書 gaikokujin tōroku shōmeisho), a new photo, and passport to your local office. They will take the paperwork, give you a quick eye-test, give you the written test, and get you an appointment for the driving test.

The written test is ultra, ultra simple. It was a ten question, true or false test and you were allowed to miss two questions. The questions were so easy that you would have to be very tired not to get a perfect score.

The practical test is a lot tougher. Very few people who take the test pass on the first time because the inspectors are extremely picky. If you search on the expat sites about driver’s licenses, you will find a lot of people complaining about the practical test. You have to drive letter perfect and with exaggerated care in order to pass. There is a wiki site for the Ehime driver’s test that recommends that you actually vocalize your safety checks (Mirror OK! No one left, no one right, OK!, etc.) That might be a little overkill, I suppose, but it does get you past the test.

I took my test this morning but managed to fail it. The car needed a lot more brake than I was used to so I overshot a stop line early in the test and that was an automatic fail. Today was not really a fun morning… Oh well, I try again in two weeks.

Monday, February 16, 2009

A little humor for the morning

This is funny for anyone who's traveled in Japan or China. Though, to be fair, the quality of English signs in Japan is a lot better than it was 10 or 15 years ago. I assume that Japanese marketers advertisers got tired of being teased about it and spent more time on translations. Quality of English signs in China is pretty bad, though. From talking to the people from China at the office, everyone thinks that since there are fewer English speakers in China, it is harder to get a proofreader.

Sunday, February 15, 2009

One year - exact

February 15th is my exact one year anniversary of arriving in Japan, according to the date stamped in my passport. This year has gone past pretty dang fast but I guess that isn't too surprising considering how many things have changed.

My next major challenge is filing my American taxes. I've decided not to do them myself after I started to read IRS Publication 54 which is 40+ pages long and insanely complicated. Just trying to figure out the "physical presence" rules was confusing. Maybe I can go back to doing them myself next year or the year after but not this year.

I found a tax accountant in Hawaii that specializes in providing tax services for people living in Japan. He was well recommended in expat community websites here in Japan. We'll see how it turns out.