Internship 2010: Customizable html export for Impress

From Wiki
Jump to navigationJump to search

Updated: 13/10/10 (see Update History for details)

Overview

The current html export for OOo impress and draw application produces outdated html. The goal of this internship project is to create a new html export extension that will replace the currently available html export in impress and draw. The extension should make use of modern html elements including css and javascript and support a template system so that non coders are able to alter the results of the generated html output.


Goals/Requirements

  • An OOo extension that exports a set of files that make the current presentation document (or draw) viewable in any current browser
  • The extension must include a settings dialog to configure the output during export
  • The extension must support templates, a template will define the visual style and the user interaction elements like navigation buttons or table of contents etc.
  • Template must not be 'hard coded' in the extension so adding more templates is possible without changing and compiling source code.
  • The extension must include 2-3 sample templates that are both "user friendly" and "visual appealing“
  • The extension must support the key features from the old HTML export (export of links, adding additional information like creator, email, automatic slide advances, etc)
  • The extension must be able to also export selected text from the presentation like title, outline and subtitle text. This is mainly an accessibility feature to enable visually impaired users to read the contents of the exported presentation.
  • Export should an alternative text only view or a text overlay to support accessibility.
  • There should be no connection to the installed OpenOffice or any extensions, the files we put in the export directory must include everything needed.
  • The generated html file should be as simple as possible. All functionality should come from the template. Goal is to make developing, modifying templates easier for the user, not for us.
  • Templates should not make use of any javascript library to avoid conflicts with web pages where other versions of this library are used or incompatible other libraries are used.
  • All important configuration should be done during export.
  • Easy integration in existing web pages
  • The created output should provide a fall-back if javascript is disabled in the browser.
  • The templates used by the extension should be made installable via extensions themselves so others can contribute templates too.
  • Implement a powerful easy to use and easy to develop template system.
  • Automatic Presentation System(slide incrementer)
  • Support for outline and notes in the exported presentation.
  • Support for Audio.
  • Export should also contain information about the presentation.


Project plan

This section describes the various phases, bugs to be corrected and current domain of work.

Phases

PHASE I

  • Develop how templates will be implemented-- done
  • Develop a basic prototype template and format-- done
  • Define format of html output created by the extension -- done
  • Develop the JavaScript core and template development API(minimal form)-- done
  • Develop system to integrate in the existing HTML documents-- done

PHASE II

  • Develop a prototype template extension -- done
  • Implement the extension with basic export -- done
  • Add support for Index/Notes/TextView/Navigation to HTML/javasript. -- done
  • Implement the templates system with configuration/extension deployment support -- done

PHASE III

  • Specify configuration dialog -- done
  • Implement configuration dialog -- done
  • Develop 3 sample templates. -- done

PHASE IV

  • Test and Optimise the developed System and code under all systems and browser.-- done
  • Perform Fixes and improve the system if some imperfections and errors found. -- done
  • Write all documentations. -- in progress

PHASE V
All tasks mentioned below are part of exciting requirements, they are NOT in the current scope of the project, but if there is any time left in the end, following things will be tried upon.

  • Make one small simple browser based tool for non-coders, to make modifing templates a piece of cake.
  • Make a small browser based(cross platform) template development IDE to make development and deployment of templates easy.
  • Implement webcast support(with today's new age technology)

Enhancements/bugs to be cured

All reported bugs and needed enhancements are mentioned here, they will be worked upon in the final stages(phase IV).

  • Under firefox-Linux version, there is a problem extracting z-index values by javascript, where as in windows it work fine. -- CURED/fixed


Current Work Progress

playing with the export.. :)

Documentation

Information about the extension and its working.


Structure of export

The exported presentation will have following files and folders and their corresponding functions are listed below.


Directory Structure

  • Root(/)
    • Template(folder)
      • images
      • Default.js
      • Default.css
      • templateInfo.txt
    • Index.html
    • Resource(folder)
      • Presentation.js
      • Presentation.css
    • noJS(folder)
    • Slides(folder)
    • manual.txt
    • oooadd.js


Description:

  • Root: represents root folder in which presentation is exported.
  • Template: folder containing template files.
  • Images: the folder will contain template specific images.
  • Default.js: the javascript file for the template. Used to implement visual styles and other functionality.
  • Default.css: the css file for the template
  • templateInfo.txt: information about the template.
  • Index.html: the main HTML file to be executed in browser.(user will be asked to supply a name for this file during export.)
  • Resource: the folder containing the main HTML .js/.css resource files.
  • Presentation.js: javascript file for the presentation core. It is used to implement the basic core implicit functionality of the exported presentation.
  • Presentation.css: CSS file for the main HTML document.
  • Info.txt: information about the export and how to use it, user guide.
  • oooadd.js: it is the javascript file used to embed this presentation in other html document easily and automatically. See oooadd.js section below for details.



Embeding Presentation Information in the HTML Document

The information about the presentation has to be added in the exported HTML. It has to be done in user understandable way and clean enough for making the file less complex with easy accessibility of the information.


IDEA:
The idea was to use META tags for storing the metadata about the presentation. These tags will be created by the export extension during the time of export.


Chosen Details:

  1. Author: author name as exported by the extension.
  2. No. of slides: total number of slides.
  3. Presentation title: title of this presentation
  4. Software version: the version of OpenOffice software used.
  5. Export extension version: Version of the Extension
  6. Date/time created: Time stamp of export.
  7. Outline view: set 1 if user has enabled outline view during export configuration
  8. Notes view: set 1 if user has enabled notes view during export configuration


Syntax:
For each detail one meta tag will be inserted in the head section like:

<meta name=”name of the detail” content=”its value” />


Tags added in head section of the HTML:

<meta name=”oooAuthor” content=”its value” />
<meta name=”oooSlideCount” content=”its value” />
<meta name=”oooTitle” content=”its value” />
<meta name=”oooVersion” content=”its value” />
<meta name=”oooExportVersion” content=”its value” />
<meta name=”oooTimeStamp” content=”its value” />
<meta name=”oooOutline” content=”its value” />
<meta name=”oooNotes” content=”its value” />

The configuration data will also be added in the same manner for the javascript engine during the export.




Embed In Existing HTML Pages

The exported presentation can be easily embedded in the existing HTML pages and can show up in the page itself as an overlay without any redirection or page refreshes.

  • Definition: Trigger is the element of the HTML which will launch the presentation on clicking over it.


Steps To Embed:
There are 3 steps to embed the presentation in existing HTML.

  1. Export the presentation and save it in a folder anywhere in the file system or on any remote server.
  2. In the HEAD section of the HTML page in which you want to embed the presentation add:
    <script type="text/javascript" src="path/oooadd.js"></script>
    You don’t have to add any other file, it will automatically implement all CSS and and event handlers.
  3. In the body section, To any existing element ’OR’ you can create a new element of any type you can add following attributes to its tag to make it the trigger for launching presentation.
  • Required attributes:
    • Class = “presentationTrigger” if your element already have any class assigned then use class = “[pre assigned class][space]presentationTrigger” i.e. we are assigning two classes to that element.
    • Ooopath = “path to presentation root folder or URL to presentation stored in some remote location”
  • Optional Attribute(to provide flexibility):
    • ooobgColor // set background color of overlay background. Default: black
    • ooobgTrans // set transparency color of overlay background. Default: 80%
    • ooosize // set size of the presentation displayed, values(0-100) % w.r.t screen size. Default: 99.5%
    • ooobgMargin // set size of the backgroud margin, values(0-100) % w.r.t screen size. Default: 98%
    • oooOSD // if set '1' then will display message "click here to launch presentation" on bringing the mouseover the target, set '0' if you have your own event handlers for "onmouseover/onmouseout" default value is '0'

If any or all optional attributes are not defined explicitly then default values will be automatically taken.
NOTE: all variables, functions, objects, attributes start with prefix ’ooo’ to minimize the conflict in the names within the document.
Examples:

<div(or any element) class="presentationTrigger" ooopath="path to presentation folder"></div(or any element)>
<div class="presentationTrigger" ooopath="samplePresentation"></div>
<div class="presentationTrigger" ooopath="cache/samplePresentation"></div>
you can also link to remote presentations:
<div class="presentationTrigger" ooopath="http://www.site.com/folder/samplePresentation"></div>


FEATURES:
Following are the features of this system:

  1. can have multiple triggers in each page.
  2. Simple to understand and use
  3. Highly customizable
  4. Can embed multiple separate presentations in one page
  5. Can embed remote presentations with webcast
  6. No need to wrap elements in <a></a> tags, all event handling applied automatically.
  7. Even amateur novice users can understand and customize, NO javascript knowledge required, and all parameters/Attributes are custom made for easy understanding by any user.
  8. NO need to configure javascript files, all done using attributes,
  9. Each trigger can have its own settings for the presentation launch, see the link above for what I am trying to say.
  10. The presentation is 100% isolated from the parent HTML. i.e. if both the parent webpage and the presentation have some “class|id|variables|functions” of common name then also there will be NO conflict between them.
  11. By default the class name for trigger is “presentationTrigger” , but in certain cases user might require to change the class name to one of his, then that could be done simply by adding one META tag in the head section:
<meta name=”oooTriggerClass” content=”theNewClassName” />



Structure of Main HTML file

The main HTML page will be more like a skeleton defining the core required elements.


Navigational elements and other elements related to additional look and feel will not be added beforehand in this HTML, they will be added dynamically by the presenter.js if requested by the template, this method will help remove code duplication and will simplify the HTML file.


The HTML file will have 100% DIV based layouts, no tables. These DIV’s in the HTML will be styled and placed by the template automatically on loading. All these DIV’s will have self explanatory class names and ID’s for easy interpretation by the end users.


The HTML will also contain one NO-JavaScript Trap to aid viewing in non JavaScript browsers. Will display a message and provide rollback to a non javascript version.


The main advantage of this structure is that: templates will get full control of look and feel, will make the export highly customizable, template developing will be very easy and it will encourage development of very creative templates.


Even template development and customization will be easy by the people who are NOT experts or have LESS JavaScript knowledge.


for the structure of the HTML file, see the Source Code section.



Template Related Files

Templates have following files:


Images Folder It contains images associated with the template
Default.js The JavaScript file which define the elements and functionality of the template. Template API Library can be used by the template in this file.
Default.css The CSS file used by the template to define style of various elements.


Template API Library

Template developers are provided with a library to make developing presentation templates easy. And it will also solve the problem how templates will be integrated and used. A guide will be developed to explain all the methods and uses of the API library with tutorials for template building. will be made online by next month. Keep looking..

Template add-on Extension Format

This Export filter will allow other third party templates to be used to format the HTML output. These templates will be installable as Extensions.

Steps to build your own add-on extension

  1. Create the template for the filter, for building help see "template building guide(will be uploaded in the later stages)"
  2. Download the Empty Template Directory structure and unzip its contents to a folder say "root". that folder will contain the directory structure and some other files required by the template.
  3. copy all your images used by your template in the images folder
  4. copy default.jss and default.css file to the 'res' folder. also copy inject.html file if defined in your template to the 'res' folder.
  5. copy the preview.png and preview_hc.png files to 'res' folder
  6. copy all other files in the extras folder. these files will be copied to the template directory of the exported presentation as it is.
  7. open file template.xcu and add your template details in the fields marked.
  8. feel free to add information if required in the text documents in the 'extras' folder.
  9. now select all files in the 'root' folder and right click on them and select compress/add to archive. create a .zip archive. rename this archive(change its extension also) to <anyName>.oxt(e.x. myTemplate.oxt)
  10. now your template is ready.. hurray!


for advanced users, they can feel free to modify the folder names but dont forget to reflect the changes in template.xcu file.

Proposed Settings Dialogues

Option One

the first option. size: 600 x 450 (WxH)
NOTE: the Preview Button in the dialog below should read "Enlarge", a typing mistake

NewHtmlexDial.PNG

Option two

following are the proposed designs for the export dialog, option two.
Nd1b.png Nd2b.png Nd3b.png Nd4b.png Nd5b.png

Option 3

This is a proposal by Frank Loehmann of the Oracle Open Office User Experience Team. It is based on the two initial versions above. Since this dialog will be an OOo extension we have some limitation for OOo 3.3 (i.e. no tabs possible).

Status: Early draft, more discussion needed

Open questions:

  • Not sure about export resolution settings.

HTML Export DLG.png

Goal is to have good defaults and only the really necessary options visible. User should choose a template and then hit Export.

  • Options button shows a separate dialog on top of current dialog with the rest of the export options.

Option 4

This is a proposal by Alister Hood (not quite the same as his earlier description on the UX mailing list). The aim is to make the dialogue as simple as possible without making users click to reach a second dialogue to check advanced settings.

HTML dialogue2.png

Option 5

This is another option by me(Kushal Likhi). i have taken inspirations from all the suggestions and proposed this. 600x500(wXh)

Newdialhtmlex.png

Option 6

I have emphasized the visual preview of export templates since they enable the user to make decisions quicker. Regards, Andreas.


AndreasBartel HTML Export.png

Option 7

Another option by Alister Hood. Based on removing the "preview" area from Option 6.

HTML dialogue3.png

Option 8

after inspirations from option 6 and option 7, here is the mock up draft, by Kushal Likhi

Latestdilahtmlex.png

Downloads

various downloads

Template Building Guide

this is the template building guide Download: File:Template building guide2.pdf

Oxt Extension

This is the Basic working build with a basic default template. built using Linux Fedora13 and DEV300_m83.

Documentation in .pdf format

This under progress work, it will be updated slowly with time.

Sample Template Extension

here is a sample Template add-on Extension for the html filter.

Source Code

you can download the complete up to date source code here. version: 2-21/9/10

SOURCE CODE

Contain working source for the extension buildVersion-1.6.6 Dated:13/oct/10 The code below will be updated as the development will progress.(this source code is not complete or final, a lot of things have to be done, its for monitoring progress)

Export Extension End

Source code for files at the export extension end.


services.cxx

it defines services offered by the extension.

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"

#include "htmlex.hxx"

#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::registry;


namespace
{
    static Reference< XInterface > Create_HTMLExporter( const Reference< XComponentContext >& _rxContext )
    {
        return *(new HTMLExporter( _rxContext ));
    }
}

