PivotMaker for Pivot by Live Labs

I’m working on making an API to read and write CXML file into a DOM. This will allow a programmer to use objects, properties and collections to build and manage Pivot collections. I’m using this to build a GUI application to make Pivot Collections. Here is an example using the API to open the CarCollection.CXML change the Name of item one and save to a new file.

Code Snippet
  1. PivotCollection collection = PivotCollection.CreateFromXML(@"D:dataMyCollectionCarCollection.cxml");
  2. collection.ItemLists[0].Items[0].Name = "This is a test";
  3. collection.WriteXml(@"D:dataGymManagerMyCollectionCarCollectionUpdate1.cxml");

Here is the before:

image

and the after:

image

There are ways to change the Facets of an item. To change the text of the Fuel facet for item 1 in list 1.

Code Snippet
  1. PivotCollection collection = PivotCollection.CreateFromXML(@"D:dataGymManagerMyCollectionCarCollection.cxml");
  2. collection.ItemLists[0].Items[0].Facets["Fuel"].Text[0].Value = "Water";
  3. collection.WriteXml(@"D:dataMyCollectionsCarCollectionUpdate2.cxml");

If you open the CXML file you will see the changes:

image

There are also APIs wrapped around the SeaDraggon assembly to help build the Image collection used by Pivot.

Code Snippet
  1. string sourceFolder = @"D:dataGymManagerGymRecordImage";
  2. string destinatinoFolder = @"D:dataGymManagerMyCollection";
  3.  
  4. ImageConverter.ConvertFiles(sourceFolder, destinatinoFolder);

The image convertor has a method to pass the various SeaDragon parameters if you whish to override the defaults.

Code Snippet
  1. /// <summary>
  2. /// Converts the files.
  3. /// </summary>
  4. /// <param name="sourceImages">The source images.</param>
  5. /// <param name="destinationFolder">The destination folder.</param>
  6. /// <param name="tileSize">Size of the tile.</param>
  7. /// <param name="imageQuality">The image quality.</param>
  8. /// <param name="imageFormat">The image format.</param>
  9. /// <param name="tileOverLap">The tile over lap.</param>
  10. /// <param name="recurse">if set to <c>true</c> [recurse].</param>
  11. /// <param name="smoothStreaming">if set to <c>true</c> [smooth streaming].</param>
  12. public static void ConvertFiles(IEnumerable<string> sourceImages, string destinationFolder, int tileSize, double imageQuality, ImageFormat imageFormat, int tileOverLap, bool recurse, bool smoothStreaming)

I’m also working on a Data Domain and a Collection Model that will  help facilitate building a GUI.

image

Here is the DOM for the XML

image

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s