Sep
10
2008

WCF Add Service Reference issue with Visual Studio 2008 SP1

The other day I faced a strange issue when I wanted to add a service reference to the Tech Head Brothers authoring tool. The code generated wasn’t compiling with errors located in the file Reference.cs.

Drilling down the issue I figured out that the default namespace, TechHeadBrothers.Word, was the issue. It was just added at some place and at other not.

I made then a quick test with another assembly which had no dot in it’s name. That’s was it! The issue was the dot into the Assembly name, Default namespace.

Don’t use . in the name of your Assembly name, Default namespace to get back to normal state, weird!

Sep
6
2008

New step in my authoring tool using Word 2007

This evening I took the time to implement a new step on the new version of Tech Head Brothers authoring tool.

Now I am able to write an article in Word 2007 and post it using Web Services.

The next picture is the result of posting from Word 2007 on the web site using Web Services:

Here is how it looks like in Word:

To insert some source code sample as you can see on the Word 2007 picture or the web site, it is really easy. Go in Visual Studio, copy the code you want in the clipboard. Switch to Word 2007, then use the Source Code button:

To insert a picture, either use Windows Explorer to copy a file into the clipboard and paste it into the Word 2007 document, or use a tool like SnagIt from TechSmith (Thanks for the license by the way!!), make a screen shot, copy result into the clipboard and paste into Word 2007.

Is that easy!

This tool will make the authoring process on Tech Head Brothers so easy.

Aug
22
2008

Wowwwwww effect of my new Word 2007 authoring tool

I have reached now another step on the new authoring tool for Tech Head Brothers portal by having some authors installing this new version and starting beta testing it. Has you can see, with the following twit, it seems that the tool is on the good way:

From Rédo (french blog)

Just try the new beta tool of publishing for http://www.techheadbrothers... .... that's the Wouawwww effect !!! ... sorry, it's NDA ;p about 23 hours ago

From Jon Galloway (blog)

@laurentkempe Like I said, I'd pay money for it, and I'm very cheap. Very cool. about 15 hours ago from web in reply to laurentkempe

This tool let all authors write articles using a customized Word 2007, preview it offline in Internet Explorer as it will be seen on the portal and finally post the article to the portal directly from Word 2007. It is a replacement of THBAuthoring, my old tool found on CodePlex.

To achieve this goal I am using quite some technologies. First Word 2007, Ribbon, .NET Framework 3.5 SP1, VSTO 3.0, OpenXML, WordML, XML Schema, XSLT. Than for sure C#, Linq to XML, Linq to Object.

For the installation I use ClickOnce. That’s a great improvement! I had so much issues with THBAuthoring.

From an author point of view you are using a almost normal Word 2007 document with different predefined styles, bold, list… There is two exceptions:

  1. Source code
  2. Zip with sample code

The usage scenario for the inserting Source Code into the Word document is as following:

  1. Copy the code into the clipboard from Visual Studio 2008/2005
  2. Position the cursor into the Word 2007 document where you want to insert the Source Code
  3. Click on the button Source Code on the custom Ribbon
  4. That’s it, easy no?

This brings clear text of the source code into the document and colored source code into the HTML preview.

The usage scenario for attaching the Zip with the sample code is also easy:

  1. Click on the button Zip in the custom Ribbon
  2. In the opening File selector dialog browse to your zip file and select one
  3. That’s it, easy no?

Finally there is another usage scenario; inserting pictures:

  1. From Windows Explorer copy a picture file
  2. Position the cursor in the Word 2007 document
  3. Paste
  4. That’s it, easy no?

So, how does it work technically!

It works by doing a projection of the WordML to a well formed Tech Head Brothers XML document defined by an XML Schema. Then it uses a XSLT to produce HTML.

I hope to find the time to make a little video soon to demonstrate the way it is used!

Here is a picture of the tool

Feb
22
2008

Tech Head Brothers new authoring tool, step 5

Tonight my goal was to be able to view a picture into the web browser!

It is really cool to be able to copy a picture into Word, click on preview and see it in the HTML rendered out of my XML coming from WordML. So cool.

So the next steps will be:

  1. Projection of hyperlink
  2. Projection of picture
  3. Projection of numbered list and bullet list
  4. Giving the possibility to insert source code
  5. Projection of the source code
  6. Adding the possibility to the author to post the article directly from Word to Tech Head Brothers web site using secured web services made out of WCF