extern "C" void SAL_CALL component_getImplementationEnvironment(
    const sal_Char **ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
{
    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}

namespace
{
    typedef Reference< XInterface > (SAL_CALL * ComponentFactory)( const Reference< XComponentContext >& );

    struct ComponentDescription
    {
	    const sal_Char*	    pAsciiServiceName;
	    const sal_Char*     pAsciiImplementationName;
        ComponentFactory    pFactory;

        ComponentDescription()
            :pAsciiServiceName( NULL )
            ,pAsciiImplementationName( NULL )
            ,pFactory( NULL )
        {
        }
	    ComponentDescription( const sal_Char* _pAsciiServiceName, const sal_Char* _pAsciiImplementationName, ComponentFactory _pFactory )
            :pAsciiServiceName( _pAsciiServiceName )
            ,pAsciiImplementationName( _pAsciiImplementationName )
            ,pFactory( _pFactory )
        {
        }
    };

    static const ComponentDescription* lcl_getComponents()
    {
        static const ComponentDescription aDescriptions[] = {
            ComponentDescription( "com.sun.star.document.ExportFilter", "com.sun.star.comp.documents.HTMLExExporter", Create_HTMLExporter ),
            ComponentDescription()
        };
        return aDescriptions;
    }
}

extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
{
	Reference< XRegistryKey > xRootKey( static_cast< XRegistryKey* >( pRegistryKey ) );

	::rtl::OUString sRootKey( "/", 1, RTL_TEXTENCODING_ASCII_US );

    const ComponentDescription* pComponents = lcl_getComponents();
    while ( pComponents->pAsciiServiceName != NULL )
	{
		::rtl::OUString sMainKeyName( sRootKey );
		sMainKeyName += ::rtl::OUString::createFromAscii( pComponents->pAsciiImplementationName );
		sMainKeyName += ::rtl::OUString::createFromAscii( "/UNO/SERVICES" );

		try
		{
			Reference< XRegistryKey >  xNewKey( xRootKey->createKey( sMainKeyName ) );
            xNewKey->createKey( ::rtl::OUString::createFromAscii( pComponents->pAsciiServiceName ) );
		}
		catch( Exception& )
		{
			OSL_ASSERT( "OModule::writeComponentInfos: something went wrong while creating the keys!" );
			return sal_False;
		}
        ++pComponents;
    }
    return sal_True;
}

extern "C" void* SAL_CALL component_getFactory(
    const sal_Char* pImplementationName, void* /*pServiceManager*/, void* /*pRegistryKey*/ )
{
    ::rtl::OUString sImplementationName( ::rtl::OUString::createFromAscii( pImplementationName ) );

    Reference< XSingleComponentFactory > xFactory;

    const ComponentDescription* pComponents = lcl_getComponents();
    while ( pComponents->pAsciiServiceName != NULL )
	{
        if ( 0 == sImplementationName.compareToAscii( pComponents->pAsciiImplementationName ) )
        {
            Sequence< ::rtl::OUString > sServices(1);
            sServices[0] = ::rtl::OUString::createFromAscii( pComponents->pAsciiServiceName );

            xFactory = ::cppu::createSingleComponentFactory(
                pComponents->pFactory,
                sImplementationName,
                sServices,
                NULL
            );
            break;
        }

        ++pComponents;
    }

    // by definition, objects returned via this C API need to ber acquired once
    xFactory->acquire();
    return xFactory.get();
}


htmlex.hxx

header file for the HTMLExporer

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifndef INCLUDED_HTMLEX_HXX
#define INCLUDED_HTMLEX_HXX

#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>

#include "Template.hxx"
#include "htmlexDataStructures.hxx"
#include "commonTasks.hxx"
#include "logWriter.hxx"
#include <cppuhelper/compbase2.hxx>
#include <cppuhelper/basemutex.hxx>

typedef ::cppu::WeakComponentImplHelper2< 
    com::sun::star::document::XFilter,
    com::sun::star::document::XExporter > HTMLExporterBase;


// prototype of the HTMLExporter Class
class HTMLExporter : private cppu::BaseMutex, public HTMLExporterBase
{
public:
//constructor for the class
    explicit HTMLExporter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
 
// XFilter 
    virtual sal_Bool SAL_CALL filter( const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rFilterData ) throw(com::sun::star::uno::RuntimeException);

//on cancel
    virtual void SAL_CALL cancel() throw();

// XExporter 
    virtual void SAL_CALL setSourceDocument( const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xDocument )
        throw( com::sun::star::lang::IllegalArgumentException );

	

private:
	com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
	com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > mxServiceFactory;
	com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > mxURLTransformer;
	com::sun::star::uno::Reference< com::sun::star::document::XExporter > mxGraphicExporter;
	com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > mxFileAccess;

	//get folder where extension is installed
	void getPackedFilesURL();	
	//wrapper to copy a file, implements commonTasks copy function
	bool copyFile(const rtl::OUString& rSourceURL, const rtl::OUString& rDestURL, bool Replace);
	//create basic directory structure
	void createFolders( com::sun::star::util::URL aBaseURL );
	//create the main HTML file 
	void createHTMLFile( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream, const rtl::OUString& rsDocumentTitle );
	//write configurations in the metadata of the HTML Document
	void writeHTMLMetaData( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream, const rtl::OUString& aTitle );
	//make images for slides, and populate buffers
	void createSlideImagesAndData();	
	//copy core files
	bool copyCoreFiles();
	//copy files of the selected template
	void copyTemplateFiles();
	//create a standalone HTML export of the presestation without any Javascript.
	void createNoJsPresentation( const rtl::OUString& rsDocumentTitle );
	//get name of the slide image
	rtl::OUString getSlideImageName( sal_Int32 nPageIndex, bool bIsHD );
	//write index data buffer to stream
	void writeIndexData( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
	//write text view data buffer to stream
	void writeTextViewData( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
	//write notes data buffer to stream
	void writeNotesData( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
	//write sound data buffer to stream
	void writeSoundData( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
	//write template specific HTML elements to stream
	void writeTemplateSpecificData( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
	//aquire log the slected configurations.
	void getConfigurations();
	//save as in ODF format
	void savePresentationODF();
	//create archive of exported files.
	void createArchive();
	//write index head details in the index buffer
	void writeIndexHead();
	//write sound head details in the sound buffer
	void writeSoundHead();
	//write text view head details in the text buffer
	void writeOutlineHead();
	//write notes view head details in the notes buffer
	void writeNotesHead();
	//write index foot details in the index buffer
	void writeIndexFoot();
	//write sound foot details in the sound buffer
	void writeSoundFoot();
	//write text view foot details in the text buffer
	void writeOutlineFoot();
	//write notes view foot details in the notes buffer
	void writeNotesFoot();
	//write details of sound in buffer
	void writeSoundDetail( sal_Int32 nSerialNo, rtl::OUString sFileName );
	//write index entry in buffer
	void writeIndexDetail( sal_Int32 nSerialNo, rtl::OUString sSlideTitle );
	//write notes entry in buffer
	void writeNotesDetail( sal_Int32 nSerialNo, rtl::OUString sNotes );


// configuration data static
	rtl::OUString msImageExtension;
	rtl::OUString msImageFolderName;
	rtl::OUString msExtensionVersion;
	rtl::OUString msLogFile; 
// configuration data from dialog
	bool mbEnableNotes;
	bool mbEnableIndex;
	bool mbEnableText;
	bool mbIndexOnStart;
	bool mbLinkToPresentation;
	bool mbExportHiddenSlides;
	bool mbEnableSound;
	bool mbEnableHD;
	bool mbSaveArchive;
	bool mbSaveLog;
	rtl::OUString msAutoTime;
	sal_Int32 mnStandardHeight;
	sal_Int32 mnStandardWidth;
	sal_Int32 mnHDHeight;
	sal_Int32 mnHDWidth;
	sal_Int32 mnSelectedTemplateSno;				
	rtl::OUString msAuthor;
	rtl::OUString msDocumentTitle;
	rtl::OUString msEmail;
	rtl::OUString msCopyright;
	rtl::OUString msArchiveName;
	rtl::OUString msArchiveExtension;
	Template maTemplate;



// document model access
	com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel;
	com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDrawPages;
	
//private data
	com::sun::star::util::URL maDocumentBaseURL;
	com::sun::star::util::URL maExtensionBaseURL;
	com::sun::star::util::URL maCompleteURL;
	sal_Int32 mnSlideCount;	
	rtl::OUString msIndexBuffer;
	rtl::OUString msNotesBuffer;
	rtl::OUString msTextBuffer;
	rtl::OUString msSoundBuffer;
	
	commonTasks mTask;
	logWriter mLog;

	
};

#endif

htmlex.cxx

the main C++ file for the HTMLExporter

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"
#include "htmlex.hxx"
#include "nonJavaScriptExport.hxx"
#include <boost/preprocessor/stringize.hpp>
#include <osl/time.h>
#include <osl/file.h>
#include <osl/thread.h>
#include <osl/diagnose.h>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/deployment/XPackageInformationProvider.hpp>
#include <stdio.h>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>



//------------------------------------------------------------------------------------------------

using rtl::OUString;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::io;
using namespace com::sun::star::util;
using namespace com::sun::star::frame;
using namespace com::sun::star::task;
using namespace com::sun::star::text;
using namespace com::sun::star::drawing;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::deployment;
using namespace com::sun::star::presentation;
using namespace com::sun::star::document;

//------------------------------------------------------------------------------------------------
// constructor for HTMLExporter class
//------------------------------------------------------------------------------------------------
HTMLExporter::HTMLExporter( const Reference< XComponentContext >& xContext )
: HTMLExporterBase( m_aMutex )
, mxContext( xContext, UNO_QUERY_THROW )
, mxServiceFactory( xContext->getServiceManager(), UNO_QUERY_THROW )
, mxURLTransformer( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer" )), xContext), UNO_QUERY_THROW )
, mxGraphicExporter( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicExportFilter")), xContext), UNO_QUERY_THROW )
, mxFileAccess( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), xContext), UNO_QUERY_THROW )
, msImageExtension( RTL_CONSTASCII_USTRINGPARAM( "png" ) )
, msImageFolderName( RTL_CONSTASCII_USTRINGPARAM( "slides" ) )
, msExtensionVersion( RTL_CONSTASCII_USTRINGPARAM( "1.0b" ) )
, msLogFile( RTL_CONSTASCII_USTRINGPARAM( "log.txt" ) )
, maTemplate( xContext )
, mTask(xContext)
, mLog(xContext) 
{
}

//------------------------------------------------------------------------------------------------
//get the url of the location where extension is installed.
//------------------------------------------------------------------------------------------------
void HTMLExporter::getPackedFilesURL()
{
	Reference<com::sun::star::deployment::XPackageInformationProvider> xProvider( mxContext->getValueByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.deployment.PackageInformationProvider"))),UNO_QUERY_THROW);

	OUString sURL( xProvider->getPackageLocation(rtl::OUString::createFromAscii( BOOST_PP_STRINGIZE(HTMLEX_IMPL_IDENTIFIER))));
	
	//fill all menbers of maExtensionBaseURL
	maExtensionBaseURL.Path = mTask.normalizeFolderPath( sURL );
	maExtensionBaseURL.Name = OUString();
	maExtensionBaseURL.Complete = sURL;

	//Logging
	mLog.log("\r\n|| Extension root determined to: ");
	mLog.log(maExtensionBaseURL.Complete,"\r\n");
}


//------------------------------------------------------------------------------------------------
// function to copy a file
//------------------------------------------------------------------------------------------------
bool HTMLExporter::copyFile(const rtl::OUString& rSourceURL, const rtl::OUString& rDestURL, bool Replace)
{

	//logging
	mLog.log("Copying File: ");
	mLog.log(rSourceURL," ||TO|| ");
	mLog.log(rDestURL," || STATUS:: ");
	
	if(!mxFileAccess->exists(rSourceURL))
	{
		mLog.log("ERROR:Source file not found \r\n");
		return false;
	}
	if(mTask.copyFile(rSourceURL,rDestURL,Replace))
	mLog.log("Successfully Copied \r\n");
	return true;
}


//------------------------------------------------------------------------------------------------
// create target directory structure
//------------------------------------------------------------------------------------------------
void HTMLExporter::createFolders(URL aBaseURL)
{
	mLog.log( "\r\n|| Creating Directory Structure \r\n" );
	URL aCreateDirBase;
	OUString aDirList[4];
	aDirList[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( "resource" )); 
	aDirList[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( "template" )); 
	aDirList[2] = OUString(RTL_CONSTASCII_USTRINGPARAM( "nojs" )); 
	aDirList[3] = OUString(RTL_CONSTASCII_USTRINGPARAM( "template/images" )); 
	sal_Int32 aDirCount = 4;
	for(sal_Int32 i = 0; i < aDirCount; i++)
	{
		aCreateDirBase = aBaseURL;
		aCreateDirBase.Path += aDirList[i];
		aCreateDirBase.Name = OUString();		
		mxURLTransformer->assemble( aCreateDirBase );
		mLog.log( "creating directory: " );
		mLog.log( aCreateDirBase.Complete, "\r\n" );
		if( !mxFileAccess->exists( aCreateDirBase.Complete ) )
			mxFileAccess->createFolder( aCreateDirBase.Complete );		
	}


}


//------------------------------------------------------------------------------------------------
//XImporter
//------------------------------------------------------------------------------------------------
void SAL_CALL HTMLExporter::setSourceDocument( const uno::Reference< lang::XComponent >& xDocument ) throw( lang::IllegalArgumentException )
{
	mxModel.set( xDocument, UNO_QUERY );
	OUString sAuthorName;

	if( mxModel.is() )
	{
		Reference< XDrawPagesSupplier > xDPS( mxModel, UNO_QUERY );
		if( xDPS.is() )
			mxDrawPages.set( xDPS->getDrawPages(), UNO_QUERY );

		Reference< XDocumentPropertiesSupplier  > xDPropsS( mxModel, UNO_QUERY );
		if( xDPropsS.is() )
		{
       			Reference< XDocumentProperties > xDProps = xDPropsS->getDocumentProperties();

       			if( xDProps.is() )
			{
               			sAuthorName = xDProps->getAuthor();
               			msDocumentTitle = xDProps->getAuthor();
			}
       			
		}
	}

	// we need a document with draw pages to export them
	if( !mxDrawPages.is()  )
		throw lang::IllegalArgumentException();


	if(sAuthorName.getLength() == 0)
		sAuthorName = OUString( RTL_CONSTASCII_USTRINGPARAM("unknown") );

		msAuthor = sAuthorName;

	if(msDocumentTitle.getLength() == 0)
		msDocumentTitle = OUString(RTL_CONSTASCII_USTRINGPARAM("untitled"));


	mLog.log("\r\n|| Source document Set \r\nauthor name detected to: \r\n");
	mLog.log(msAuthor,"\r\n");

}


//------------------------------------------------------------------------------------------------
// XFilter the big one!! its responsible for filtering process
//------------------------------------------------------------------------------------------------
sal_Bool SAL_CALL HTMLExporter::filter( const uno::Sequence< beans::PropertyValue >& rFilterData ) throw( uno::RuntimeException )
{
    sal_Bool bRet = sal_False;
    if( mxModel.is() )
    {
	//defining things
        const OUString sOutputStream ( RTL_CONSTASCII_USTRINGPARAM ( "OutputStream" ) );
        const OUString sStream ( RTL_CONSTASCII_USTRINGPARAM ( "StreamForOutput" ) );
	const OUString sDocumentBaseURL( RTL_CONSTASCII_USTRINGPARAM ( "DocumentBaseURL" ) );

	Reference< XOutputStream > xOutputStream;
	Reference< XOutputStream > xStreamForOutput;

	OUString sCompleteURL;

	// parse parameter from the com::sun::star::document::MediaDescriptor service 
        const beans::PropertyValue* pAttribs = rFilterData.getConstArray();

        sal_Int32 nAttribs = rFilterData.getLength();

        for( sal_Int32 i = 0; i < nAttribs; i++ )
        {

            if ( pAttribs[i].Name == sOutputStream )
                pAttribs[i].Value >>= xOutputStream;
            else if ( pAttribs[i].Name == sStream )
                pAttribs[i].Value >>= xStreamForOutput;
			else if ( pAttribs[i].Name == sDocumentBaseURL )
				pAttribs[i].Value >>= sCompleteURL;
	}

	mLog.log("\r\n|| Parsing MediaDescriptor \r\nDocument Title: ");
	mLog.log(msDocumentTitle,"\r\n");
	OUString aLogPath;

	if( !xOutputStream.is() )
		xOutputStream = xStreamForOutput;

	Reference< XStatusIndicator > xStatusIndicator;
	try
 	{

		Reference< XController > xController( mxModel->getCurrentController());
		if( xController.is())
		{
			Reference< XFrame > xFrame( xController->getFrame());
			if( xFrame.is())
			{
				Reference< XStatusIndicatorFactory > xFactory( xFrame, UNO_QUERY );
				if( xFactory.is())
				{
					xStatusIndicator = xFactory->createStatusIndicator();
				}
			}
		}
	}
	catch( Exception& )
	{
		mLog.log("\r\nERROR: Exception caught in initializing status indicator");
	}

	xStatusIndicator->start(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Started") ),100);

	if( xOutputStream.is() ) try
	{
		// fill out all members of maDocumentBaseURL
		maDocumentBaseURL.Complete = sCompleteURL;
		mxURLTransformer->parseStrict( maDocumentBaseURL );
		maCompleteURL.Complete = sCompleteURL;

		mLog.log("xOutputStream Confirmed \r\nSave URL: ");
		mLog.log(sCompleteURL,"\r\n");


		//get data from configurations or log it if available
		getConfigurations();
		if(mbSaveLog)
			{
				aLogPath = maDocumentBaseURL.Path;
				aLogPath += msLogFile;
				mLog.setLogFilePath(aLogPath);
			}

		xStatusIndicator->setText( OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Finding Extension Location!! Completed 10%") ));
		xStatusIndicator->setValue(10);

		getPackedFilesURL();

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Creating folders!! Completed 20%") ));
		xStatusIndicator->setValue(20);
			
		createFolders( maDocumentBaseURL );

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Copying Core Files!! Completed 30%") ));
		xStatusIndicator->setValue(30);

		copyCoreFiles();

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. copying Template files!! Completed 40%") ));
		xStatusIndicator->setValue(40);

		copyTemplateFiles();

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Exporting slides and Data!! Completed 50%") ));
		xStatusIndicator->setValue(50);

		createSlideImagesAndData();

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Creating HTML File!! Completed 60%") ));
		xStatusIndicator->setValue(60);

		createHTMLFile( xOutputStream, msDocumentTitle );

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Creating NoJs Export!! Completed 70%") ));
		xStatusIndicator->setValue(70);

		createNoJsPresentation(msDocumentTitle);

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Saving ODT!! Completed 80%") ));
		xStatusIndicator->setValue(80);

		if(mbLinkToPresentation)
			savePresentationODF();

		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. Saving Archive!! Completed 90%") ));
		xStatusIndicator->setValue(90);

		if(mbSaveArchive)
			createArchive();
		xStatusIndicator->setText(OUString( RTL_CONSTASCII_USTRINGPARAM("Exporting HTML .. DONE!! Completed 100%") ));
		xStatusIndicator->setValue(100);
		
			
		bRet = true;
		xStatusIndicator->end();
	}
	catch( Exception& )
	{
		mLog.log("\r\nExceptions caught in the Big One!");
	}
    }

    
    return bRet;
}


//------------------------------------------------------------------------------------------------
// on cancel
//------------------------------------------------------------------------------------------------
void SAL_CALL HTMLExporter::cancel() throw()
{
	mLog.log("\r\nCalled Cancel\r\n");
}


//------------------------------------------------------------------------------------------------
// get names for the slide images
//------------------------------------------------------------------------------------------------
OUString HTMLExporter::getSlideImageName( sal_Int32 nPageIndex, bool bIsHD )
{
	OUString sSlideImageName( RTL_CONSTASCII_USTRINGPARAM( "img" ) );
	sSlideImageName += OUString::valueOf( nPageIndex + 1 );
	if(bIsHD){sSlideImageName += OUString( RTL_CONSTASCII_USTRINGPARAM( "HD" ) );}
	sSlideImageName += OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) );
	sSlideImageName += msImageExtension;
	
	mLog.log( "\r\nSlide Image name set to: " );
	mLog.log(sSlideImageName,"\r\n");

	return sSlideImageName;
}


//------------------------------------------------------------------------------------------------
// create slide images and populate other data strings for index,notes,outline view,sound
void HTMLExporter::createSlideImagesAndData() //implement mbExportHiddenSlides here ,, seperate index and all
{
	if( mxDrawPages.is() ) try
	{
		// create images folder		
		URL aSlideFolderURL = maDocumentBaseURL;
		aSlideFolderURL.Path += msImageFolderName;
		aSlideFolderURL.Name = OUString();
		mxURLTransformer->assemble( aSlideFolderURL );
		if( !mxFileAccess->exists( aSlideFolderURL.Complete ) )
			mxFileAccess->createFolder( aSlideFolderURL.Complete );

		if(mbEnableSound)
		{
			// create Sounds folder		
			URL aSoundFolderURL = maDocumentBaseURL;
			aSoundFolderURL.Path += OUString( RTL_CONSTASCII_USTRINGPARAM( "sounds" ) );
			aSoundFolderURL.Name = OUString();
			mxURLTransformer->assemble( aSoundFolderURL );
			if( !mxFileAccess->exists( aSoundFolderURL.Complete ) )
				mxFileAccess->createFolder( aSoundFolderURL.Complete );
		}
		
		// bool to store the visibility of current slide.
		bool bVisible = true;
		// store current slide title.
		OUString sPageName;
		// store current slide sound path.
		OUString sSoundURL;
		// get the number of slides available including hidden slides
		const sal_Int32 nSlideCount = mxDrawPages->getCount();
		// initialising the exported slides count.
		mnSlideCount = 0; 

		//write index head details in the index buffer
		writeIndexHead();
		//write sound head details in the sound buffer
		writeSoundHead();
		//write text view head details in the text buffer
		writeOutlineHead();
		//write notes view head details in the notes buffer
		writeNotesHead();

		//looping for all pages
		for( sal_Int32 nPageIndex = 0; nPageIndex < nSlideCount; nPageIndex++ )
		{
			//current page components
			Reference< XComponent > xDrawPage( mxDrawPages->getByIndex(nPageIndex), UNO_QUERY_THROW );
			Reference< XDrawPage > xPage( mxDrawPages->getByIndex( nPageIndex ), UNO_QUERY_THROW );
			Reference< XPropertySet > xPageProps( xPage, UNO_QUERY );
			Reference< XFilter > xFilter( mxGraphicExporter, UNO_QUERY_THROW );


			//initializing and flushing
			sPageName = OUString();
			sSoundURL = OUString();
			bVisible = true;

			// user interface name of the current slide
			xPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LinkDisplayName" ) ) ) >>= sPageName;
			// url to slide sound file
			xPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ) ) >>= sSoundURL;
			// check if hidden
			xPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ) ) >>= bVisible;

			mLog.log("\r\n\r\nSlide is ");
			mLog.log( ((bVisible)?"visible":"hidden") );


			if( ((!mbExportHiddenSlides) && bVisible) || mbExportHiddenSlides )
			{
				//write sound details
				if( sSoundURL.getLength() != 0 )
				{
					writeSoundDetail(mnSlideCount, mTask.getFileNameFromCompletePath(sSoundURL) );
				}
				else
				{
					writeSoundDetail(mnSlideCount, OUString( RTL_CONSTASCII_USTRINGPARAM( "none" ) ) );
				}
				//write index details
				writeIndexDetail(mnSlideCount, sPageName);

				//write notes details

				Reference< XText > xText; 
				try
				{
				       Reference< XPresentationPage  > xPresPage( xPage, UNO_QUERY_THROW );
				       Reference< XShapes > xNotesShapes( xPresPage->getNotesPage(), UNO_QUERY_THROW );
				       for( sal_Int32 nShape = 0; nShape < xNotesShapes->getCount(); nShape++ )
				       {
				               Reference< XShape > xShape( xNotesShapes->getByIndex(  nShape ), UNO_QUERY );
				               if( xShape.is() && xShape->getShapeType().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.NotesShape" ) ) )
				               {
				                       // found it!
				                       xText = Reference< XText >( xShape, UNO_QUERY );
				                       break;
				               }
               
				       }
				}
				catch (Exception& )
				{
				       mLog.log("\r\n ERROR: Unable to get Notes");
				}
				OUString sNotesText;
				if( xText.is() )
				{
					sNotesText = OUString( xText->getString() );
				}
				mLog.log("\r\n\r\nRETRIEVED NOTES: \r\n");
				mLog.log(sNotesText,"\r\n");

				writeNotesDetail(mnSlideCount, sNotesText);					
				
				//write text details

				//create slides
				// define slide url.
				URL aSlideURL = aSlideFolderURL;
				aSlideURL.Name = getSlideImageName( mnSlideCount, false );
				mxURLTransformer->assemble( aSlideURL );
	
				
				Sequence< PropertyValue > aFilterData( 3 );
				aFilterData[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PixelWidth") );
				aFilterData[0].Value <<= (sal_Int32)mnStandardWidth; 
				aFilterData[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PixelHeight") );
				aFilterData[1].Value <<= (sal_Int32)mnStandardHeight;
				aFilterData[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Translucent") );
				aFilterData[2].Value <<= (sal_Bool)sal_False;
			
	
				Sequence< PropertyValue > aDescriptor( 3 );
				aDescriptor[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") );
				aDescriptor[0].Value <<= msImageExtension.toAsciiUpperCase();
				aDescriptor[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("URL") );
				aDescriptor[1].Value <<= aSlideURL.Complete;
				aDescriptor[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") );
				aDescriptor[2].Value <<= aFilterData;
	
				mxGraphicExporter->setSourceDocument( xDrawPage );
				xFilter->filter( aDescriptor );
				mLog.log( "Slide Image Saved: " );
				mLog.log(aSlideURL.Complete,"\r\n");
	
	
				//HD
				if(mbEnableHD)
				{
					aSlideURL = aSlideFolderURL;
					aSlideURL.Name = getSlideImageName( mnSlideCount, true );
					mxURLTransformer->assemble( aSlideURL );
		
					aFilterData[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PixelWidth") );
					aFilterData[0].Value <<= (sal_Int32)mnHDWidth;
					aFilterData[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PixelHeight") );
					aFilterData[1].Value <<= (sal_Int32)mnHDHeight;
					aFilterData[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Translucent") );
					aFilterData[2].Value <<= (sal_Bool)sal_False;
		
					aDescriptor[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") );
					aDescriptor[0].Value <<= msImageExtension.toAsciiUpperCase();
					aDescriptor[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("URL") );
					aDescriptor[1].Value <<= aSlideURL.Complete;
					aDescriptor[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") );
					aDescriptor[2].Value <<= aFilterData;
		
					mxGraphicExporter->setSourceDocument( xDrawPage );
					xFilter->filter( aDescriptor );
					mLog.log( "Slide Image Saved: " );
					mLog.log(aSlideURL.Complete,"\r\n");
				}//isHD

				mnSlideCount++;

			}//if(export logic)


		}//for


		//write index foot details in the index buffer
		writeIndexFoot();
		//write sound foot details in the sound buffer
		writeSoundFoot();
		//write text view foot details in the text buffer
		writeOutlineFoot();
		//write notes view foot details in the notes buffer
		writeNotesFoot();

	}//if(mxdrawPage)
	catch( Exception& )
	{
		mLog.log("HTMLExporter::createHTMLFile, exception caught!");
	}
}//function


//------------------------------------------------------------------------------------------------
// copy core files
//------------------------------------------------------------------------------------------------
bool HTMLExporter::copyCoreFiles()
{

	mLog.log("\r\n|| Copying Core Files \r\n");
	URL aTargetDirectory = maDocumentBaseURL;
	
	URL aSourceCss;
	aSourceCss.Complete = maExtensionBaseURL.Path;
	aSourceCss.Complete += OUString( RTL_CONSTASCII_USTRINGPARAM( "files/presentation.css" ) );
	mxURLTransformer->parseStrict( aSourceCss );	
	URL aTargetCss = aTargetDirectory;
	aTargetCss.Path += OUString( RTL_CONSTASCII_USTRINGPARAM( "resource" ) );
	aTargetCss.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "presentation.css" ) );
	mxURLTransformer->assemble( aTargetCss );
	if(!copyFile(aSourceCss.Complete, aTargetCss.Complete, true))
		return false;


	URL aSourceJs;
	aSourceJs.Complete = maExtensionBaseURL.Path;
	aSourceJs.Complete += OUString( RTL_CONSTASCII_USTRINGPARAM( "files/presentation.js" ) );
	mxURLTransformer->parseStrict( aSourceJs );	
	URL aTargetJs = aTargetDirectory;
	aTargetJs.Path += OUString( RTL_CONSTASCII_USTRINGPARAM( "resource" ) );
	aTargetJs.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "presentation.js" ) );
	mxURLTransformer->assemble( aTargetJs );	
	if(!copyFile(aSourceJs.Complete, aTargetJs.Complete, true))
		return false;



	URL aSourceIco;
	aSourceIco.Complete = maExtensionBaseURL.Path;
	aSourceIco.Complete += OUString( RTL_CONSTASCII_USTRINGPARAM( "files/favicon.ico" ) );
	mxURLTransformer->parseStrict( aSourceIco );	
	URL aTargetIco = aTargetDirectory;
	aTargetIco.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "favicon.ico" ) );
	mxURLTransformer->assemble( aTargetIco );	
	if(!copyFile(aSourceIco.Complete, aTargetIco.Complete, true))
		return false;



	URL aSourceManual;
	aSourceManual.Complete = maExtensionBaseURL.Path;
	aSourceManual.Complete += OUString( RTL_CONSTASCII_USTRINGPARAM( "files/manual.txt" ) );
	mxURLTransformer->parseStrict( aSourceManual );	
	URL aTargetManual = aTargetDirectory;
	aTargetManual.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "manual.txt" ) );
	mxURLTransformer->assemble( aTargetManual );	
	if(!copyFile(aSourceManual.Complete, aTargetManual.Complete, true))
		return false;


	URL aSourceAddJs;
	aSourceAddJs.Complete = maExtensionBaseURL.Path;
	aSourceAddJs.Complete += OUString( RTL_CONSTASCII_USTRINGPARAM( "files/oooadd.js" ) );
	mxURLTransformer->parseStrict( aSourceAddJs );	
	URL aTargetAddJs = aTargetDirectory;
	aTargetAddJs.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "oooadd.js" ) );
	mxURLTransformer->assemble( aTargetAddJs );	
	if(!copyFile(aSourceAddJs.Complete, aTargetAddJs.Complete, true))
		return false;

	URL aNoJsCss;
	aNoJsCss.Complete = maExtensionBaseURL.Path;
	aNoJsCss.Complete += OUString( RTL_CONSTASCII_USTRINGPARAM( "files/nojs.css" ) );
	mxURLTransformer->parseStrict( aNoJsCss );	
	URL aTargetNoJsCss = aTargetDirectory;
	aTargetNoJsCss.Path += OUString( RTL_CONSTASCII_USTRINGPARAM( "nojs" ) );
	aTargetNoJsCss.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nojs.css" ) );
	mxURLTransformer->assemble( aTargetNoJsCss );	
	if(!copyFile(aNoJsCss.Complete, aTargetNoJsCss.Complete, true))
		return false;


	return true;		
}


//------------------------------------------------------------------------------------------------
//function to export the presentation without javascript in NoJs folder
//------------------------------------------------------------------------------------------------
void HTMLExporter::createNoJsPresentation(const rtl::OUString& rsDocumentTitle)
{

	mLog.log( "\r\n|| Building NoJs output \r\nCreating files \r\n" );
		
	nonJavaScriptExport aNoJsExporter(mxContext,mxDrawPages,mbEnableNotes,mbEnableIndex,mbEnableText,mbExportHiddenSlides,mbEnableSound,mbEnableHD);

	OUString sBaseDir;
	sBaseDir = maDocumentBaseURL.Path;
	sBaseDir += OUString(RTL_CONSTASCII_USTRINGPARAM( "nojs/" ));

	aNoJsExporter.createFiles(sBaseDir, rsDocumentTitle, msAuthor);

	mLog.log(aNoJsExporter.mLog.getLog(),"\r\nCreating files completed");


}


//------------------------------------------------------------------------------------------------
//write metadata information
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeHTMLMetaData( const Reference< XOutputStream >& xOutputStream, const OUString& aTitle )
{
	OUString sSlideCount( rtl::OUString::valueOf(mnSlideCount,10) );
	OUString sVersion(RTL_CONSTASCII_USTRINGPARAM(BOOST_PP_STRINGIZE( OFFICE_VERSION )));
	OUString sTimeStamp;

	TimeValue aTime;	
	oslDateTime aCurrentTime;
	osl_getSystemTime( &aTime );
	osl_getDateTimeFromTimeValue(&aTime,&aCurrentTime);

	sTimeStamp += OUString::valueOf((sal_Int32)aCurrentTime.Day,10);
	sTimeStamp += OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ));
	sTimeStamp += OUString::valueOf((sal_Int32)aCurrentTime.Month,10);
	sTimeStamp += OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ));
	sTimeStamp += OUString::valueOf((sal_Int32)aCurrentTime.Year,10);
	sTimeStamp += OUString(RTL_CONSTASCII_USTRINGPARAM( " - " ));
	sTimeStamp += OUString::valueOf((sal_Int32)aCurrentTime.Hours,10);
	sTimeStamp += OUString(RTL_CONSTASCII_USTRINGPARAM( ":" ));
	sTimeStamp += OUString::valueOf((sal_Int32)aCurrentTime.Minutes,10);
	sTimeStamp += OUString(RTL_CONSTASCII_USTRINGPARAM( ":" ));
	sTimeStamp += OUString::valueOf((sal_Int32)aCurrentTime.Seconds,10);
	
	mLog.log( "\r\n||Writing HTML Metadats, see HTML file for details \r\n" );

	//aSlideCount = OUString( RTL_CONSTASCII_USTRINGPARAM ( nSlideCount ));

	mTask.writeUTF8String( xOutputStream,"<!-- *************** META INFORMATION ******************************* -->\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n");
	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooAuthor\" content=\"");
	mTask.writeUTF8String( xOutputStream,msAuthor);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooEmail\" content=\"");
	mTask.writeUTF8String( xOutputStream,msEmail);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooCopyright\" content=\"");
	mTask.writeUTF8String( xOutputStream,msCopyright);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");


	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooSlideCount\" content=\"");
	mTask.writeUTF8String( xOutputStream,sSlideCount);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooTitle\" content=\"");
	mTask.writeUTF8String( xOutputStream,aTitle);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooVersion\" content=\"");
	mTask.writeUTF8String( xOutputStream,sVersion);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooExtensionVersion\" content=\"");
	mTask.writeUTF8String( xOutputStream,msExtensionVersion);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooLinkToPresentation\" content=\"");
	mTask.writeUTF8String( xOutputStream,((mbLinkToPresentation)?"yes":"no"));
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");


	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooTimeStamp\" content=\"");
	mTask.writeUTF8String( xOutputStream,sTimeStamp);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooOutline\" content=\"");
	mTask.writeUTF8String( xOutputStream,((mbEnableText)?"yes":"no"));
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooNotes\" content=\"");
	mTask.writeUTF8String( xOutputStream, ((mbEnableNotes)?"yes":"no"));
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooIndex\" content=\"");
	mTask.writeUTF8String( xOutputStream,((mbEnableIndex)?"yes":"no"));
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooSound\" content=\"");
	mTask.writeUTF8String( xOutputStream,((mbEnableSound)?"yes":"no"));
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooHDEnabled\" content=\"");
	mTask.writeUTF8String( xOutputStream,((mbEnableHD)?"yes":"no"));
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooAutoTime\" content=\"");
	mTask.writeUTF8String( xOutputStream,msAutoTime);
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<meta name=\"oooWebcastStatus\" content=\"0\" />");

	mTask.writeUTF8String( xOutputStream,"\r\n<meta name=\"oooShowIndexOnStart\" content=\"");
	mTask.writeUTF8String( xOutputStream,((mbIndexOnStart)?"yes":"no"));
	mTask.writeUTF8String( xOutputStream,"\" />\r\n");

	mTask.writeUTF8String( xOutputStream,"<!-- *************** META INFORMATION ENDS *************************** -->\r\n" );

}


