XmlProvider

By default, PortfolioEngine.Net uses the XmlProvider, which means that all portfolio details are stored in xml files.

Overview

A portfolio is basically a group of projects. In this case, a portfolio is simply a directory containing the projects (which are directories themselves). The project data is stored in xml files. The layout is straightforward:
  • Portfolio dir
    • defaults.xml
    • Project1
      • project.xml
      • optional_file.xml
    • Project2
      • project.xml
      • optional_file.xml
    • ...
The portfolio directory is by default "~/App_Data/portfolio" but this can be changed. See WebClient Settings.

Portfolio Options

Every portfolio can have some default options: default theme and default language. These are used if the projects themselves don't have a theme or a language set.
You can set them in the file "defaults.xml" in the portfolio directory. Having default potions for a portfolio is recommended, but not required.

Usage
<portfolio theme="default" language="en-US" />	

Attributes
theme - Default theme for all the projects in the portfolio. Optional.
language - Default language (valid culture string) for all the projects in the portfolio. Optional.

Project Data

Each project MUST have at least the project.xml file. Usually you can write all the project data in this file, however some elements such as <images>, <files > or <highlights> are easier to manage if stored in a different file.
This is for convenience only, but be aware that if you choose to define an element in its own file, you can't define it in the project.xml and vice-versa.

Example
If have lots of screenshots, you can write have the <images> section in its own screenshots.xml (the name is not important, the extension is) like this:
<?xml version="1.0" encoding="utf-8" ?>
<images>
	<image src="http://example.com/image.jpg">
		<title>
			<content>Remote Image</content>
		</title>
		<description>
			<content>A remote image</content>
			<content language="fr">Une image à distance</content>
		</description>
	</image>	
</images>

Static Resources

Static resources are images, archives etc related to the project. They should be stored in the "~/Assets/project" directory. When defining them in xml, you just write the name of the file, the engine will know where to find it.

Last edited Jan 19, 2011 at 6:58 AM by mike_sapiens, version 17

Comments

No comments yet.