Feb
19
2008

Tech Head Brothers new authoring tool, step 4

I took some time this evening to work a bit on the new version of the publishing tool for Tech Head Brothers.

Tonight goal was to be able to have a first preview of the HTML rendering in offline mode.

In this scenario an author launch the Tech Head Brothers Word 2007 template, write the content of his article, then click on preview ("pré-visualisation" on the picture) ribbon button. This is a full offline scenario.

Behind the scene, the C# code associated with the Word 2007 template will do a projection of WordML to my own XML document format using a predefined XML Schema. This projection is done using LINQ to XML. Then it will make a XSLT transformation on that projection result, save the result as a html file and launch Internet Explorer to see the result, as you can see on the picture:

I am still missing some projection code for hyperlink, list, pictures and source code. But it is a very good start after 3-4 evening of work.

So the next steps will be:

  1. Projection of hyperlink
  2. Projection of picture
  3. Projection of numbered list and bullet list
  4. Giving the possibility to insert source code
  5. Projection of the source code
  6. Adding the possibility to the author to post the article directly from Word to Tech Head Brothers web site using secured web services made out of WCF

I really like LINQ (hidden message to a friend at MS ;)

Feb
17
2008

Tech Head Brothers new authoring tool, step 3

I started working on the GUI defining the Ribbon.

Now it was time to work on the mapping of the WordML to my XML Schema.

Here is a first result of a Word document in which I extract the different section, title and paragraph that are injected in a well formed XML document using my XML Schema.

Not bad after only some hours of work!

It is leveraging LINQ to XML to parse the WordML and build my targeted XML Document.

Aurel, Redo: What do you think?

Feb
16
2008

Tech Head Brothers new authoring tool, step 2

Today I had the time to go on a bit with the new version of Tech Head Brothers, as you can see on the picture.

I decided to use my last article as a test case for the tool.

I went from the Ribbon (Visual Editor) to Ribbon (XML), it is not anymore grahical edition of the Ribbon but I can do more than what I was able to do in the Visual Editor.

I started to implement some parsing logic, I first made a trial with an idea of Sébastien Ros and Fabien Reinle but finally got back to LINQ to XML to parse the WordML.

The general idea is to output a well formed XML document out of the WordML document.

The architecture I decided to use at the moment is to have special Word styles mapped to some part of my target XML structure. Doing so I can easily parse the WordML like this to get all pagaraph with Heading1 style:

var sections = 
    from p in styledPara
    where p.Elements(w + "pPr").Elements(w + "pStyle").First().Attribute(w + "val").Value == "Heading1"
    select p;
Feb
15
2008

Tech Head Brothers new authoring tool

Beginning of this week; during the Tech Days 2008 in Paris, I had the great pleasure to discuss with Aurelien Verla and Grégory Renard about Tech Head Brothers authoring and publishing tool.

We went then with Aurelien on more details about the tool and I must say that I came to is conclusion, even if the tool is a really good show case it could be better to hide the XML part to the users.

I then asked Julien Chable some advise about WordML and the way to integrate my idea into Word 2007. Finally I had a start point.

So I decided to start on this new version of the tool from scratch. It will be better using the Word 2007 Ribbon. I have to say that the integration in Visual Studio 2008 is just great! Without any first read on the subject, no documentation access (in the train back home, no wifi still), I made what you can see on the screen shot.

So in the future I hope that authors of Tech Head Brothers will enjoy this new tool, that will make I hope their life easier.

Stay tuned...

About Laurent

Laurent Kempé

Laurent Kempé is the editor, founder, and primary contributor of Tech Head Brothers, a French portal about Microsoft .NET technologies.

He is currently employed by Innoveo Solutions since 10/2007 as a Senior Solution Architect and certified Scrum Master.

Founder, owner and Managing Partner of Jobping, which provides a unique and efficient platform for connecting Microsoft skilled job seekers with employers using Microsoft technologies.

Laurent was awarded Most Valuable Professional (MVP) by Microsoft from April 2002 to April 2012.

JetBrains Academy Member
Certified ScrumMaster
My status

Twitter

Flickr

www.flickr.com
This is a Flickr badge showing public photos and videos from Laurent Kempé. Make your own badge here.

Month List

Page List