//------------------------------------------------------------------------------------------------
//create the main html file.
//------------------------------------------------------------------------------------------------
void HTMLExporter::createHTMLFile( const Reference< XOutputStream >& xOutputStream, const OUString& rsDocumentTitle )
{

	
	mLog.log( "\r\n|| Started Building HTML File \r\n" );

	mTask.writeUTF8String( xOutputStream, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" );
	mTask.writeUTF8String( xOutputStream, "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>");
	mTask.writeUTF8String( xOutputStream, rsDocumentTitle );
	mTask.writeUTF8String( xOutputStream, "</title>\r\n" );

// write Meta Data
	writeHTMLMetaData( xOutputStream, rsDocumentTitle );

// dependant/required files included
	mTask.writeUTF8String( xOutputStream, "<script type=\"text/javascript\" src=\"resource/presentation.js\"></script>\r\n");
	mTask.writeUTF8String( xOutputStream, "<link type=\"text/css\" rel=\"stylesheet\" href=\"resource/presentation.css\" />\r\n");
	mTask.writeUTF8String( xOutputStream, "<link type=\"text/css\" rel=\"stylesheet\" href=\"template/default.css\" />\r\n");
	mTask.writeUTF8String( xOutputStream, "<script type=\"text/javascript\" src=\"template/default.js\"></script>\r\n");
	mTask.writeUTF8String( xOutputStream, "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\r\n");
	
	mTask.writeUTF8String( xOutputStream, "</head>\r\n");

	mTask.writeUTF8String( xOutputStream, "<body>\r\n");
	mTask.writeUTF8String( xOutputStream, "<!-- Nothing unwanted in the body,, everything will be added by template realtime on demand. No Code Redundancy.. Hurray!! -->\r\n");
	mTask.writeUTF8String( xOutputStream, "<!-- there could be special template elements added during export process to add flexibility.. that completely depends on template designer and his/her creativity-->\r\n");
	mTask.writeUTF8String( xOutputStream, "<!--******************************************************************************************************************\r\n");
	mTask.writeUTF8String( xOutputStream, "Followind section is for Javascript RollBack.. this will only be displayed if javascript is disabled.. -->\r\n");
	mTask.writeUTF8String( xOutputStream, "<div id=\"NoJs\">\r\n");
	mTask.writeUTF8String( xOutputStream, "<h1 align=\"center\">Welcome!</h1>\r\n");
	mTask.writeUTF8String( xOutputStream, "<h2 align=\"center\">JavaScript Seems To Be Disabled!</h2>\r\n");
	mTask.writeUTF8String( xOutputStream, "<h4 align=\"center\"><a href=\"nojs/");

	mTask.writeUTF8String( xOutputStream, ((mbIndexOnStart)?"index.html":"s1.html") );

	mTask.writeUTF8String( xOutputStream, "\">Click Here To Launch Standard Non Javascript Version</a></h4>\r\n");
	mTask.writeUTF8String( xOutputStream, "<h4 align=\"center\">Or</h4>\r\n");
	mTask.writeUTF8String( xOutputStream, "<h4 align=\"center\">Enable JavaScript In Your Browser</h4>\r\n");
	mTask.writeUTF8String( xOutputStream, "</div>\r\n");

	mTask.writeUTF8String( xOutputStream, "<!-- Background -->\r\n");
	mTask.writeUTF8String( xOutputStream, "<div id=\"background\"></div>\r\n");


	// write index data
	if(mbEnableIndex)
		writeIndexData( xOutputStream );	

	// write text only view data
	if(mbEnableText)
		writeTextViewData( xOutputStream );

	//notes data
	if(mbEnableNotes)
		writeNotesData( xOutputStream );	

	if(mbEnableSound)
		writeSoundData( xOutputStream );

	mTask.writeUTF8String( xOutputStream, "<!-- TEMPLATE SPECIFIC ELEMENTS HERE (if any)-->\r\n");
	//template specific elements 
	writeTemplateSpecificData( xOutputStream );

	mTask.writeUTF8String( xOutputStream, "</body>\r\n");
	mTask.writeUTF8String( xOutputStream, "</html>\r\n");
	xOutputStream->flush();	

	
	mLog.log( "Finished Building HTML File \r\n" );
}


//------------------------------------------------------------------------------------------------
// function to copy template files
//------------------------------------------------------------------------------------------------
void HTMLExporter::copyTemplateFiles()
{
	mLog.log( "\r\n|| Copying Template Files \r\n" );
	mLog.log( "Templates Found: " );
	sal_Int32 aTemplateCount = maTemplate.TemplateCount;
	mLog.log( OUString::valueOf(aTemplateCount,10), "\r\n" );
	mLog.log("\r\nSaving template with Serial: 1\r\n");

	maTemplate.selectTemplate(mnSelectedTemplateSno);

	//logging selected template params
	mLog.log("\r\nTemplate Details: \r\n");
	mLog.log("UIName: ");
	mLog.log(maTemplate.UIName,"\r\n");
	mLog.log("Author: ");
	mLog.log(maTemplate.Author,"\r\n");
	mLog.log("Description: ");
	mLog.log(maTemplate.Description,"\r\n");
	mLog.log("PreviewImageURL: ");
	mLog.log(maTemplate.PreviewImageURL,"\r\n");
	mLog.log("TemplateURL: ");
	mLog.log(maTemplate.TemplateURL,"\r\n");
	mLog.log("ImagesDirURL: ");
	mLog.log(maTemplate.ImagesDirURL,"\r\n");
	mLog.log("ExtrasDirURL: ");
	mLog.log(maTemplate.ExtrasDirURL,"\r\n");
	mLog.log("HTMLInjectURL: ");
	mLog.log(maTemplate.HTMLInjectURL,"\r\n");
	mLog.log("UINameSupportedBrowsers: ");
	mLog.log(maTemplate.SupportedBrowsers,"\r\n");


	mLog.log("\r\nCopying Images");
	maTemplate.copyImages( maDocumentBaseURL );
	mLog.log("\r\nCopying Resources");
	maTemplate.copyJsCssFiles( maDocumentBaseURL );
	mLog.log("\r\nCopying Extra Files");
	maTemplate.copyMiscFiles( maDocumentBaseURL );

	mLog.log("\r\nDetails of template injection: \r\n");
	mLog.log(maTemplate.mLog.getLog(),"\r\nEnd of template Injection Details\r\n");

}


//------------------------------------------------------------------------------------------------
//Write Index data string
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeIndexData( const Reference< XOutputStream >& xOutputStream )
{
	mLog.log( "\r\n|| Writing Index Data \r\n" );
	mTask.writeUTF8String( xOutputStream, msIndexBuffer );
}


//------------------------------------------------------------------------------------------------
//write Text Data String
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeTextViewData( const Reference< XOutputStream >& xOutputStream )
{
	mLog.log( "\r\n|| Writing TextView Data \r\n" );
	mTask.writeUTF8String( xOutputStream, msTextBuffer );
}


//------------------------------------------------------------------------------------------------
//write Notes Data String
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeNotesData( const Reference< XOutputStream >& xOutputStream )
{
	mLog.log( "\r\n|| Writing Notes Data \r\n" );
	mTask.writeUTF8String( xOutputStream, msNotesBuffer );
}


//------------------------------------------------------------------------------------------------
//write template specific data
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeTemplateSpecificData( const Reference< XOutputStream >& xOutputStream )
{
	mLog.log( "\r\n|| Injecting Template HTML Data \r\n" );
	maTemplate.addHTMLData(xOutputStream);
}


//------------------------------------------------------------------------------------------------
//write sound data
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeSoundData( const Reference< XOutputStream >& xOutputStream )
{
	mLog.log( "\r\n|| Injecting Sound Data \r\n" );
	mTask.writeUTF8String( xOutputStream, msSoundBuffer );
}


//------------------------------------------------------------------------------------------------
//write index head details in the index buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeIndexHead()
{
	msIndexBuffer = OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- Index -->\r\n") );
	msIndexBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<div id=\"index\">\r\n") );
}


//------------------------------------------------------------------------------------------------
//write sound head details in the sound buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeSoundHead()
{
	msSoundBuffer = OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- Sound Data -->\r\n") );
	msSoundBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<div id=\"soundData\">\r\n") );
}


//------------------------------------------------------------------------------------------------
//write text view head details in the text buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeOutlineHead()
{
	msTextBuffer = OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- text only view -->\r\n") );
	msTextBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<div id=\"textOnly\">\r\n") );
}



//------------------------------------------------------------------------------------------------
//write notes view head details in the notes buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeNotesHead()
{
	msNotesBuffer = OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- notes -->\r\n") );
	msNotesBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<div id=\"notesContainer\">\r\n") );
}
	



//------------------------------------------------------------------------------------------------
//write index foot details in the index buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeIndexFoot()
{
	msIndexBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("</div>\r\n") );
	msIndexBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- Index data ends-->\r\n") );
}


//------------------------------------------------------------------------------------------------
//write sound foot details in the sound buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeSoundFoot()
{
	msSoundBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("</div>\r\n") );
	msSoundBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- Sound data ends-->\r\n") );
}


//------------------------------------------------------------------------------------------------
//write text view foot details in the text buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeOutlineFoot()
{
	msTextBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("</div>\r\n") );
	msTextBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- Text Only View data ends-->\r\n") );
}


//------------------------------------------------------------------------------------------------
//write notes view foot details in the notes buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeNotesFoot()
{
	msNotesBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("</div>\r\n") );
	msNotesBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<!-- Notes data ends-->\r\n") );
}


//------------------------------------------------------------------------------------------------
//configuration override and logging
//------------------------------------------------------------------------------------------------
void HTMLExporter::getConfigurations()
{

mLog.log("\r\n|| Export Configurations set\r\n");

// omit this part when dialog is in place :)
	mbEnableNotes = true;
	mbEnableIndex = true;
	mbEnableText = true;
	mbIndexOnStart = true;
	mbLinkToPresentation = true;
	mbExportHiddenSlides = true;
	mbEnableSound = true;
	mbEnableHD = true;
	mbSaveArchive = true;
	mbSaveLog = true;
	msAutoTime = OUString( RTL_CONSTASCII_USTRINGPARAM("5") );
	mnStandardHeight = 600;
	mnStandardWidth = 800;
	mnHDHeight = 800;
	mnHDWidth = 1366;				
	msEmail = OUString( RTL_CONSTASCII_USTRINGPARAM("none") );
	msCopyright = OUString( RTL_CONSTASCII_USTRINGPARAM("(c)Oracle") );
	msArchiveName = OUString( RTL_CONSTASCII_USTRINGPARAM("archive") );
	msArchiveExtension = OUString( RTL_CONSTASCII_USTRINGPARAM(".zip") );
	mLog.log( "Gathering Templates\r\n" );
	maTemplate.getTemplates();
	mnSelectedTemplateSno = 1;
// Omitable part ends

}


