Ideas for free

April 11, 2007

MOSS 2007 : Publishing page from email, workflow

Diarsipkan di bawah: Office Server 2007, Tips and Tricks — cakriwut @ 8:19 am

MOSS 2007 provides out-of-the box (OOTB) document conversion process. It runs as job tools in MOSS job timer, and must be executed by the user. Now, the idea is to publish page into our ResepOke.Com from email attachment – so we don’t need to go to web site anymore to create a new page.

The solution

Since the OOTB document conversion only work from limited number of filetype (for example docx into aspx) – then we can not use email format to publish to page directly. Therefore, we will create the page in docx and attach to email to publish to site. In the server, we need an event receiver to detect new incoming document and trigger document conversion process. However, instead of creating an event receiver we can use a visual studio workflow solution.

Step-by-Step

1. Configure document library to receive from email

EmailWF1

EmailWF2

2. Create a component/class to extract embedded image and store into site images library.

3. Create a componen/class to launch document conversion process. You need correct transformer ID,

public class Tranformer
{
public const string Docx = “{6dfdc5b4-2a28-4a06-b0c6-ad3901e3a807}”;
public const string Docm = “{888d770d-d3e9-4d60-8267-3c05ab059ef5}”;
public const string Infopath = “{853d58f5-13c3-46f8-8b81-3ca4abcad7b3}”;
public const string Xsl = “{2798ee32-2961-4232-97dd-1a76b9aa6c6f}”;
}

4. Incorporate all component into visual studio workflow solution and deploy to the site. The workflow will check for docx document and execute image parsing and document conversion process.

EmailWF

5. Add workflow to site and attach to the document. Don’t forget to set-up start-up option of the workflow too.

EmailWF4

EmailWF5

And voila, if you send email to resepoke@plasmedia.com, then your page will be automatically published.

MOSS 2007: Branding the publishing page

Diarsipkan di bawah: Office Server 2007, Tips and Tricks — cakriwut @ 7:51 am

Today, I’ve bring a session in Vista Launch in JHCC senayan. It talks about Building Enterprise Content Management solution.

You probrably already know that in WSS 3.0 we can use master pages to create branding to our site. Moreover, in MOSS 2007, we have content query web part which is very powerfull tool to play with.

For example, we are going to brand our site to looks like the picture below. ResepOke.Com a fictitious receipts and foods review site want to publish their content using MOSS 2007 publishing template.

Branding1

We change the navigation into button, and use content query web part to display page content into frontpage. We also list last 15 entries in the frontpage.

Step-by-step

1. Create new publishing site using publishing template and apply blackband.master, because it close to our design.

Branding3

2. Create static HTML page, with style and slicing design. Copy paste the HTML code into blackband.master. We need to extract which part should be in master page. (See blue box).

Branding4

3. From the new master page, create new page layout for welcome page and page layout for content page. In this case you only need to right click blackband.master in Sharepoint Designer and select “Create new page from master”.

4. In the new page layout page, we must define the content part for the page. For welcome page, I create two column table with single row. In each column, I put webpart zone (See red and white box). For content page, I create single column table and a webpart zone in that column.

Branding2

5. Change page layout for ~/pages/default.aspx to the new welcome page layout. And also change page layout for document to the new content page layout.

6. Drop Content Query Web part into ~/pages/default.aspx and export into a .webpart file. Open the file using text editor and find “CommonViewFields” property change into

<property name=”CommonViewFields” type=”string”>ExternalUrl,URL;PublishingPageImage,Image;PublishingPageContent,Note;</property>

7. Import back the modified webpart into default page and delete the first one.

8. Using Sharepoint Designer, find StyleSheets library and open ContentQueryMain.xsl. Goto line 152, and find

<xsl:otherwise>
<xsl:apply-templates select=”.” mode=”itemstyle” />
</xsl:otherwise>

change into

<xsl:otherwise>
<xsl:apply-templates select=”.” mode=”itemstyle”>
<xsl:with-param name=”CurPos” select=”$CurPosition” />
</xsl:apply-templates>
</xsl:otherwise>

9. In the same library, open ItemStyle.xsl and add new stye template for item formatting.

10. Modify Content Query Webpart property and apply the new style item.

Yeah, all has been done without single line of compiling / coding, only need a bunch of XSLT.

Blog pada WordPress.com.