//------------------------------------------------------------------------------------------------
//write details of sound in buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeSoundDetail( sal_Int32 nSerialNo, OUString sFileName )
{
	msSoundBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<span id=\"sound") );
	msSoundBuffer += OUString::valueOf( (nSerialNo + 1), 10 );
	msSoundBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("\">") );
	msSoundBuffer += sFileName;
	msSoundBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("</span>\r\n") );
}


//------------------------------------------------------------------------------------------------
//write Index Entry in buffer
//------------------------------------------------------------------------------------------------
void HTMLExporter::writeIndexDetail( sal_Int32 nSerialNo, OUString sSlideTitle )
{
	msIndexBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<span id=\"index") );
	msIndexBuffer += OUString::valueOf( (nSerialNo + 1), 10 );
	msIndexBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("\">") );
	msIndexBuffer += sSlideTitle;
	msIndexBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("</span>\r\n") );
}

void HTMLExporter::writeNotesDetail( sal_Int32 nSerialNo, OUString sNotes )
{
	msNotesBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("<span id=\"notes") );
	msNotesBuffer += OUString::valueOf( (nSerialNo + 1), 10 );
	msNotesBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("\">") );
	msNotesBuffer += sNotes;
	msNotesBuffer += OUString( RTL_CONSTASCII_USTRINGPARAM("</span>\r\n") );
}

//------------------------------------------------------------------------------------------------
//save presentation in ODF format 
//------------------------------------------------------------------------------------------------
void HTMLExporter::savePresentationODF()
{
	if(mxModel.is())
	{
		mLog.log("\r\n|| Saving ODP file, mxModel Found\r\nSave Path: ");
		Reference< XStorable > xStorable( mxModel, UNO_QUERY );
		OUString sSavePath;
		sSavePath = mTask.normalizeFolderPath( maDocumentBaseURL.Path );
		sSavePath += OUString( RTL_CONSTASCII_USTRINGPARAM("presentationDocument.odp") );
		if(xStorable.is()) try
		{
			mLog.log(sSavePath);
			xStorable->storeToURL( sSavePath, Sequence< PropertyValue >() );
		}
		catch( Exception& )
		{
			mLog.log("\r\n ERROR: Unable to save presentation");
		}
	}		
}


//------------------------------------------------------------------------------------------------
//create Archive 
//------------------------------------------------------------------------------------------------
void HTMLExporter::createArchive()
{
//todo
}

makefile.mk

makefile for the HTML Export extension.

#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# 
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org.  If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************

PRJ=..$/..

PRJNAME=sdext
TARGET=htmlex
ENABLE_EXCEPTIONS=TRUE

# --- Settings -----------------------------------------------------

MKDEPENDSOLVER:=
.INCLUDE: settings.mk

.IF "$(L10N_framework)"==""

# --- Files --------------------------------------------------------

EXTENSIONNAME:=HTMLEx
EXTENSION_ZIPNAME:=htmlexv1.6.6
CDEFS += -DHTMLEX_IMPL_IDENTIFIER="com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID)"
CDEFS += -DOFFICE_VERSION="$(WORK_STAMP)$(UPDMINOR)"
SLOFILES=\
    $(SLO)$/htmlex.obj \
    $(SLO)$/Template.obj \
    $(SLO)$/htmlexServices.obj \
    $(SLO)$/logWriter.obj \
    $(SLO)$/commonTasks.obj \
    $(SLO)$/nonJavaScriptExport.obj

SHL1DLLPRE=
SHL1TARGET=$(TARGET).uno

SHL1LIBS=\
	$(SLB)$/$(TARGET).lib

SHL1STDLIBS=\
    $(CPPUHELPERLIB)	\
	$(ZLIB3RDLIB)	    \
	$(CPPULIB)			\
	$(SALLIB)

SHL1DEPN=
SHL1IMPLIB=	i$(SHL1TARGET)
SHL1DEF=	$(MISC)$/$(SHL1TARGET).def
SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1RPATH=OXT

DEF1NAME=$(SHL1TARGET)

# --- Extension packaging ------------------------------------------

DESCRIPTION_SRC:=config$/description.xml
MANIFEST_SRC:=config$/manifest.xml
COMPONENT_CONFIGDIR:=config
COMPONENT_CONFIGDEST:=.
COMPONENT_XCU= \
    $(EXTENSIONDIR)$/htmlex_export_filter.xcu \
    $(EXTENSIONDIR)$/templates.xcu

COMPONENT_FILES= \
    $(EXTENSIONDIR)$/templates.xcs
    
COMPONENT_TEMPLATE1_FILES = \
	$(EXTENSIONDIR)$/template1$/res$/preview.png \
	$(EXTENSIONDIR)$/template1$/res$/default.css \
	$(EXTENSIONDIR)$/template1$/res$/default.js \
	$(EXTENSIONDIR)$/template1$/images$/end.png \
	$(EXTENSIONDIR)$/template1$/images$/next.png \
	$(EXTENSIONDIR)$/template1$/images$/ns.png \
	$(EXTENSIONDIR)$/template1$/images$/previous.png \
	$(EXTENSIONDIR)$/template1$/images$/ps.png \
	$(EXTENSIONDIR)$/template1$/images$/start.png \
	$(EXTENSIONDIR)$/template1$/images$/stop.png \
	$(EXTENSIONDIR)$/template1$/images$/bgty.png \
	$(EXTENSIONDIR)$/template1$/images$/text.png \
	$(EXTENSIONDIR)$/template1$/extras$/info.txt

COMPONENT_TEMPLATE2_FILES = \
	$(EXTENSIONDIR)$/template2$/res$/preview.png \
	$(EXTENSIONDIR)$/template2$/res$/default.css \
	$(EXTENSIONDIR)$/template2$/res$/default.js \
	$(EXTENSIONDIR)$/template2$/images$/end.png \
	$(EXTENSIONDIR)$/template2$/images$/next.png \
	$(EXTENSIONDIR)$/template2$/images$/ns.png \
	$(EXTENSIONDIR)$/template2$/images$/previous.png \
	$(EXTENSIONDIR)$/template2$/images$/ps.png \
	$(EXTENSIONDIR)$/template2$/images$/start.png \
	$(EXTENSIONDIR)$/template2$/images$/stop.png \
	$(EXTENSIONDIR)$/template2$/images$/bgty.png \
	$(EXTENSIONDIR)$/template2$/images$/text.png \
	$(EXTENSIONDIR)$/template2$/extras$/info.txt

COMPONENT_TEMPLATE3_FILES = \
	$(EXTENSIONDIR)$/template3$/res$/preview.png \
	$(EXTENSIONDIR)$/template3$/res$/default.css \
	$(EXTENSIONDIR)$/template3$/res$/default.js \
	$(EXTENSIONDIR)$/template3$/images$/end.png \
	$(EXTENSIONDIR)$/template3$/images$/next.png \
	$(EXTENSIONDIR)$/template3$/images$/ns.png \
	$(EXTENSIONDIR)$/template3$/images$/previous.png \
	$(EXTENSIONDIR)$/template3$/images$/ps.png \
	$(EXTENSIONDIR)$/template3$/images$/start.png \
	$(EXTENSIONDIR)$/template3$/images$/stop.png \
	$(EXTENSIONDIR)$/template3$/images$/bgty.png \
	$(EXTENSIONDIR)$/template3$/images$/text.png \
	$(EXTENSIONDIR)$/template3$/extras$/info.txt


COMPONENT_EXTRAS= \
	$(EXTENSIONDIR)$/files$/manual.txt \
	$(EXTENSIONDIR)$/files$/oooadd.js \
	$(EXTENSIONDIR)$/files$/presentation.css \
	$(EXTENSIONDIR)$/files$/presentation.js \
	$(EXTENSIONDIR)$/files$/favicon.ico \
	$(EXTENSIONDIR)$/files$/nojs.css
	

# native libraries
COMPONENT_LIBRARIES= \
    $(EXTENSIONDIR)$/$(SHL1TARGET)$(DLLPOST)

EXTENSION_PACKDEPS=$(COMPONENT_EXTRAS) $(COMPONENT_TEMPLATE1_FILES) $(COMPONENT_TEMPLATE2_FILES) $(COMPONENT_TEMPLATE3_FILES) makefile.mk

.INCLUDE : extension_pre.mk
.ENDIF # L10N_framework
.INCLUDE : target.mk

.IF "$(L10N_framework)"==""
.INCLUDE : extension_post.mk

$(COMPONENT_EXTRAS) : files$/$$(@:f)
	@@-$(MKDIRHIER) $(@:d)
    $(COPY) $< $@

$(COMPONENT_TEMPLATE1_FILES) : template1$/$$(@:f)
	@@-$(MKDIRHIER) $(@:d)
    $(COPY) $< $@

$(COMPONENT_TEMPLATE2_FILES) : template2$/$$(@:f)
	@@-$(MKDIRHIER) $(@:d)
    $(COPY) $< $@

$(COMPONENT_TEMPLATE3_FILES) : template3$/$$(@:f)
	@@-$(MKDIRHIER) $(@:d)
    $(COPY) $< $@

.ENDIF # L10N_framework

manifest.xml

manifest file for the export filter

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
  <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=native"
                       manifest:full-path="htmlex.unoSHARED_EXTENSION"/>
  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
					   manifest:full-path="htmlex_export_filter.xcu"/>
  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
					             manifest:full-path="templates.xcu"/>
  <manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description"
                       manifest:full-path="help/component.txt"/>
  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-schema"
                       manifest:full-path="templates.xcs"/>
</manifest:manifest>

htmlex_export_filter.xcu

Configuration file for the export filter

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Filter" oor:package="org.openoffice.TypeDetection">
  <node oor:name="Filters">
    <node oor:name="impress_htmlex_export" oor:type="xs:string" oor:op="replace">
      <prop oor:name="DocumentService">
        <value>com.sun.star.presentation.PresentationDocument</value>
      </prop>
      <prop oor:name="FileFormatVersion" oor:type="xs:int">
        <value>0</value>
      </prop>
      <prop oor:name="FilterService" oor:type="xs:string">
        <value>com.sun.star.comp.documents.HTMLExExporter</value>
      </prop>
      <prop oor:name="Flags" oor:type="oor:string-list">
        <value>3RDPARTYFILTER ALIEN EXPORT</value>
      </prop>
      <prop oor:name="Type" oor:type="xs:string">
        <value>XHTML_File</value>
      </prop>
      <prop oor:name="UIName">
        <value xml:lang="x-default">HTML New Export v1.3.x.a Kushal</value>
      </prop>
      <prop oor:name="TemplateName"/>
      <prop oor:name="UIComponent"/>
    </node>
  </node>
</oor:component-data>


description.xml

Description of the export filter

<?xml version="1.0" encoding="UTF-8"?>
<description

    xmlns="http://openoffice.org/extensions/description/2006"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:dep="http://openoffice.org/extensions/description/2006">
    <identifier value="UPDATED_IDENTIFIER" />

    <dependencies>
        <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/>
    </dependencies>

    <registration>
        <simple-license accept-by="admin" default-license-id="lic-en-US" suppress-if-required="true" >
        <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/>
        </simple-license>
    </registration>

    <version value="1.3.7" />

    <platform value="UPDATED_SUPPORTED_PLATFORM" />

    <publisher>
        <name xlink:href="http://www.oracle.com/us/products/applications/open-office" lang="en">Oracle</name>
    </publisher>

    <display-name>
        <name lang="en-US">HTML New Export v1.3.x.a Kushal</name>
    </display-name>
    
    <icon>
      <default xlink:href="images/extension_32.png" />
      <high-contrast xlink:href="images/extension_32_h.png" />
    </icon>

</description>

templates.xcs

This file defines the configuration schema for the templates

<?xml version='1.0' encoding='UTF-8'?>
<!--***********************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************ -->
<oor:component-schema oor:name="SdHtmlExport" oor:package="org.openoffice.Office.extension" xml:lang="en-US" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <info>
    <author>Christan Lippka and Kushal Likhi</author>
    <desc >Contains information about installed html export templates for impress and draw.</desc>
  </info>
  <templates>
    <group oor:name="Template">
      <info>
        <desc>Lists the information about a html export template.</desc>
      </info>
      <prop oor:name="UIName" oor:type="xs:string">
        <info>
          <desc>Localized name of this template for showing it at the UI.</desc>
        </info>
	<value/>
      </prop>
      <prop oor:name="Author" oor:type="xs:string">
        <info>
          <desc>Name of this template creator.</desc>
        </info>
	<value/>
      </prop>
      <prop oor:name="Description" oor:type="xs:string">
        <info>
          <desc>Short Localized description of this template.</desc>
        </info>
	<value/>
      </prop>           
      <prop oor:name="PreviewImageURL" oor:type="xs:string">
        <info>
          <desc>URL to the templates preview image.</desc>
        </info>
	<value/>
      </prop>
      <prop oor:name="TemplateURL" oor:type="xs:string">
        <info>
          <desc>URL to the template files.</desc>
        </info>
	<value/>
      </prop>
      <prop oor:name="ImagesDir" oor:type="xs:string">
        <info>
          <desc>URL to the file which contains the list of images packed in the template.</desc>
        </info>
        <value/>
      </prop>
      <prop oor:name="ExtrasDir" oor:type="xs:string">
        <info>
          <desc>URL to the file which contains the list of extra files if in case are there in the template.</desc>
        </info>
        <value/>
      </prop>
      <prop oor:name="HTMLInjectURL" oor:type="xs:string">
        <info>
          <desc>URL to the file which contain the template specific HTML code to be added to the exported HTML file.</desc>
        </info>
        <value/>
      </prop>
      <prop oor:name="SupportAuto" oor:type="xs:string">
        <info>
          <desc>Boolean value to denote the template support to auto slide show.</desc>
        </info>
        <value/>
      </prop>
      <prop oor:name="SupportNotes" oor:type="xs:string">
        <info>
          <desc>Boolean value to denote the template support to notes.</desc>
        </info>
        <value/>
      </prop>
      <prop oor:name="SupportTextView" oor:type="xs:string">
        <info>
          <desc>Boolean value to denote the template support to text view.</desc>
        </info>
        <value/>
      </prop>
      <prop oor:name="SupportIndex" oor:type="xs:string">
        <info>
          <desc>Boolean value to denote the template support to display index.</desc>
        </info>
        <value/>
      </prop>
      <prop oor:name="SupportedBrowsers" oor:type="xs:string">
        <info>
          <desc>list of browsers tested and supported by this template.</desc>
        </info>
        <value/>
      </prop>
    </group>
  </templates>
  <component>
    <set oor:name="Templates" oor:node-type="Template">
      <info>
        <desc>Lists the registered Templates.</desc>
      </info>
    </set>
  </component>
</oor:component-schema>

templates.xcu

This file defines the packed templates. there are 3 packed templates by default.

<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************ -->
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="SdHtmlExport" oor:package="org.openoffice.Office.extension">
  <node oor:name="Templates">
    <node oor:name="Default_template_1" oor:op="replace">
      <prop oor:name="UIName">
        <value>Default Template 1</value>
      </prop>
      <prop oor:name="Author">
        <value>Kushal Likhi</value>
      </prop>
      <prop oor:name="Description">
        <value>The first default template included with the HTML Export.</value>
      </prop>
      <prop oor:name="PreviewImageURL">
        <value>%origin%/template1/res/preview.png</value>
      </prop>
      <prop oor:name="TemplateURL">
        <value>%origin%/template1/res</value>
      </prop>
      <prop oor:name="ImagesDir" oor:type="xs:string">
        <value>%origin%/template1/images</value>
      </prop>
      <prop oor:name="ExtrasDir" oor:type="xs:string">
        <value>%origin%/template1/extras</value>
      </prop>
      <prop oor:name="HTMLInjectURL" oor:type="xs:string">
        <value>%origin%/template1/res/inject.html</value>
      </prop>
      <prop oor:name="SupportAuto" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportNotes" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportTextView" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportIndex" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportedBrowsers" oor:type="xs:string">
        <value>Opera,IE,Firefox,Safari,Chrome - All latest versions tested.</value>
      </prop>
    </node>
    <node oor:name="Default_template_2" oor:op="replace">
      <prop oor:name="UIName">
        <value>Default Template 2</value>
      </prop>
      <prop oor:name="Author">
        <value>Kushal Likhi</value>
      </prop>
      <prop oor:name="Description">
        <value>The Second default template included with the HTML Export</value>
      </prop>
      <prop oor:name="PreviewImageURL">
        <value>%origin%/template2/res/preview.png</value>
      </prop>
      <prop oor:name="TemplateURL">
        <value>%origin%/template2/res</value>
      </prop>
      <prop oor:name="ImagesDir" oor:type="xs:string">
        <value>%origin%/template2/images</value>
      </prop>
      <prop oor:name="ExtrasDir" oor:type="xs:string">
        <value>%origin%/template2/extras</value>
      </prop>
      <prop oor:name="HTMLInjectURL" oor:type="xs:string">
        <value>%origin%/template2/res/inject.html</value>
      </prop>
      <prop oor:name="SupportAuto" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportNotes" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportTextView" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportIndex" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportedBrowsers" oor:type="xs:string">
        <value>Opera,IE,Firefox,Safari,Chrome - All latest versions tested.</value>
      </prop>
    </node>
    <node oor:name="Default_template_3" oor:op="replace">
      <prop oor:name="UIName">
        <value>Default Template 3</value>
      </prop>
      <prop oor:name="Author">
        <value>Kushal Likhi</value>
      </prop>
      <prop oor:name="Description">
        <value>The third default template included with the HTML Export.</value>
      </prop>
      <prop oor:name="PreviewImageURL">
        <value>%origin%/template3/res/preview.png</value>
      </prop>
      <prop oor:name="TemplateURL">
        <value>%origin%/template3/res</value>
      </prop>
      <prop oor:name="ImagesDir" oor:type="xs:string">
        <value>%origin%/template3/images</value>
      </prop>
      <prop oor:name="ExtrasDir" oor:type="xs:string">
        <value>%origin%/template3/extras</value>
      </prop>
      <prop oor:name="HTMLInjectURL" oor:type="xs:string">
        <value>%origin%/template3/res/inject.html</value>
      </prop>
      <prop oor:name="SupportAuto" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportNotes" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportTextView" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportIndex" oor:type="xs:string">
        <value>true</value>
      </prop>
      <prop oor:name="SupportedBrowsers" oor:type="xs:string">
        <value>Opera,IE,Firefox,Safari,Chrome - All latest versions tested.</value>
      </prop>
    </node>
</node>
</oor:component-data>

Template.hxx

Header file to declare Template class

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef INCLUDED_TEMPLATE_HXX
#define INCLUDED_TEMPLATE_HXX


#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>

#include "commonTasks.hxx"
#include "logWriter.hxx"

class Template
{

	private:
		// various keys for configuration data.
		rtl::OUString maUINameKey;
		rtl::OUString maAuthorKey;
		rtl::OUString maDescriptionKey;
		rtl::OUString maPreviewImageURLKey;
		rtl::OUString maTemplateURLKey;
		rtl::OUString maImagesDirURLKey;
		rtl::OUString maExtrasDirURLKey;
		rtl::OUString maHTMLInjectURLKey;
		rtl::OUString maSupportAutoKey;
		rtl::OUString maSupportNotesKey;
		rtl::OUString maSupportTextViewKey;
		rtl::OUString maSupportIndexKey;
		rtl::OUString maSupportedBrowsersKey;

		rtl::OUString maRootPath;
		rtl::OUString maSeperator;

		com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
		com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > mxServiceFactory;		
		com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xConfigProvider;
		com::sun::star::uno::Sequence< rtl::OUString >	mFoundTemplates;

		com::sun::star::uno::Sequence< com::sun::star::uno::Any > lParams;
    		com::sun::star::beans::PropertyValue aParam ;

		com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > mxURLTransformer;
		com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > mxFileAccess;

		commonTasks mTask;

		

	public:

		// constructor for the class
		Template( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
		//configuration data of the selected template. for public access 
		rtl::OUString UIName;
		rtl::OUString Author;
		rtl::OUString Description;
		rtl::OUString PreviewImageURL;
		rtl::OUString TemplateURL;
		rtl::OUString ImagesDirURL;
		rtl::OUString ExtrasDirURL;
		rtl::OUString HTMLInjectURL;
		bool SupportAuto;
		bool SupportNotes;
		bool SupportTextView;
		bool SupportIndex;
		rtl::OUString SupportedBrowsers;
		// variable that will store the number of templates found in the system.
		sal_Int32 TemplateCount;
		

		//function to get the installed templates
		bool getTemplates();
		bool copyImages(com::sun::star::util::URL baseURL);
		bool copyJsCssFiles(com::sun::star::util::URL baseURL);
		bool copyMiscFiles(com::sun::star::util::URL baseURL);
		bool selectTemplate(sal_Int32 Sno);
		bool addHTMLData( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );		
		
		logWriter mLog;

};
#endif

Template.cxx

This file defines Template class

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"
#include "Template.hxx"
#include <boost/shared_ptr.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/io/XTextInputStream.hpp>


using rtl::OUString;
using namespace rtl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::ucb;
using namespace com::sun::star::util;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
using namespace com::sun::star::io;


Template::Template( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext )
: maUINameKey( RTL_CONSTASCII_USTRINGPARAM( "UIName" ) )
, maAuthorKey( RTL_CONSTASCII_USTRINGPARAM( "Author" ) )
, maDescriptionKey( RTL_CONSTASCII_USTRINGPARAM( "Description" ) )
, maPreviewImageURLKey( RTL_CONSTASCII_USTRINGPARAM( "PreviewImageURL" ) )
, maTemplateURLKey( RTL_CONSTASCII_USTRINGPARAM( "TemplateURL" ) )
, maImagesDirURLKey( RTL_CONSTASCII_USTRINGPARAM( "ImagesDir" ) )
, maExtrasDirURLKey( RTL_CONSTASCII_USTRINGPARAM( "ExtrasDir" ) )
, maHTMLInjectURLKey( RTL_CONSTASCII_USTRINGPARAM( "HTMLInjectURL" ) )
, maSupportAutoKey( RTL_CONSTASCII_USTRINGPARAM( "SupportAuto" ) )
, maSupportNotesKey( RTL_CONSTASCII_USTRINGPARAM( "SupportNotes" ) )
, maSupportTextViewKey( RTL_CONSTASCII_USTRINGPARAM( "SupportTextView" ) )
, maSupportIndexKey( RTL_CONSTASCII_USTRINGPARAM( "SupportIndex" ) )
, maSupportedBrowsersKey( RTL_CONSTASCII_USTRINGPARAM( "SupportedBrowsers" ) )
, maRootPath( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.extension.SdHtmlExport/Templates"))
, maSeperator( RTL_CONSTASCII_USTRINGPARAM("/"))
, mxContext( xContext, UNO_QUERY_THROW )
, mxServiceFactory( xContext->getServiceManager(), UNO_QUERY_THROW )
, xConfigProvider( mxServiceFactory->createInstanceWithContext(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")), xContext), UNO_QUERY_THROW )
, lParams(2)
, mxURLTransformer( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer" )), xContext ), UNO_QUERY_THROW )
, mxFileAccess( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), xContext ), UNO_QUERY_THROW )
, mTask(xContext)
, mLog(xContext)
{
	mLog.disableHeaderFooter();
}

bool Template::getTemplates()
{

	// enable "all locales mode"
	aParam.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("locale"));
	aParam.Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
	lParams[0] <<= aParam;

	// set root path
	aParam.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
	aParam.Value <<= maRootPath;
	lParams[1] <<= aParam;

	Reference< XNameAccess > xTemplates( xConfigProvider->createInstanceWithArguments( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")), lParams), UNO_QUERY_THROW );
	
	Sequence< OUString > aList( xTemplates->getElementNames() );
	mFoundTemplates = aList;
	TemplateCount = mFoundTemplates.getLength();
	return true;

}

bool Template::addHTMLData( const Reference< XOutputStream >& xOutputStream )
{
	if( mxFileAccess->exists( HTMLInjectURL ) )
	{
		mLog.log("\r\n Found HTML Inject");
		Reference< XInputStream > aInjectSource;
		aInjectSource = mxFileAccess->openFileRead( HTMLInjectURL );
		OUString aData;
		
		Reference< XTextInputStream > xTextInput( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.XTextInputStream")), mxContext  ), UNO_QUERY_THROW );
		xTextInput->setEncoding(OUString( RTL_CONSTASCII_USTRINGPARAM("ASCII")));
		
		Reference< XActiveDataSink > aDataSink( xTextInput, UNO_QUERY_THROW );
		aDataSink->setInputStream( aInjectSource );

		while( !xTextInput->isEOF() )
		{
			aData = xTextInput->readLine();
			mTask.writeUTF8String(xOutputStream, aData);
		}

		return true;
	}
	else return false;
}




bool Template::copyImages(URL baseURL)
{

	URL aSourceURL;
	URL aDestURL;

	mLog.log("\r\n|| IMAGES\r\nFound files: ");

	Sequence< OUString > aImageList( mxFileAccess->getFolderContents( mTask.normalizeFolderPath(ImagesDirURL),false ) );
	mLog.log(OUString::valueOf(aImageList.getLength(),10),"\r\n");
	for( sal_Int32 aIndex = 0; aIndex < aImageList.getLength(); aIndex++ )
	{
	
		aSourceURL.Complete = aImageList[aIndex];
		mxURLTransformer->parseStrict( aSourceURL );		

		aDestURL.Path = mTask.normalizeFolderPath(baseURL.Path);
		aDestURL.Path += OUString( RTL_CONSTASCII_USTRINGPARAM("template/images/") );
		aDestURL.Name = aSourceURL.Name;
		aDestURL.Complete = aDestURL.Path;
		aDestURL.Complete += aDestURL.Name;
		mLog.log("\r\nImages copy process\r\nSource URL: ");
		mLog.log(aSourceURL.Complete,"\r\nDest URL: ");
		mLog.log(aDestURL.Complete,"\r\n");
		mTask.copyFile(aSourceURL.Complete, aDestURL.Complete, true);
	}
return true;
}


bool Template::copyJsCssFiles(URL baseURL)
{
	URL aSourceURL;
	URL aDestURL;

	mLog.log("\r\n|| RESOURCE\r\nFound files: ");
	

	Sequence< OUString > aResList( mxFileAccess->getFolderContents( mTask.normalizeFolderPath(TemplateURL),false ) );
	mLog.log(OUString::valueOf(aResList.getLength(),10),"\r\n");
	for( sal_Int32 aIndex = 0; aIndex < aResList.getLength(); aIndex++ )
	{
		aSourceURL.Complete = aResList[aIndex];
		mxURLTransformer->parseStrict( aSourceURL );		

		aDestURL.Path = mTask.normalizeFolderPath(baseURL.Path);
		aDestURL.Path += OUString( RTL_CONSTASCII_USTRINGPARAM("template/") );
		aDestURL.Name = aSourceURL.Name;
		aDestURL.Complete = aDestURL.Path;
		aDestURL.Complete += aDestURL.Name;
		mLog.log("\r\nResource copy process\r\nSource URL: ");
		mLog.log(aSourceURL.Complete,"\r\nDest URL: ");
		mLog.log(aDestURL.Complete,"\r\n");
		mTask.copyFile(aSourceURL.Complete, aDestURL.Complete, true);
	}
return true;
}


bool Template::copyMiscFiles(URL baseURL)
{
	URL aSourceURL;
	URL aDestURL;

	mLog.log("\r\n|| EXTRAS\r\nFound files: ");
	

	Sequence< OUString > aExtrasList( mxFileAccess->getFolderContents( mTask.normalizeFolderPath(ExtrasDirURL),false ) );
	mLog.log(OUString::valueOf(aExtrasList.getLength(),10),"\r\n");
	for( sal_Int32 aIndex = 0; aIndex < aExtrasList.getLength(); aIndex++ )
	{
		aSourceURL.Complete = aExtrasList[aIndex];
		mxURLTransformer->parseStrict( aSourceURL );		

		aDestURL.Path = mTask.normalizeFolderPath(baseURL.Path);
		aDestURL.Path += OUString( RTL_CONSTASCII_USTRINGPARAM("template/") );
		aDestURL.Name = aSourceURL.Name;
		aDestURL.Complete = aDestURL.Path;
		aDestURL.Complete += aDestURL.Name;
		mLog.log("\r\nExtras copy process\r\nSource URL: ");
		mLog.log(aSourceURL.Complete,"\r\nDest URL: ");
		mLog.log(aDestURL.Complete,"\r\n");
		mTask.copyFile(aSourceURL.Complete, aDestURL.Complete, true);
	}
return true;
}


bool Template::selectTemplate(sal_Int32 Sno)
{
	OUString sTemplatePath( maRootPath );
	sTemplatePath += maSeperator;
	sTemplatePath += mFoundTemplates[Sno];
	aParam.Value <<= sTemplatePath;
	lParams[1] <<= aParam;

	Reference< XNameAccess > xTemplate( xConfigProvider->createInstanceWithArguments(
	OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")), lParams), UNO_QUERY_THROW );

	OUString aTempString;

	if( xTemplate->hasByName( maUINameKey ) )
				xTemplate->getByName( maUINameKey ) >>= UIName;
	else return false;

	if( xTemplate->hasByName( maAuthorKey ) )
				xTemplate->getByName( maAuthorKey ) >>= Author;

	if( xTemplate->hasByName( maDescriptionKey ) )
				xTemplate->getByName( maDescriptionKey ) >>= Description;

	if( xTemplate->hasByName( maPreviewImageURLKey ) )
				xTemplate->getByName( maPreviewImageURLKey ) >>= PreviewImageURL;

	if( xTemplate->hasByName( maTemplateURLKey ) )
				xTemplate->getByName( maTemplateURLKey ) >>= TemplateURL;
	else return false;

	if( xTemplate->hasByName( maImagesDirURLKey ) )
				xTemplate->getByName( maImagesDirURLKey ) >>= ImagesDirURL;
	else return false;

	if( xTemplate->hasByName( maExtrasDirURLKey ) )
				xTemplate->getByName( maExtrasDirURLKey ) >>= ExtrasDirURL;
	else return false;

	if( xTemplate->hasByName( maHTMLInjectURLKey ) )
				xTemplate->getByName( maHTMLInjectURLKey ) >>= HTMLInjectURL;
	else return false;

	if( xTemplate->hasByName( maSupportAutoKey ) )
	{
		xTemplate->getByName( maSupportAutoKey ) >>= aTempString;
		if(aTempString.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("true"))))
		{
			SupportAuto = true;
		}
		else
		{
			SupportAuto = false;
		}
	}

	if( xTemplate->hasByName( maSupportTextViewKey ) )
	{
		xTemplate->getByName( maSupportTextViewKey ) >>= aTempString;
		if(aTempString.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("true"))))
		{
			SupportTextView = true;
		}
		else
		{
			SupportTextView = false;
		}
	}


	if( xTemplate->hasByName( maSupportIndexKey ) )
	{
		xTemplate->getByName( maSupportIndexKey ) >>= aTempString;
		if(aTempString.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("true"))))
		{
			SupportIndex = true;
		}
		else
		{
			SupportIndex = false;
		}
	}

	if( xTemplate->hasByName( maSupportNotesKey ) )
	{
		xTemplate->getByName( maSupportNotesKey ) >>= aTempString;
		if(aTempString.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("true"))))
		{
			SupportNotes = true;
		}
		else
		{
			SupportNotes = false;
		}
	}


	if( xTemplate->hasByName( maSupportedBrowsersKey ) )
				xTemplate->getByName( maSupportedBrowsersKey ) >>= SupportedBrowsers;
		
		

	return true;
}

nonJavascriptExport.hxx

handles non javascript static version of the export.

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef INCLUDED_NONJAVASCRIPTEXPORT_HXX
#define INCLUDED_NONJAVASCRIPTEXPORT_HXX

#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/URL.hpp>

#include "commonTasks.hxx"
#include "logWriter.hxx"

class nonJavaScriptExport
{
private:


// write index head information
void writeIndexHead(rtl::OUString sDocumentTitle, rtl::OUString sAuthor, const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xIndexFile );
// write index entry
void writeIndexEntry(rtl::OUString sPageNo, rtl::OUString sPageTitle, const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xIndexFile );
// write index foot information
void writeIndexFoot( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xIndexFile );

// write start page
void writeStartPage( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xIndexFile, rtl::OUString sDocumentTitle );

// write slide head information
void writeSlideHead(rtl::OUString sDocumentTitle, const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xSlideFile );
// write Slide entry
void writeSlideEntry(sal_Int32 nPageNo, bool bIsHD, const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xSlideFile );
// write Slide foot information
void writeSlideFoot( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xSlideFile );



//function to save sound file in the export
rtl::OUString copySoundFile( const rtl::OUString& rSourceURL );


//member variables
com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDrawPages;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > mxServiceFactory;
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > mxFileAccess;
com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > mxURLTransformer;
rtl::OUString maDocumentBaseURL;
sal_Int32 mnPageCount;
bool mbEnableSound;
bool mbExportHiddenSlides;
bool mbEnableHD;
bool mbEnableIndex;

//common tasks shared within classes
commonTasks mTask;

public:
//constructor
nonJavaScriptExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, const ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& xDrawPages, bool bEnableNotes, bool bEnableIndex, bool bEnableText, bool bExportHiddenSlides, bool bEnableSound, bool bEnableHD );

logWriter mLog;

// the main function to create files in desired directory
bool createFiles( rtl::OUString sBaseDir, rtl::OUString sDocumentTitle, rtl::OUString sAuthor);


};

#endif

nonJavascriptExport.cxx

handles non javascript static version of the export.

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"
#include "nonJavaScriptExport.hxx"


using namespace rtl;
using rtl::OUString;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::io;
using namespace com::sun::star::util;
using namespace com::sun::star::drawing;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::ucb;
using namespace com::sun::star::lang;

nonJavaScriptExport::nonJavaScriptExport( const Reference< XComponentContext >& xContext, const Reference< XIndexAccess >& xDrawPages, bool bEnableNotes, bool bEnableIndex, bool bEnableText, bool bExportHiddenSlides, bool bEnableSound, bool bEnableHD )
: mxDrawPages( xDrawPages, UNO_QUERY_THROW )
, mxServiceFactory( xContext->getServiceManager(), UNO_QUERY_THROW )
, mxFileAccess( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), xContext), UNO_QUERY_THROW )
, mxURLTransformer( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer" )), xContext), UNO_QUERY_THROW )
, mTask(xContext)
, mLog(xContext)
{
mbEnableSound = bEnableSound;
mbExportHiddenSlides = bExportHiddenSlides;
mbEnableHD = bEnableHD;
mbEnableIndex = bEnableIndex;
mLog.disableHeaderFooter();
}


OUString nonJavaScriptExport::copySoundFile( const OUString& rSourceURL )
{
	URL aSoundSourceURL;
	aSoundSourceURL.Complete = rSourceURL;
	mxURLTransformer->parseStrict( aSoundSourceURL );

	URL aTargetSoundFileURL;
	aTargetSoundFileURL.Path = maDocumentBaseURL;
	aTargetSoundFileURL.Path += OUString( RTL_CONSTASCII_USTRINGPARAM( "../sounds/" ) );
	aTargetSoundFileURL.Name = aSoundSourceURL.Name;
	aTargetSoundFileURL.Complete = aTargetSoundFileURL.Path;
	aTargetSoundFileURL.Complete += aTargetSoundFileURL.Name;	
	//mxURLTransformer->assemble( aTargetSoundFileURL );
	
	mLog.log("\r\nSound target: ");
	mLog.log(aTargetSoundFileURL.Complete,"\r\nSource Sound: ");
	mLog.log(aSoundSourceURL.Complete);
	// copy if it does not yet exists
	if( !mxFileAccess->exists( aTargetSoundFileURL.Complete ) )
		mxFileAccess->copy( aSoundSourceURL.Complete, aTargetSoundFileURL.Complete );

	mLog.log(" --- copied\r\n");

	// return relative path (which in this case is only the name)
	
	OUString sRet;
	sRet = OUString(RTL_CONSTASCII_USTRINGPARAM( "../sounds/" ));
	sRet += aTargetSoundFileURL.Name;
	
	return sRet;
}

bool nonJavaScriptExport::createFiles(OUString sBaseDir, OUString sDocumentTitle, OUString sAuthor)
{
	mLog.log("\r\nCreating Index File: \r\nSave Url: ");
	
	/*OUString sLogPath(mTask.normalizeFolderPath(sBaseDir));
	sLogPath += OUString(RTL_CONSTASCII_USTRINGPARAM("log.txt"));	
	mLog.setLogFilePath(sLogPath);*/

	

	maDocumentBaseURL = mTask.normalizeFolderPath(sBaseDir);

	OUString sIndexPath;
	sIndexPath = mTask.normalizeFolderPath(sBaseDir);
	sIndexPath += OUString(RTL_CONSTASCII_USTRINGPARAM("index.html"));

	mLog.log(sIndexPath,"\r\n");	
	
	Reference< XOutputStream > xIndexFile;
	xIndexFile = mxFileAccess->openFileWrite( sIndexPath );

	if(mbEnableIndex)
	{
		writeIndexHead(sDocumentTitle,sAuthor,xIndexFile);
	}
	else
	{
		writeStartPage(xIndexFile, sDocumentTitle);
	}

	OUString sPath;
	sal_Int32 nMarker = 0;


	if( mxDrawPages.is() )
	{
		const sal_Int32 nSlideCount = mxDrawPages->getCount();
		mnPageCount = nSlideCount;
		Reference< XOutputStream > xSlideFile;
		for( sal_Int32 nPageIndex = 0; nPageIndex < nSlideCount; nPageIndex++ ) try
		{
			Reference< XDrawPage > xPage( mxDrawPages->getByIndex( nPageIndex ), UNO_QUERY_THROW );
			Reference< XPropertySet > xPageProps( xPage, UNO_QUERY );

			// user interface name of the current slide
			OUString sPageName;
			xPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LinkDisplayName" ) ) ) >>= sPageName;

			

			// url to slide sound file
			OUString sSoundURL;
			xPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ) ) >>= sSoundURL;

			// check if hidden
			bool bVisible=true;
			xPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ) ) >>= bVisible;
			mLog.log("\r\n\r\nSlide is ");
			mLog.log( ((bVisible)?"visible":"hidden") );

			if( ((!mbExportHiddenSlides) && bVisible) || mbExportHiddenSlides )
			{
				nMarker ++;
				//write index entry
				if(mbEnableIndex)
					writeIndexEntry(OUString::valueOf(nMarker,10),sPageName,xIndexFile);	

				//creating the normal slide file
				sPath = OUString();
				sPath = mTask.normalizeFolderPath(sBaseDir);
				sPath += OUString(RTL_CONSTASCII_USTRINGPARAM("s"));
				sPath += OUString::valueOf(nMarker);
				sPath += OUString(RTL_CONSTASCII_USTRINGPARAM(".html")); 
				xSlideFile = mxFileAccess->openFileWrite( sPath );
				mLog.log("\r\nWriting File: ");
				mLog.log(sPath);
				// write slide head information
				writeSlideHead(sDocumentTitle, xSlideFile );
				// write Slide entry
				writeSlideEntry(nMarker, false, xSlideFile );
				
				
				if( sSoundURL.getLength() != 0 && mbEnableSound )
				{
					mTask.writeUTF8String( xSlideFile, "<div style=\"position:absolute\"><bgsound src=\"" );
					mTask.writeUTF8String( xSlideFile, copySoundFile( sSoundURL ) );
					mTask.writeUTF8String( xSlideFile, "\" loop=\"1\"></bgsound>\r\n</div>" );
				}
	
				// write Slide foot information
				writeSlideFoot( xSlideFile );
	
				xSlideFile->closeOutput();
				xSlideFile->flush();
	
				if(mbEnableHD)
				{
					//creating the HD slide file
					sPath = OUString();
					sPath = mTask.normalizeFolderPath(sBaseDir);
					sPath += OUString(RTL_CONSTASCII_USTRINGPARAM("s"));
					sPath += OUString::valueOf(nMarker);
					sPath += OUString(RTL_CONSTASCII_USTRINGPARAM("HD.html")); 
					xSlideFile = mxFileAccess->openFileWrite( sPath );
					mLog.log("\r\nWriting File: ");
					mLog.log(sPath);
					// write slide head information
					writeSlideHead(sDocumentTitle, xSlideFile );
					// write Slide entry
					writeSlideEntry(nMarker, true, xSlideFile );
					
					
					if( sSoundURL.getLength() != 0 && mbEnableSound )
					{
						mTask.writeUTF8String( xSlideFile, "<div style=\"position:absolute\"><bgsound src=\"" );
						mTask.writeUTF8String( xSlideFile, copySoundFile( sSoundURL ) );
						mTask.writeUTF8String( xSlideFile, "\" loop=\"1\"></bgsound>\r\n</div>" );
					}
	
					// write Slide foot information
					writeSlideFoot( xSlideFile );
	
					xSlideFile->closeOutput();
					xSlideFile->flush();
				}
			}			
		}
		catch( Exception& )
		{
			mLog.log("HTMLExporter::createHTMLFile, exception caught!");
		}
	}
	if(mbEnableIndex)
		writeIndexFoot(xIndexFile);
	
	xIndexFile->flush();
	
	return true;
}


void nonJavaScriptExport::writeIndexHead(OUString sDocumentTitle, OUString sAuthor, const Reference< XOutputStream >& xIndexFile )
{
	mLog.log("\r\nAdding Index Head, Author: ");
	mLog.log(sAuthor," Document Title: ");
	mLog.log(sDocumentTitle,"\r\n");


	mTask.writeUTF8String( xIndexFile, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" );
	mTask.writeUTF8String( xIndexFile, "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>Index-");
	mTask.writeUTF8String( xIndexFile, sDocumentTitle );
	mTask.writeUTF8String( xIndexFile, "</title>" );
	mTask.writeUTF8String( xIndexFile,"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
	mTask.writeUTF8String( xIndexFile,"<link type=\"text/css\" rel=\"stylesheet\" href=\"nojs.css\" />\r\n</head>\r\n \r\n<body bgcolor=\"#D3D6EB\">\r\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr height=\"20px\">\r\n    <td align=\"center\"><h1>INDEX</h1></td>\r\n  </tr>\r\n  <tr><td><table border=\"0\" width=\"100%\" >\r\n  <tr height=\"40px\">\r\n    <td align=\"left\" style=\"padding:10px\" width=\"50%\"><span class=\"bold15\">Author: </span><span class=\"normal15\">");

	mTask.writeUTF8String( xIndexFile, sDocumentTitle );

	mTask.writeUTF8String( xIndexFile,"</span><br /><span class=\"bold15\">Title: </span><span class=\"normal15\">");

	mTask.writeUTF8String( xIndexFile, sAuthor );

	mTask.writeUTF8String( xIndexFile,"</span></td>\r\n    <td align=\"right\" style=\"padding:10px\"><a href=\"s1.html\"><button value=\"START\" class=\"LaunchButton\">START</button></a>");

	if(mbEnableHD)
		mTask.writeUTF8String( xIndexFile,"<br /><a href=\"s1HD.html\"><button value=\"Start in HD\" class=\"LaunchButton\">Start in HD</button></a>");

	mTask.writeUTF8String( xIndexFile,"</td>\r\n  </tr></table>\r\n  </td></tr>\r\n  <tr height=\"10px\"><td align=\"center\" class=\"f10\">Click on the Title of the slide to open that slide directly");

	if(mbEnableHD)
		mTask.writeUTF8String( xIndexFile,", Click HD to launch that slide in HD Mode.");

	mTask.writeUTF8String( xIndexFile,"</td></tr>\r\n  <tr>\r\n    <td align=\"center\">\r\n    <table width=\"70%\" border=\"0\" cellspacing=\"10\" cellpadding=\"0\">\r\n  <tr height=\"15px\" class=\"IndexHeading\">\r\n    <th scope=\"col\" align=\"center\" width=\"80px\">Slide No.</th>\r\n    <th scope=\"col\" align=\"center\">Title</th>\r\n");    

	if(mbEnableHD)
		mTask.writeUTF8String( xIndexFile,"<th scope=\"col\" align=\"center\" width=\"80px\">View in</th>\r\n");

	mTask.writeUTF8String( xIndexFile,"  </tr>");
}



void nonJavaScriptExport::writeIndexFoot( const Reference< XOutputStream >& xIndexFile )
{
	mTask.writeUTF8String( xIndexFile,"</table>\r\n    </td>\r\n  </tr>\r\n  <tr height=\"10px\">\r\n    <td>&nbsp;</td>\r\n  </tr>\r\n</table>\r\n</body>\r\n</html>");

}

void nonJavaScriptExport::writeIndexEntry(OUString sPageNo, OUString sPageTitle, const Reference< XOutputStream >& xIndexFile )
{

	mLog.log("\r\nAdding Index Entry, SlideNo: ");
	mLog.log(sPageNo," Title: ");
	mLog.log(sPageTitle,"\r\n");

	mTask.writeUTF8String( xIndexFile,"<tr class=\"IndexEntry\">\r\n    <td align=\"center\">");
	mTask.writeUTF8String( xIndexFile,sPageNo);
	mTask.writeUTF8String( xIndexFile,"</td>\r\n    <td align=\"left\" class=\"leftPadding15\"><a href=\"s");
	mTask.writeUTF8String( xIndexFile,sPageNo);
	mTask.writeUTF8String( xIndexFile,".html\"><span class=\"LinkOverride\">");
	mTask.writeUTF8String( xIndexFile,sPageTitle);	
	mTask.writeUTF8String( xIndexFile,"</span></a></td>\r\n    ");

	if(mbEnableHD)
	{
		mTask.writeUTF8String( xIndexFile,"<td align=\"center\"><a href=\"s");
		mTask.writeUTF8String( xIndexFile,sPageNo);
		mTask.writeUTF8String( xIndexFile,"HD.html\"><span class=\"LinkOverride\">HD</span></a></td>\r\n  ");
	}

	mTask.writeUTF8String( xIndexFile,"</tr>");
}

// write slide head information
void nonJavaScriptExport::writeSlideHead(OUString sDocumentTitle, const Reference< XOutputStream >& xSlideFile )
{
	mTask.writeUTF8String( xSlideFile,"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>");
	mTask.writeUTF8String( xSlideFile,sDocumentTitle);
	mTask.writeUTF8String( xSlideFile," | OpenOffice.org</title>\r\n<link type=\"text/css\" rel=\"stylesheet\" href=\"nojs.css\" />\r\n</head>");
}

// write Slide entry
void nonJavaScriptExport::writeSlideEntry(sal_Int32 nPageNo, bool bIsHD, const Reference< XOutputStream >& xSlideFile )
{

	//preparing required strings
	OUString sPageNo;
	sPageNo = OUString::valueOf(nPageNo,10);

	OUString sImageFile(RTL_CONSTASCII_USTRINGPARAM("img"));
	sImageFile += sPageNo;

	OUString sLastPage(RTL_CONSTASCII_USTRINGPARAM("s"));
	sLastPage += OUString::valueOf(mnPageCount,10);

	OUString sFirstPage(RTL_CONSTASCII_USTRINGPARAM("s1"));

	OUString sNextPage(RTL_CONSTASCII_USTRINGPARAM("s"));
	if(nPageNo < mnPageCount)
	{
		sNextPage += OUString::valueOf(nPageNo+1,10);
	}
	else
	{
		sNextPage += OUString::valueOf(nPageNo,10);
	}

	OUString sPrevPage(RTL_CONSTASCII_USTRINGPARAM("s"));
	if(nPageNo > 1)
	{
		sPrevPage += OUString::valueOf(nPageNo-1,10);
	}
	else
	{
		sPrevPage += OUString::valueOf(nPageNo,10);
	}

	OUString sIndexPage(RTL_CONSTASCII_USTRINGPARAM("index.html"));

	OUString sSwitchPage(RTL_CONSTASCII_USTRINGPARAM("s"));
	sSwitchPage += sPageNo;

	OUString sSwitchText;

	if(bIsHD)
	{
		sImageFile += OUString(RTL_CONSTASCII_USTRINGPARAM("HD.png"));
		sLastPage += OUString(RTL_CONSTASCII_USTRINGPARAM("HD.html"));
		sFirstPage += OUString(RTL_CONSTASCII_USTRINGPARAM("HD.html"));
		sNextPage += OUString(RTL_CONSTASCII_USTRINGPARAM("HD.html"));
		sPrevPage += OUString(RTL_CONSTASCII_USTRINGPARAM("HD.html"));
		sSwitchPage += OUString(RTL_CONSTASCII_USTRINGPARAM(".html"));
		sSwitchText = OUString(RTL_CONSTASCII_USTRINGPARAM("Low"));
	}
	else
	{
		sImageFile += OUString(RTL_CONSTASCII_USTRINGPARAM(".png"));
		sLastPage += OUString(RTL_CONSTASCII_USTRINGPARAM(".html"));
		sFirstPage += OUString(RTL_CONSTASCII_USTRINGPARAM(".html"));
		sNextPage += OUString(RTL_CONSTASCII_USTRINGPARAM(".html"));
		sPrevPage += OUString(RTL_CONSTASCII_USTRINGPARAM(".html"));
		sSwitchPage += OUString(RTL_CONSTASCII_USTRINGPARAM("HD.html"));
		sSwitchText = OUString(RTL_CONSTASCII_USTRINGPARAM("HD"));
	}

	mTask.writeUTF8String( xSlideFile,"<body>\r\n<!-- for non index slide-->\r\n<div id=\"SlideContainer\"><img height=\"100%\" width=\"100%\" border=\"0px\" src=\"../slides/");

	mTask.writeUTF8String( xSlideFile,sImageFile);
	mTask.writeUTF8String( xSlideFile,"\" /></div>\r\n\r\n<div id=\"NavigationBar\" align=\"right\"><a href=\"");
	mTask.writeUTF8String( xSlideFile,sFirstPage);
	mTask.writeUTF8String( xSlideFile,"\"><button class=\"navButton op60\" value=\"First\">First</button></a> <a href=\"");
	mTask.writeUTF8String( xSlideFile,sPrevPage);
	mTask.writeUTF8String( xSlideFile,"\"><button class=\"navButton op60\" value=\"Back\">Back</button></a> <a href=\"");
	mTask.writeUTF8String( xSlideFile,sIndexPage);
	mTask.writeUTF8String( xSlideFile,"\"><button class=\"navButton op60\" value=\"");
	mTask.writeUTF8String( xSlideFile,((mbEnableIndex)?"Index":"Home") );
	mTask.writeUTF8String( xSlideFile,"\">");
	mTask.writeUTF8String( xSlideFile,((mbEnableIndex)?"Index":"Home") );
	mTask.writeUTF8String( xSlideFile,"</button></a> <a href=\"");
	mTask.writeUTF8String( xSlideFile,sNextPage);
	mTask.writeUTF8String( xSlideFile,"\"><button class=\"navButton op60\" value=\"Next\">Next</button></a> <a href=\"");
	mTask.writeUTF8String( xSlideFile,sLastPage);
	mTask.writeUTF8String( xSlideFile,"\"><button class=\"navButton op60\" value=\"Last\">Last</button></a> </a> ");

	if(mbEnableHD)
	{
		mTask.writeUTF8String( xSlideFile,"<a href=\"");
		mTask.writeUTF8String( xSlideFile,sSwitchPage);
		mTask.writeUTF8String( xSlideFile,"\"><button class=\"navButton op60\" value=\"");
		mTask.writeUTF8String( xSlideFile,sSwitchText);
		mTask.writeUTF8String( xSlideFile,"\" style=\"font-weight:bold\">");
		mTask.writeUTF8String( xSlideFile,sSwitchText);
		mTask.writeUTF8String( xSlideFile,"</button></a>");
	}

	mTask.writeUTF8String( xSlideFile,"</div>\r\n<div id=\"PgNo\" align=\"center\">");
	mTask.writeUTF8String( xSlideFile,sPageNo);
	mTask.writeUTF8String( xSlideFile,"</div>\r\n");
}

// write Slide foot information
void nonJavaScriptExport::writeSlideFoot( const Reference< XOutputStream >& xSlideFile )
{
	mTask.writeUTF8String( xSlideFile,"</body>\r\n</html>");
}

// write start page
void nonJavaScriptExport::writeStartPage( const Reference< XOutputStream >& xIndexFile, OUString sDocumentTitle )
{

	mTask.writeUTF8String( xIndexFile, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" );
	mTask.writeUTF8String( xIndexFile, "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>Index-");
	mTask.writeUTF8String( xIndexFile, sDocumentTitle );
	mTask.writeUTF8String( xIndexFile, "</title>" );
	mTask.writeUTF8String( xIndexFile,"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
	mTask.writeUTF8String( xIndexFile,"<link type=\"text/css\" rel=\"stylesheet\" href=\"nojs.css\" />\r\n</head>\r\n \r\n<body bgcolor=\"#D3D6EB\">\r\n<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr height=\"100%\">\r\n    <td align=\"center\"> <a href=\"s1.html\" ><button style=\"font-weight:bold; font-size:20px; height:30px; width:100px\">START</button></a></td>\r\n  </tr>\r\n</table></body></html>");


}

commonTasks.hxx

contains common Tasks performed by various modules, to remove code redundancy.

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef INCLUDED_COMMONTASKS_HXX
#define INCLUDED_COMMONTASKS_HXX

#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>

class commonTasks
{
private:

com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > mxServiceFactory;		
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > mxFileAccess;
com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > mxURLTransformer;

public:
//constructor
commonTasks( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );

//normalize the folder path, i.e add '/' in the end if not present.
rtl::OUString normalizeFolderPath( const rtl::OUString aPath );

//save UTF8 String to the XOutputStream
void writeUTF8String( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream, const rtl::OUString& rString );

// write the Character string to the XOutputStream in UTF-8 Encoding
void writeUTF8String( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream, const sal_Char* pStr );

//copy a file 
bool copyFile(const rtl::OUString& rSourceURL, const rtl::OUString& rDestURL, bool Replace);

//get filename from complete path
rtl::OUString getFileNameFromCompletePath(rtl::OUString sPath);

//get folder path from complete path
rtl::OUString getFolderPathFromCompletePath(rtl::OUString sPath);

};
#endif

commonTasks.cxx

contains common Tasks performed by various modules, to remove code redundancy.

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"
#include "commonTasks.hxx"
#include <boost/shared_ptr.hpp>


using rtl::OUString;
using namespace rtl;
using namespace com::sun::star;
using namespace com::sun::star::io;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
using namespace com::sun::star::util;


//constructor for the class
commonTasks::commonTasks( const Reference< XComponentContext >& xContext )
:mxServiceFactory( xContext->getServiceManager(), UNO_QUERY_THROW )
, mxFileAccess( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), xContext), UNO_QUERY_THROW )
, mxURLTransformer( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer" )), xContext), UNO_QUERY_THROW )
{
}


//normalize the folder path, i.e add '/' in the end if not present.
OUString commonTasks::normalizeFolderPath( const OUString aPath )
{
	OUString aRet( aPath );
	if( aPath.endsWithAsciiL( RTL_CONSTASCII_STRINGPARAM("/") ) )
	{
		return aRet;
	}
	else
	{
		aRet += OUString( RTL_CONSTASCII_USTRINGPARAM("/") );
	
		return aRet;
	} 

}


// write the OUString to the XOutputStream in UTF-8 Encoding
void commonTasks::writeUTF8String( const Reference< XOutputStream >& xOutputStream, const OUString& rString )
{
	
	OString aStr( OUStringToOString( rString, RTL_TEXTENCODING_UTF8 ) ) ;
	const Sequence< sal_Int8 > aData( (const sal_Int8*)aStr.getStr(), aStr.getLength() );
	xOutputStream->writeBytes( aData );
}

// write the Character string to the XOutputStream in UTF-8 Encoding
void commonTasks::writeUTF8String( const Reference< XOutputStream >& xOutputStream, const sal_Char* pStr )
{
	const Sequence< sal_Int8 > aData( (const sal_Int8*)pStr, strlen( (char*)pStr ) );
	xOutputStream->writeBytes( aData );
}

//copy file
bool commonTasks::copyFile(const OUString& rSourceURL, const OUString& rDestURL, bool Replace)
{

	if( !mxFileAccess->exists( rSourceURL ) )
	{
		return false;
	}
	if( !mxFileAccess->exists( rDestURL ) )
	{
		mxFileAccess->copy( rSourceURL, rDestURL );
		return true;
	}
	else 
	{
		if(Replace)
		{
			mxFileAccess->kill( rDestURL );
			mxFileAccess->copy( rSourceURL, rDestURL );
		}
		else
		{
			return false;
		}
	}
	return true;

}


//get filename from complete path
OUString commonTasks::getFileNameFromCompletePath(OUString sPath)
{
	URL aSourceURL;
	aSourceURL.Complete = sPath;
	mxURLTransformer->parseStrict( aSourceURL );

	return aSourceURL.Name;

}

//get folder path from complete path
OUString commonTasks::getFolderPathFromCompletePath(OUString sPath)
{
	URL aSourceURL;
	aSourceURL.Complete = sPath;
	mxURLTransformer->parseStrict( aSourceURL );

	return aSourceURL.Path;
}

logWriter.hxx

a simple Logging system.

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef INCLUDED_LOGWRITER_HXX
#define INCLUDED_LOGWRITER_HXX

#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>

class logWriter
{
private:

// value to indicate valid logfile path
bool mLogFileDefined;
bool mbDisableHeaderFooter;
// log file path
rtl::OUString mLogFilePath;
// buffer log string
rtl::OUString mLogString;
// stream for log file
com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > mxLogStream;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > mxServiceFactory;		
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > mxFileAccess;
				
public:
//constructor
logWriter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
//destructor
~logWriter();
// write log file
bool log( const rtl::OUString rStr);
bool log( const sal_Char* pStr );
bool log( const rtl::OUString rStr, const sal_Char* cStr);

// set path to log file(once this is set data will go to the file specified including previously buffered log data)
bool setLogFilePath( const rtl::OUString sPath);
//retrieve the log string (if not sending data to a file)
rtl::OUString getLog();
//disable header footer
void disableHeaderFooter();
//flush buffer
void flushBuffer();
};
#endif

logwriter.cxx

a simple Logging system.

/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"
#include "logWriter.hxx"
#include <boost/shared_ptr.hpp>

using namespace com::sun::star::io;
using namespace com::sun::star;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
using namespace rtl;
using rtl::OUString;


logWriter::logWriter( const Reference< XComponentContext >& xContext )
:mxServiceFactory( xContext->getServiceManager(), UNO_QUERY_THROW )
, mxFileAccess( mxServiceFactory->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), xContext), UNO_QUERY_THROW )
{
	mLogFileDefined = false;
	mbDisableHeaderFooter = false;
	mLogString += OUString( RTL_CONSTASCII_USTRINGPARAM( "******************************************************************* \r\n--------------------HTML EXTENDED EXPORT FILTER-------------------- \r\nLog File for the current export process. \r\n \r\n(c) OpenOffice.org \r\n \r\n******************************************************************* \r\n------------------------Log File Begins Here----------------------- \r\n \r\n" ) );
}

logWriter::~logWriter()
{
	if(!mbDisableHeaderFooter)
	{
		log("\r\n-----------------------------END OF LOG-----------------------------");
	}
}

// write log file
bool logWriter::log( const rtl::OUString rStr)
{
	if(mLogFileDefined)
	{
		OString aStr( OUStringToOString( mLogString, RTL_TEXTENCODING_UTF8 ) ) ;
		const Sequence< sal_Int8 > aData( (const sal_Int8*)aStr.getStr(), aStr.getLength() );
		mxLogStream->writeBytes( aData );

		mLogString = OUString( RTL_CONSTASCII_USTRINGPARAM(" "));

		OString abStr( OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ) ) ;
		const Sequence< sal_Int8 > abData( (const sal_Int8*)abStr.getStr(), abStr.getLength() );
		mxLogStream->writeBytes( abData );
		return true;
	}
	else
	{
		mLogString += rStr;
		return false;
	}
	return false;
}
bool logWriter::log( const sal_Char* pStr )
{
	if(mLogFileDefined)
	{
		OString aStr( OUStringToOString( mLogString, RTL_TEXTENCODING_UTF8 ) ) ;
		const Sequence< sal_Int8 > aData( (const sal_Int8*)aStr.getStr(), aStr.getLength() );
		mxLogStream->writeBytes( aData );

		mLogString = OUString( RTL_CONSTASCII_USTRINGPARAM(" "));
		
		const Sequence< sal_Int8 > abData( (const sal_Int8*)pStr, strlen( (char*)pStr ) );
		mxLogStream->writeBytes( abData );
		
		return true;
	}
	else
	{
		mLogString += OUString( pStr, strlen( (char*)pStr ), RTL_TEXTENCODING_UTF8 );;
		return false;
	}
	return false;
}

bool logWriter::log( const rtl::OUString rStr, const sal_Char* cStr)
{
	if(mLogFileDefined)
	{
		OString aStr( OUStringToOString( mLogString, RTL_TEXTENCODING_UTF8 ) ) ;
		const Sequence< sal_Int8 > aData( (const sal_Int8*)aStr.getStr(), aStr.getLength() );
		mxLogStream->writeBytes( aData );

		mLogString = OUString( RTL_CONSTASCII_USTRINGPARAM(" "));

		rtl::OString abStr( rtl::OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ) ) ;
		const Sequence< sal_Int8 > abData( (const sal_Int8*)abStr.getStr(), abStr.getLength() );
		mxLogStream->writeBytes( abData );
		const Sequence< sal_Int8 > acData( (const sal_Int8*)cStr, strlen( (char*)cStr ) );
		mxLogStream->writeBytes( acData );

		return true;
	}
	else
	{
		mLogString += rStr;
		mLogString += OUString( cStr, strlen( (char*)cStr ), RTL_TEXTENCODING_UTF8 );
		return false;
	}
	return false;

}


// set path to log file
bool logWriter::setLogFilePath( const rtl::OUString sPath)
{
	mLogFilePath = sPath;
	mxLogStream =  mxFileAccess->openFileWrite( mLogFilePath );
	mLogFileDefined = true;
	return true;
}

OUString logWriter::getLog()
{
return mLogString;
}


//disable header footer,, should be called before you start logging and before setLogFilePath
void logWriter::disableHeaderFooter()
{
	mbDisableHeaderFooter = true;
	flushBuffer();	
}

//flush buffer
void logWriter::flushBuffer()
{
	mLogString = OUString();
}

Client Browser End

files working at client browser end


oooadd.js

This file is used to embed the presentation in existing documents

/*

oooadd.js

NOTE: all variables and functions have a prefix "ooo" to minnimise conflicts..

use this script to embbed the presentation in an existing webpage.

syntax:
in the head section add this script
<script type="text/javascript" src="(path)/add.js"></script>

in the body section,, just assign the class="presentationTrigger" to ANY element and add one custom attribute ooopath="path to presentation folder", rest all will be automatically done by this script, i.e adding action listeners, event handlers, pointer display on hover and CSS. on clicking that element(s) it will launch presentation in current document as an overlay.
syntax:
<div(or any element) class="presentationTrigger" ooopath="path to presentation folder"></div(or any element)>
ex.
<div class="presentationTrigger" ooopath="samplePresentation"></div>
<div class="presentationTrigger" ooopath="cache/samplePresentation"></div>
you can also link to remote presentations:
<div class="presentationTrigger" ooopath="http://www.site.com/folder/samplePresentation"></div>

you can add multiple seperate presentations in one file, by changing the value of ooo attribute for each trigger to desired path.

IF YOU WANT TO USE YOUR OWN CLASS NAME, then edit the variable "triggerClass" below


*/

//*****************************************DEFAULT SETTINGS HERE*********************
// class Name of the trigger
var oootriggerClass = "presentationTrigger";
var boooBackGroundColor = "#000000";
var boooBackMargin = 99.5;
var booobackGroundTransparency = 0.80;
var boooifrSize = 98;
var boooOSD = false;
//**********************************EDIT THINGS BELOW WITH CARE********************

var oooBackGroundColor;
var oooBackMargin;
var ooobackGroundTransparency;
var oooifrSize;
var oooOSD;

var ooorszflag = false;
// ooobrowser object holds data about current browser window, like height, width.
var ooobrowser = new Object();
ooobrowser.width = 0;
ooobrowser.height = 0;
//get size of window
function ooogetSize(){
	if( typeof( window.innerWidth ) == 'number' ) 
	{ 
	ooobrowser.width = window.innerWidth; 
	ooobrowser.height = window.innerHeight;
	}
	else if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight)) 
	{
	ooobrowser.width = document.documentElement.clientWidth; 
	ooobrowser.height = document.documentElement.clientHeight;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
	ooobrowser.width = document.body.clientWidth; 
	ooobrowser.height = document.body.clientHeight;
	}};

//  on click event handler
function oooonclick(e){
	
	var path;
	ifpos = new Object();
	bgpos = new Object();
	// get the right event and target element. cross browser support
	var ehandle = (e==null)?window.event.srcElement:e.target;
	//gathering the attributes and the information stored in them
	var source = ehandle.getAttribute("ooopath");
	oooBackGroundColor = (ehandle.getAttribute("ooobgColor") == null)?boooBackGroundColor:ehandle.getAttribute("ooobgColor");
	oooBackMargin = (ehandle.getAttribute("ooobgMargin") == null)?boooBackMargin:Math.abs(ehandle.getAttribute("ooobgMargin"));
	ooobackGroundTransparency = (ehandle.getAttribute("ooobgTrans") == null)?booobackGroundTransparency:Math.abs(ehandle.getAttribute("ooobgTrans"));
	oooifrSize = (ehandle.getAttribute("ooosize") == null)?boooifrSize:parseInt(ehandle.getAttribute("ooosize"));
	oooOSD = (ehandle.getAttribute("oooOSD") == null)?boooOSD:parseInt(ehandle.getAttribute("oooOSD"));
	// checking if ooopath attributr is set, its required hence if not message is shown
	if(source == null){
	 alert("NO TARGET PRESENTATION DEFINED!! add '' ooopath='path to folder' '' Attribute to this trigger.");
	 return 1;
	}
	else
	{
		path = source + "/index.html";
	}
	ooorszflag=true;
	// setting parameters for iframe
	ifpos.height = ((oooifrSize/100)*ooobrowser.height);
	ifpos.width = ((oooifrSize/100)*ooobrowser.width);
	if(oooifrSize >96){ifpos.width = ooobrowser.width - (ooobrowser.height - ifpos.height)}
	ifpos.top = parseInt((ooobrowser.height - ifpos.height) / 2);
	ifpos.left = parseInt((ooobrowser.width - ifpos.width)/2);
	//setting parameters for background
	bgpos.height = ((oooBackMargin/100)*ooobrowser.height);
	bgpos.width = ((oooBackMargin/100)*ooobrowser.width);
	if(oooifrSize >96){bgpos.width = ooobrowser.width - (ooobrowser.height - bgpos.height)}
	bgpos.top = parseInt((ooobrowser.height - bgpos.height) / 2);
	bgpos.left = parseInt((ooobrowser.width - bgpos.width)/2);
	//creating background
	var backgnd = document.createElement("div");
	backgnd.style.backgroundColor = oooBackGroundColor;
	backgnd.id = "ooobgdiv";
	backgnd.style.top = bgpos.top+"px";
	backgnd.style.left = bgpos.left+"px";
	backgnd.style.height = bgpos.height +"px";
	backgnd.style.width = bgpos.width +"px";
	backgnd.style.position = "absolute";
	backgnd.style.zIndex = 12;
	backgnd.style.filter = "alpha(opacity=" +(00)+")";
	backgnd.style.opacity = 0.0+"";
	document.getElementsByTagName("body").item(0).appendChild(backgnd);
	backgnd.style.filter = "alpha(opacity=" +(ooobackGroundTransparency*100)+")";
	backgnd.style.opacity = ooobackGroundTransparency+"";
	//creating iframe
	var Iframe = document.createElement("iframe");
	Iframe.src = path;
	Iframe.style.position = "absolute";
	Iframe.id = "oooIframe";
	Iframe.style.top = ifpos.top + "px";
	Iframe.style.left = ifpos.left + "px";
	Iframe.setAttribute("allowtransparency","1");
	Iframe.setAttribute("scrolling","auto");
	Iframe.setAttribute("frameborder","0");
	Iframe.style.border = "none";
	Iframe.style.overflow = "auto";
	Iframe.style.height = ifpos.height +"px";
	Iframe.style.width = ifpos.width +"px";
	Iframe.style.zIndex = 13;
	document.getElementsByTagName("body").item(0).appendChild(Iframe);
	//creating close button
	var closeb = document.createElement("div");
	closeb.innerHTML = "Close |X|";
	closeb.style.color= "#ffffff";
	closeb.style.fontSize = "10px";
	closeb.id = "ooocloseb";
	closeb.style.backgroundColor = "#ff0000";
	closeb.style.fontWeight = "bold";
	closeb.style.position = "absolute";
	closeb.style.zIndex = 14;
	closeb.style.border = "solid";
	closeb.style.top = "0px";
	closeb.style.height = "14px";
	closeb.style.width = "50px";
	closeb.style.left = (ooobrowser.width - 53) + "px";
	closeb.style.borderColor = "#000000";
	closeb.style.borderRight = "none";
	closeb.style.borderTop = "none";
	closeb.style.cursor = "pointer";
	closeb.align = "center";
	closeb.onclick = oooclose;
	document.getElementsByTagName("body").item(0).appendChild(closeb);
}


// window on load event handler
function oooonload(){
	ooogetSize();
	oooapply();
}

// apply properties to all triggers
function oooapply(){	
	var allHTMLTags = new Array();
	var allHTMLTags=document.getElementsByTagName("*");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==oootriggerClass) {
			allHTMLTags[i].style.cursor = "pointer";
			allHTMLTags[i].onclick = oooonclick;
			if(oooOSD){
			allHTMLTags[i].onmouseover = oooonmouseover;
			allHTMLTags[i].onmouseout = oooonmouseout;
			}
		}
	}
}
// event handler,, it is an override, enter your onmouseover js code here
function oooonmouseover(){
	
}

// event handler,, it is an override, enter your onmouseout js code here
function oooonmouseout(){
	
	
}

function oooclose(){
	document.getElementsByTagName("body").item(0).removeChild(document.getElementById("ooocloseb"));
	document.getElementsByTagName("body").item(0).removeChild(document.getElementById("oooIframe"));
	document.getElementsByTagName("body").item(0).removeChild(document.getElementById("ooobgdiv"));
	ooorszflag=false;
}

function oooresize(){

	if(ooorszflag){
	ooogetSize();
	ifpos = new Object();
	bgpos = new Object();
	var bg = document.getElementById("ooobgdiv");
	var cb = document.getElementById("ooocloseb");
	var ifr = document.getElementById("oooIframe");
	ifpos.height = ((oooifrSize/100)*ooobrowser.height);
	ifpos.width = ((oooifrSize/100)*ooobrowser.width);
	if(oooifrSize >96){ifpos.width = ooobrowser.width - (ooobrowser.height - ifpos.height)}
	ifpos.top = parseInt((ooobrowser.height - ifpos.height) / 2);
	ifpos.left = parseInt((ooobrowser.width - ifpos.width)/2);
	bgpos.height = ((oooBackMargin/100)*ooobrowser.height);
	bgpos.width = ((oooBackMargin/100)*ooobrowser.width);
	if(oooifrSize >96){bgpos.width = ooobrowser.width - (ooobrowser.height - bgpos.height)}
	bgpos.top = parseInt((ooobrowser.height - bgpos.height) / 2);
	bgpos.left = parseInt((ooobrowser.width - bgpos.width)/2);
	bg.style.top = bgpos.top + "px";
	bg.style.left = bgpos.left + "px";
	bg.style.height = bgpos.height + "px";
	bg.style.width = bgpos.width + "px";
	ifr.style.top = ifpos.top + "px";
	ifr.style.left = ifpos.left + "px";
	ifr.style.height = ifpos.height + "px";
	ifr.style.width = ifpos.width + "px";
	cb.style.left = (ooobrowser.width - 53) + "px";
	
	}
}

window.onload = oooonload;
window.onresize = oooresize;


presentation.js

It is the standard core of the exported presentation, it will remain constant or same for all exports and templates, its main functions are:

  1. Initialize and load the HTML Document.
  2. Provide Dynamic functionality to HTML page, i.e. to work in single document without refresh or links.
  3. A bridge between template and the HTML document(But without restrictions, template still could override this and work directly on HTML if required by the developer)
  4. And the most important, provide template developers with a library for developing templates. This library will make template development easy, simple, fast and powerful even by novice developers.
var presentation = new Object(); //onload(), onresize(), loadSlide(), printPage(), writeCookie(), readCookie(), preloadImage(),
presentation.template = new Object();//folder,js,css,onload(),resize()
presentation.template.events = new Object(); // 10 handler overrides , 10 event inlines
presentation.client = new Object(); //height, width, getSize(), statusMsg()
presentation.client.browserInfo = new BI(); // name, codename, version, platform, JavaEnabled
presentation.client.system = new PD(); //platform
presentation.info = new Object(); //6 vars
presentation.settings = new Object();// 7 vars
presentation.effects = new Object(); // slide()
presentation.element = new Object();//addElement(),RemoveElementById(),addCssJs(), place(), size(), placeNsize(), aplace(), asize(), aplaceNsize()
presentation.events = new Object();// 10 event handlers
presentation.element.button = new Object();
presentation.element.button.text = new Object();//id,eclass,add(),remove()
presentation.element.button.normal = new Object();//id,eclass,add(),remove()
presentation.element.button.notes = new Object();//id,eclass,add(),remove()
presentation.element.button.mute = new Object();//id,eclass,add(),remove()
presentation.element.button.index = new Object();//id,eclass,add(),remove()
presentation.element.navigation = new Object();
presentation.element.navigation.next = new Object();//id,eclass,add(),remove()
presentation.element.navigation.prev = new Object();//id,eclass,add(),remove()
presentation.element.navigation.first = new Object();//id,eclass,add(),remove()
presentation.element.navigation.end = new Object();//id,eclass,add(),remove()
presentation.element.navigation.play = new Object();//id,eclass,add(),remove()

layer = new Object();
layer.cache = 1;
layer.bg = 2;
layer.bs1 = 3;
layer.bs2 = 4;
layer.bs3 = 5;
layer.activeSlide = 6;
layer.as1 = 7;
layer.as2 = 8;
layer.as3 = 9;
layer.as4 = 10;
layer.navigation = 11;
layer.specialContent = 12;
layer.buttons = 13;

presentation.settings.playMode = false;
presentation.settings.notesMode = false;
	
presentation.element.navigation.next.id = "NextButton";
presentation.element.navigation.next.eclass = "navigation";
presentation.element.navigation.next.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.NextClick;
document.getElementById(this.id).onmouseover = presentation.events.NextMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.NextMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.navigation.next.remove = function(){presentation.element.removeElementById(presentation.element.navigation.next.id);};

presentation.element.navigation.prev.id = "PrvButton";
presentation.element.navigation.prev.eclass = "navigation";
presentation.element.navigation.prev.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.PrevClick;
document.getElementById(this.id).onmouseover = presentation.events.PrevMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.PrevMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.navigation.prev.remove = function(){presentation.element.removeElementById(this.id);};


presentation.element.navigation.first.id = "FirstButton";
presentation.element.navigation.first.eclass = "navigation";
presentation.element.navigation.first.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.StartClick;
document.getElementById(this.id).onmouseover = presentation.events.StartMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.StartMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.navigation.first.remove = function(){presentation.element.removeElementById(this.id);};

presentation.element.navigation.end.id = "EndButton";
presentation.element.navigation.end.eclass = "navigation";
presentation.element.navigation.end.add = function(image){presentation.element.addElement("img",this.id,this.eclass);

document.getElementById(this.id).onclick = presentation.events.EndClick;
document.getElementById(this.id).onmouseover = presentation.events.EndMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.EndMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.navigation.end.remove = function(){presentation.element.removeElementById(this.id);};

presentation.element.navigation.play.id = "PlayButton";
presentation.element.navigation.play.eclass = "navigation";
presentation.element.navigation.play.add = function(image){presentation.element.addElement("img",this.id,this.eclass);

document.getElementById(this.id).onclick = presentation.events.PlayClick;
document.getElementById(this.id).onmouseover = presentation.events.PlayMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.PlayMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.navigation.play.remove = function(){presentation.element.removeElementById(this.id);};

presentation.element.button.text.id = "TextButton";
presentation.element.button.text.eclass = "button";
presentation.element.button.text.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.TextClick;
document.getElementById(this.id).onmouseover = presentation.events.TextMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.TextMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.button.text.remove = function(){presentation.element.removeElementById(this.id);};

presentation.element.button.normal.id = "NormalButton";
presentation.element.button.normal.eclass = "button";
presentation.element.button.normal.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.NormalClick;
document.getElementById(this.id).onmouseover = presentation.events.NormalMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.NormalMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.button.normal.remove = function(){presentation.element.removeElementById(this.id);};

presentation.element.button.notes.id = "NotesButton";
presentation.element.button.notes.eclass = "button";
presentation.element.button.notes.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.NotesClick;
document.getElementById(this.id).onmouseover = presentation.events.NotesMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.NotesMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.button.notes.remove = function(){presentation.element.removeElementById(this.id);};

presentation.element.button.mute.id = "MuteButton";
presentation.element.button.mute.eclass = "button";
presentation.element.button.mute.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.MuteClick;
document.getElementById(this.id).onmouseover = presentation.events.MuteMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.MuteMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.button.mute.remove = function(){presentation.element.removeElementById(this.id);};

presentation.element.button.index.id = "IndexButton";
presentation.element.button.index.eclass = "button";
presentation.element.button.index.add = function(image){presentation.element.addElement("img",this.id,this.eclass);
document.getElementById(this.id).onclick = presentation.events.IndexClick;
document.getElementById(this.id).onmouseover = presentation.events.IndexMouseOver;
document.getElementById(this.id).onmouseout = presentation.events.IndexMouseOut;
document.getElementById(this.id).src = image;
};
presentation.element.button.index.remove = function(){presentation.element.removeElementById(this.id);};




presentation.info.author = document.getElementsByName("oooAuthor").item(0).getAttribute("content");
presentation.info.slideCount = document.getElementsByName("oooSlideCount").item(0).getAttribute("content");
presentation.info.title = document.getElementsByName("oooTitle").item(0).getAttribute("content");
presentation.info.version = document.getElementsByName("oooVersion").item(0).getAttribute("content");
presentation.info.extensionVersion = document.getElementsByName("oooExtensionVersion").item(0).getAttribute("content");
presentation.info.timeStamp = document.getElementsByName("oooTimeStamp").item(0).getAttribute("content");

presentation.settings.outline = (document.getElementsByName("oooOutline").item(0).getAttribute("content") == "yes")?true:false;
presentation.settings.notes = (document.getElementsByName("oooNotes").item(0).getAttribute("content") == "yes")?true:false;
presentation.settings.index = (document.getElementsByName("oooIndex").item(0).getAttribute("content") == "yes")?true:false;
presentation.settings.sound = (document.getElementsByName("oooSound").item(0).getAttribute("content") == "yes")?true:false;
presentation.settings.indexOnLoad = (document.getElementsByName("oooShowIndexOnStart").item(0).getAttribute("content") == "yes")?true:false;
presentation.settings.autoTime = parseInt(document.getElementsByName("oooAutoTime").item(0).getAttribute("content"))*1000;
presentation.settings.webcastStatus = parseInt(document.getElementsByName("oooWebcastStatus").item(0).getAttribute("content"));



presentation.onload = function(){
	presentation.client.getSize();
	document.getElementById("NoJs").style.display = "none";
	
	presentation.info.currentSlide=1;
	
	for(n=1;n<=presentation.info.slideCount;n++){
	presentation.loadSlide(n);
	}
	if(presentation.settings.indexOnLoad){
		presentation.events.IndexClick();
	}
	var id = "s"+presentation.info.currentSlide;
	
	document.getElementById(id).style.zIndex = layer.activeSlide;
	
	if(typeof(presentation.template.onload)!="undefined"){presentation.template.onload();}
};

presentation.onresize = function(){
	presentation.client.getSize();
	
	if(typeof(presentation.template.resize)!="undefined"){presentation.template.resize();}
}

window.onload = presentation.onload;
window.onresize = presentation.onresize;

presentation.element.addElement = function(tag,id,eclass){
	var ce = document.createElement(tag);
	ce.id = id;
	ce.className = eclass;
	document.getElementsByTagName("body").item(0).appendChild(ce);
}

presentation.element.removeElementById = function(id){
	document.getElementsByTagName("body").item(0).removeChild(document.getElementById(id));
}

presentation.element.addCssJs = function(filename, filetype){
 if (filetype=="js"){
  var fileref=document.createElement("script");
  fileref.setAttribute("type","text/javascript");
  fileref.setAttribute("src", filename);
 }
 else if (filetype=="css"){
  var fileref=document.createElement("link");
  fileref.setAttribute("rel", "stylesheet");
  fileref.setAttribute("type", "text/css");
  fileref.setAttribute("href", filename);
 }
 if (typeof fileref!="undefined")
  document.getElementsByTagName("head").item(0).appendChild(fileref);
}

presentation.client.getSize = function(){
	if( typeof( window.innerWidth ) == 'number' ) 
	{ 
	presentation.client.width = window.innerWidth; 
	presentation.client.height = window.innerHeight;
	}
	else if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight)) 
	{
	presentation.client.width = document.documentElement.clientWidth; 
	presentation.client.height = document.documentElement.clientHeight;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
	presentation.client.width = document.body.clientWidth; 
	presentation.client.height = document.body.clientHeight;
	}};
	
presentation.element.place = function(id,top,left){
	var el=document.getElementById(id);
	el.style.position = "absolute";
	el.style.top = parseInt((presentation.client.height/100)*top) + "px";
	el.style.left = parseInt((presentation.client.width/100)*left) + "px";
}

presentation.element.size = function(id,height,width){
	var el=document.getElementById(id);
	el.style.position = "absolute";
	el.style.width = parseInt((presentation.client.width/100)*width) + "px";
	el.style.height = parseInt((presentation.client.height/100)*height) + "px";
}

presentation.element.placeNsize = function(id,top,left,height,width){
	presentation.element.place(id,top,left);
	presentation.element.size(id,height,width);
}

presentation.element.aplace = function(id,top,left){
	var el=document.getElementById(id);
	el.style.position = "absolute";
	el.style.top = parseInt(top) + "px";
	el.style.left = parseInt(left) + "px";
}

presentation.element.asize = function(id,height,width){
	var el=document.getElementById(id);
	el.style.position = "absolute";
	el.style.width = parseInt(width) + "px";
	el.style.height = parseInt(height) + "px";
}

presentation.element.placeNsizeByClass = function(eclass,top,left,height,width){

	var allHTMLTags = new Array();
	var allHTMLTags=document.getElementsByTagName("*");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==eclass) {
			
			presentation.element.placeNsize(allHTMLTags.item(i).id,top,left,height,width);
		}
	}
}

presentation.element.aplaceNsize = function(id,top,left,height,width){
	presentation.element.place(id,top,left);
	presentation.element.size(id,height,width);
}

presentation.events.StartClick = function(){
	
	if(typeof(presentation.template.events.StartClick)!="undefined"){presentation.template.events.StartClick();}
	else
	{
		var o = "s"+presentation.info.currentSlide;
		presentation.info.currentSlide = 1;
		var n = "s"+presentation.info.currentSlide;
		var ozi = parseInt(document.getElementById(n).style.zIndex);
		document.getElementById(n).style.zIndex = presentation.settings.SlideOnDisplayLayer;
		document.getElementById(o).style.zIndex = ozi;
		if(typeof(presentation.template.events.InlineStartClick)!="undefined"){presentation.template.events.InlineStartClick();}
	}
	};
presentation.events.EndClick = function(){
	
	if(typeof(presentation.template.events.EndClick)!="undefined"){presentation.template.events.EndClick();}
	else
	{
		var o = "s"+presentation.info.currentSlide;
		presentation.info.currentSlide = presentation.info.slideCount;
		var n = "s"+presentation.info.currentSlide;
		var ozi = parseInt(document.getElementById(n).style.zIndex);
		document.getElementById(n).style.zIndex = presentation.settings.SlideOnDisplayLayer;
		document.getElementById(o).style.zIndex = ozi;
		if(typeof(presentation.template.events.InlineEndClick)!="undefined"){presentation.template.events.InlineEndClick();}
	}
	
	};
presentation.events.NextClick = function(){
	
	if(typeof(presentation.template.events.NextClick)!="undefined"){presentation.template.events.NextClick();}
	else
	{
		if(presentation.info.currentSlide==presentation.info.slideCount){
			if(presentation.settings.playMode){
				presentation.events.PlayClick();}
			return 0;}
		var o = "s"+presentation.info.currentSlide;
		presentation.info.currentSlide++;
		var n = "s"+presentation.info.currentSlide;
		var ozi = parseInt(document.getElementById(n).style.zIndex);
		document.getElementById(n).style.zIndex = presentation.settings.SlideOnDisplayLayer;
		document.getElementById(o).style.zIndex = ozi;
		if(typeof(presentation.template.events.InlineNextClick)!="undefined"){presentation.template.events.InlineNextClick();}
	}
	
	};
presentation.events.PrevClick = function(){
	
	if(typeof(presentation.template.events.PrevClick)!="undefined"){presentation.template.events.PrevClick();}
	else
	{
		if(presentation.info.currentSlide==1){return 0;}
		var o = "s"+presentation.info.currentSlide;
		presentation.info.currentSlide--;
		var n = "s"+presentation.info.currentSlide;
		var ozi = parseInt(document.getElementById(n).style.zIndex);
		document.getElementById(n).style.zIndex = presentation.settings.SlideOnDisplayLayer;
		document.getElementById(o).style.zIndex = ozi;
		if(typeof(presentation.template.events.InlinePrevClick)!="undefined"){presentation.template.events.InlinePrevClick();}
	}
	};
presentation.events.PlayClick = function(){
	
	if(typeof(presentation.template.events.PlayClick)!="undefined"){presentation.template.events.PlayClick();}
	else
	{
		if(!presentation.settings.playMode){
		presentation.settings.intervalID = setInterval("presentation.events.NextClick()",presentation.settings.autoTime);
		presentation.settings.playMode=true;
		}
		else{
		clearInterval(presentation.settings.intervalID);
		presentation.settings.playMode = false;
		}
	if(typeof(presentation.template.events.InlinePlayClick)!="undefined"){presentation.template.events.InlinePlayClick();}	
	}
	};
presentation.events.NotesClick = function(){
	
	if(typeof(presentation.template.events.NotesClick)!="undefined"){presentation.template.events.NotesClick();}
	else{
		
		if(!presentation.settings.notesMode){	
		var id;
		for(i=1;i<=presentation.info.slideCount;i++){
			id="n"+i;
			document.getElementById(id).style.display="none";
		}
		id = "n"+presentation.info.currentSlide;
		document.getElementById(id).style.display = "inline";
		document.getElementById("notesContainer").style.display = "inline";
		presentation.settings.notesMode = true;
		}
		else{
		document.getElementById("notesContainer").style.display = "none";
		presentation.settings.notesMode = false;
		}
		if(typeof(presentation.template.events.InlineNotesClick)!="undefined"){presentation.template.events.InlineNotesClick();}
	}
	};
presentation.events.NormalClick = function(){
	
	if(typeof(presentation.template.events.NormalClick)!="undefined"){presentation.template.events.NormalClick();}
	else {
	if(typeof(presentation.template.events.InlineNormalClick)!="undefined"){presentation.template.events.InlineNormalClick();}
	}
	};
presentation.events.IndexClick = function(){
	
	if(typeof(presentation.template.events.IndexClick)!="undefined"){presentation.template.events.IndexClick();}
	else {
	if(typeof(presentation.template.events.InlineIndexClick)!="undefined"){presentation.template.events.InlineIndexClick();}
	}
	};
presentation.events.TextClick = function(){
	
	if(typeof(presentation.template.events.TextClick)!="undefined"){presentation.template.events.TextClick();}
	else {
	if(typeof(presentation.template.events.InlineTextClick)!="undefined"){presentation.template.events.InlineTextClick();}
	}
	};
presentation.events.MuteClick = function(){
	
	if(typeof(presentation.template.events.MuteClick)!="undefined"){presentation.template.events.MuteClick();}
	else {
	if(typeof(presentation.template.events.InlineMuteClick)!="undefined"){presentation.template.events.InlineMuteClick();}
	}
	};
	
presentation.events.StartMouseOver = function(){
	
	if(typeof(presentation.template.events.StartMouseOver)!="undefined"){presentation.template.events.StartMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineStartMouseOver)!="undefined"){presentation.template.events.InlineStartMouseOver();}
	}
	};
presentation.events.EndMouseOver = function(){
	
	if(typeof(presentation.template.events.EndMouseOver)!="undefined"){presentation.template.events.EndMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineEndMouseOver)!="undefined"){presentation.template.events.InlineEndMouseOver();}
	}
	};
presentation.events.NextMouseOver = function(){
	
	if(typeof(presentation.template.events.NextMouseOver)!="undefined"){presentation.template.events.NextMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineNextMouseOver)!="undefined"){presentation.template.events.InlineNextMouseOver();}
	}
	};
presentation.events.PrevMouseOver = function(){
	
	if(typeof(presentation.template.events.PrevMouseOver)!="undefined"){presentation.template.events.PrevMouseOver();}
	else {
	if(typeof(presentation.template.events.InlinePrevMouseOver)!="undefined"){presentation.template.events.InlinePrevMouseOver();}
	}
	};
presentation.events.PlayMouseOver = function(){
	
	if(typeof(presentation.template.events.PlayMouseOver)!="undefined"){presentation.template.events.PlayMouseOver();}
	else {
	if(typeof(presentation.template.events.InlinePlayMouseOver)!="undefined"){presentation.template.events.InlinePlayMouseOver();}
	}
	};
presentation.events.NotesMouseOver = function(){
	
	if(typeof(presentation.template.events.NotesMouseOver)!="undefined"){presentation.template.events.NotesMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineNotesMouseOver)!="undefined"){presentation.template.events.InlineNotesMouseOver();}
	}
	};
presentation.events.NormalMouseOver = function(){
	
	if(typeof(presentation.template.events.NormalMouseOver)!="undefined"){presentation.template.events.NormalMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineNormalMouseOver)!="undefined"){presentation.template.events.InlineNormalMouseOver();}
	}
	};
presentation.events.IndexMouseOver = function(){
	
	if(typeof(presentation.template.events.IndexMouseOver)!="undefined"){presentation.template.events.IndexMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineIndexMouseOver)!="undefined"){presentation.template.events.InlineIndexMouseOver();}
	}
	};
presentation.events.TextMouseOver = function(){
	
	if(typeof(presentation.template.events.TextMouseOver)!="undefined"){presentation.template.events.TextMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineTextMouseOver)!="undefined"){presentation.template.events.InlineTextMouseOver();}
	}
	};
presentation.events.MuteMouseOver = function(){
	
	if(typeof(presentation.template.events.MuteMouseOver)!="undefined"){presentation.template.events.MuteMouseOver();}
	else {
	if(typeof(presentation.template.events.InlineMuteMouseOver)!="undefined"){presentation.template.events.InlineMuteMouseOver();}
	}
	};
	
presentation.events.StartMouseOut = function(){
	
	if(typeof(presentation.template.events.StartMouseOut)!="undefined"){presentation.template.events.StartMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineStartMouseOut)!="undefined"){presentation.template.events.InlineStartMouseOut();}
	}
	};
presentation.events.EndMouseOut = function(){
	
	if(typeof(presentation.template.events.EndMouseOut)!="undefined"){presentation.template.events.EndMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineEndMouseOut)!="undefined"){presentation.template.events.InlineEndMouseOut();}
	}
	};
presentation.events.NextMouseOut = function(){
	
	if(typeof(presentation.template.events.NextMouseOut)!="undefined"){presentation.template.events.NextMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineNextMouseOut)!="undefined"){presentation.template.events.InlineNextMouseOut();}
	}
	};
presentation.events.PrevMouseOut = function(){
	
	if(typeof(presentation.template.events.PrevMouseOut)!="undefined"){presentation.template.events.PrevMouseOut();}
	else {
	if(typeof(presentation.template.events.InlinePrevMouseOut)!="undefined"){presentation.template.events.InlinePrevMouseOut();}
	}
	};
presentation.events.PlayMouseOut = function(){
	
	if(typeof(presentation.template.events.PlayMouseOut)!="undefined"){presentation.template.events.PlayMouseOut();}
	else {
	if(typeof(presentation.template.events.InlinePlayMouseOut)!="undefined"){presentation.template.events.InlinePlayMouseOut();}
	}
	};
presentation.events.NotesMouseOut = function(){
	
	if(typeof(presentation.template.events.NotesMouseOut)!="undefined"){presentation.template.events.NotesMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineNotesMouseOut)!="undefined"){presentation.template.events.InlineNotesMouseOut();}
	}
	};
presentation.events.NormalMouseOut = function(){
	
	if(typeof(presentation.template.events.NormalMouseOut)!="undefined"){presentation.template.events.NormalMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineNormalMouseOut)!="undefined"){presentation.template.events.InlineNormalMouseOut();}
	}
	};
presentation.events.IndexMouseOut = function(){
	
	if(typeof(presentation.template.events.IndexMouseOut)!="undefined"){presentation.template.events.IndexMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineIndexMouseOut)!="undefined"){presentation.template.events.InlineIndexMouseOut();}
	}
	};
presentation.events.TextMouseOut = function(){
	
	if(typeof(presentation.template.events.TextMouseOut)!="undefined"){presentation.template.events.TextMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineTextMouseOut)!="undefined"){presentation.template.events.InlineTextMouseOut();}
	}
	};
presentation.events.MuteMouseOut = function(){
	
	if(typeof(presentation.template.events.MuteMouseOut)!="undefined"){presentation.template.events.MuteMouseOut();}
	else {
	if(typeof(presentation.template.events.InlineMuteMouseOut)!="undefined"){presentation.template.events.InlineMuteMouseOut();}
	}
	};
	
presentation.loadSlide = function(num){
	var id = "s"+num;
	presentation.element.addElement("img",id,"slide");
	var el = document.getElementById(id);
	el.style.position = "absolute";
	el.style.zIndex = 1;
	el.src = "slides/img"+num+".png";
}

function BI()

{
  this.name = navigator.appName;
  this.codename = navigator.appCodeName;
  this.version = navigator.appVersion.substring(0,4);
  this.platform = navigator.platform;
  this.javaEnabled = navigator.javaEnabled();
}

function PD()
{
  if(navigator.appVersion.indexOf("Win") != -1)
  {
    this.platform = "Windows";
  }
  else if(navigator.appVersion.indexOf("Mac") != -1)
  {
    this.platform = "Macintosh";
  }
  else this.platform = "Other";
}

presentation.printPage = function() { print(document); }

presentation.readCookie = function(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

presentation.writeCookie = function(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}

presentation.preloadImage = function()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

presentation.client.statusMsg = function(msgStr) { self.status = msgStr; }
/*
presentation.addSound = function(){
	var sid = Math.ceil(Math.random()*100000);
	var iframe = document.createElement("iframe");
	iframe.style.zIndex = layer.cache;
	iframe.id = sid;
	document.getElementsByTagName("body").item(0).appendChild(iframe);	
	iframe.doc = null;
	   if(iframe.contentDocument)
	      iframe.doc = iframe.contentDocument;
	   else if(iframe.contentWindow)
	      iframe.doc = iframe.contentWindow.document;
	   else if(iframe.document)
	      iframe.doc = iframe.document;

		iframe.doc.createElement("html");
		iframe.doc.createElement("bgsound");
		
	   iframe.doc.open();
	   iframe.doc.close();
	return sid;
}

presentation.effects.slideIn = function(id,dir,time){
	var el = document.getElementById(id);
	var otop = el.style.top;
	otop = otop.replace("px","");
	var oleft = el.style.left;
	oleft = oleft.replace("px","");
	var oheight = el.style.height;
	oheight = oheight.replace("px","");
	var owidth = el.style.width;
	owidth = owidth.replace("px","");
	el.setAttribute("oootop",otop);
	el.setAttribute("oooleft",oleft);
	el.setAttribute("oooheight",oheight);
	el.setAttribute("ooowidth",owidth);
	el.setAttribute("ooodisp",el.style.display);
	el.setAttribute("ooooverflow",el.style.overflow);
	el.setAttribute("ss","true");
	switch(dir){
		case "l":
		sil(el,t);
		break;
		case "r":
		sir(el,t);
		break;
		case "u":
		siu(el,t);
		break;
		case "d":
		sid(el,t);
		break;
	}
}
*/
presentation.element.sendToLayer = function(eid,lid){
	var el = document.getElementById(eid);
	el.style.position = "absolute";
	el.style.zIndex = lid;
	
}


presentation.css

A common css file for the exported HTML. It is common for all exports and templates.

@charset "utf-8";
/* CSS Document , for detailed customizations of elements check the default.css file in the Template folder*/

/* following tag defines that the body of the HTML Document will not have any margin/border it will display contents from 
edge to edge of the browser window */
body{
	margin:0px;
	border:none;
	padding:0px;
	height:100%;
}

/* properties for NoJs Containers, it contains the message displayed if JavaScript is disabled in the client machine*/
#NoJs{
	background-color:#FFC;
	position:absolute;
	top:0px;
	left:0px;
	height:100%;
	width:100%;
	z-index:10;
}

.notesContainer{
	position:absolute;
	display:none;
	z-index:1;
}

#index,#textOnly{
	position:absolute;
	z-index:1;
	display:none;
	overflow:auto;
	height:100%;
	width:100%;
}

.notes{
	position:relative;
	display:none;
}

#background{
	background-color:#FFC;
	position:absolute;
	z-index:2;
	width:100%;
	height:100%;
}

.slide{
	position:absolute;
	z-index:1;
}

.DisplayedSlide{
	position:absolute;
	z-index:6;
}


default.html

This is the default format of the exported HTML file

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- *************** META INFORMATION ******************************* -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="oooAuthor" content="kushal" />
<meta name="oooSlideCount" content="7" />
<meta name="oooTitle" content="test" />
<meta name="oooVersion" content="3.0" />
<meta name="oooExtensionVersion" content="1.0" />
<meta name="oooTimeStamp" content="its value" />
<meta name="oooOutline" content="yes" />
<meta name="oooNotes" content="yes"/>
<meta name="oooIndex" content="yes"/>
<meta name="oooSound" content="yes"/>
<meta name="oooAutoTime" content="5.00" />
<meta name="oooWebcastStatus" content="0" />
<meta name="oooShowIndexOnStart" content="yes" />
<!-- *************** META INFORMATION ENDS *************************** -->


<script type="text/javascript" src="resource/presentation.js"></script>
<link type="text/css" rel="stylesheet" href="resource/presentation.css" />
<link type="text/css" rel="stylesheet" href="template/default.css" />
<script type="text/javascript" src="template/default.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<title>openOffice Exported | Presentation Title</title>
</head>

<body>
<!-- Nothing unwanted in the body,, everything will be added by template realtime on demand. No Code Redundancy.. Hurray!! -->
<!-- there could be special template elements added during export process to add flexibility.. that completely depends on template designer and his/her creativity-->
<!-- ******************************************************************************************************************
Followind section is for Javascript RollBack.. this will only be displayed if javascript is disabled.. -->
<div id="NoJs">
<h1 align="center">Welcome!</h1>
<h2 align="center">JavaScript Seems To Be Disabled!</h2>
<h4 align="center"><a href="noJS/index.html">Click Here To Launch Standard Non Javascript Version</a></h4>
<h4 align="center">Or</h4>
<h4 align="center">Enable JavaScript In Your Browser</h4>
</div>

<!-- Index -->
<div id="index"></div>

<!-- Background -->
<div id="background"></div>

<!-- text only view -->
<div id="textOnly"></div>

<!-- notes (content depends on the presentation, here there are 7 slides hence we have notes from n1-n7 (EXAMPLE))-->
<div id="notesContainer">
<div id="n1" class="notes">vnsdvjds;</div>
<div id="n2" class="notes">nsdknsd</div>
<div id="n3" class="notes">kdvsdk;</div>
<div id="n4" class="notes">dsdsods</div>
<div id="n5" class="notes">dvndskndsn</div>
<div id="n6" class="notes">dvxcm;zxczx;</div>
<div id="n7" class="notes">dvndsxmc .zxzxn</div>
</div>

<!-- TEMPLATE SPECIFIC ELEMENTS HERE (if any)-->


</body>
</html>

Project status

  • The project is accepted for the OpenOffice summer internship program 2010

Update History

Contains Log for the updates made to this wiki page

On 21/9/10

  • Under source code section updated presentation.js
  • Under source code section updated makefile.mk
  • Under source code section updated manifest.xml
  • Under source code section added file template.xcs
  • Under source code section added file template.xcu
  • Under source code section added file Template.hxx
  • Under source code section added file Template.cxx
  • Added downloads section
  • Updated .pdf Document

On 24/9/10

  • Under source code section updated Template.hxx
  • Under source code section updated Template.cxx
  • Under source code section updated htmlex.hxx

On 29/9/10

  • Under source code section updated Template.hxx
  • Under source code section updated Template.cxx
  • Under source code section updated htmlex.hxx
  • Under source code section updated makefile.mk
  • Under source code section updated templates.xcs
  • Under source code section updated templates.xcu
  • Updated project plan.
  • Under downloads added sample template extension
  • Under documentation added a new section "Template Extension Format"

On 13/10/10

  • Under source code section updated almost all files.
  • Updated project plan.

Developers

this extension is developed by Kushal Likhi under a very good guidance and mentoring by Christan Lippka