INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MC XML Export 0.1.0 beta  (Read 7906 times)

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
MC XML Export 0.1.0 beta
« on: October 30, 2003, 09:03:07 am »

Here's my first attempt at making it easier to export your library to XML.

MC XML Export lets you create an XML compliant document that conforms to the MPL schema, so you can use Scott Raymond's super-cool XSLT. What makes it better than the built in XML exporter is that you can choose which fields you want to export, including calculated fields, and you can add your own custom fields. It will even put in a link to an XSLT if you so wish. And it even remembers all your settings for next time.

Note: This is the first beta release of MC XML Export, so it's bound to not work on anyone's system at all, which wouldn't surprise me, but you can give it a go.

You'll need the Microsoft .NET Framework installed to run this plugin. You can grab that if you havent already (check your Add/Remove Programs list for "Microsoft .NET Framework") from the Windows Update site.

Here's a screenshot to see what you're in for:
http://homepages.paradise.net.nz/~scottray/mcxml/xmlexportshot.jpg

Download MC XML Export v0.1.0beta
http://homepages.paradise.net.nz/~scottray/mcxml/MCXMLExport.msi

Have fun,

Scott Raynel.
Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:MC XML Export 0.1.0 beta
« Reply #1 on: October 30, 2003, 09:15:17 am »

And the $64,000 question is what SDK function did you use to get the list of database fields?
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #2 on: October 30, 2003, 09:16:50 am »

And the cheap answer is... they're all hard coded... man that took a long time to do ;)

Scott.
Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:MC XML Export 0.1.0 beta
« Reply #3 on: October 30, 2003, 09:24:35 am »

I bet it did  ;D
Logged

nila

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #4 on: October 30, 2003, 10:21:09 am »

I'd have doubled Rhino's offer to get that answer!!

That's the main killer problem - dont forget though - people manually create enteries and they want to be able to export those too :)
Logged

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re:MC XML Export 0.1.0 beta
« Reply #5 on: October 30, 2003, 12:11:44 pm »

Quote
ou'll need the Microsoft .NET Framework installed to run this plugin. You can grab that if you havent already (check your Add/Remove Programs list for "Microsoft .NET Framework") from the Windows Update site.

is there any chance of not installing .NET anything ?

why is .NET reqd at all ?
Logged

NoCodeUK

  • Citizen of the Universe
  • *****
  • Posts: 1820
Re:MC XML Export 0.1.0 beta
« Reply #6 on: October 30, 2003, 01:32:17 pm »

.NET is required because the program was written using Visual Studio.Net and therefore requires that runtime...not really any different to installing the VB runtimes for old VB6 programs...
Logged
"It's called No Code because it's full of code. It's misinformation." - Eddie Vedder

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:MC XML Export 0.1.0 beta
« Reply #7 on: October 30, 2003, 01:44:23 pm »

.NET is required because the program was written using Visual Studio.Net and therefore requires that runtime...not really any different to installing the VB runtimes for old VB6 programs...

With the exception of the size.
Logged

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #8 on: October 30, 2003, 02:01:54 pm »

Couple of points (questions)

Unless your plugin can actually work out what fields are in MC then u should allow people to add aditional fields so they can add fields they've created in MC themselves.


Also - could this be extended to just allow us to use it for exporting to a text file where we can specify the delimiter?

What'd be GREAT would be if you could set it up to Export to SQL too
(just output each file as:

INSERT INTO [give us a table name input] (list all the field names seperated by comma's) VALUES (all field values - properly escaped);
)

ie. Make it an Output plugin rather than just an XML output.

Nila,

I think the most flexible way of approaching what you're talking about it to just use an XSLT to transform the MPL into any other "format".  This is, after all, one of the prime "powers" of XML.  Why "lock yourself" into a specific plugin format (other than XML!)?

I'm passingly familiar with SQL - but if you have an actual example (that works, of course), I'll write you an XSLT that converts the result of Scott.'s export to a text file.

The same idea applies to converting the MPL into a text delimited file - why do it in the plugin when you can just apply an XSLT that does it for you?

Scott.:  Perhaps you'd consider adding a function to your plugin that lets the user apply an XSLT and save the resultant file as a text document.  So there'd be two options:  1)  Add an XSLT style-sheet reference to the export and open the XML in Explorer (which you've already done!) and 2) Choose an XSLT, transofrm the XML with it, and save the result as a text document.

I don't imagine it'd be too hard to code the plugin to apply the transformation....  you can see how easy it was in JavaScript by looking at XAlbum.htm.

Scott-

P.S.  You're plugin works great for me - though it's pointed out a problem I had with xsl:key's and empty fields.  I also think I've made a mistake in the multi-level grouping when two different albums have the same name (but different artist, of course!)
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #9 on: October 30, 2003, 06:16:18 pm »

is there any chance of not installing .NET anything ?

why is .NET reqd at all ?

I decided to use .NET as opposed to VB6 because it has built in support for reading and writing XML files. This way I can be assured that the XML documents that MC XML Export creates are well-formed and conform to standards.

Like NoCode said,  it's just like installing VB6 runtimes. You can grab a ~20MB redistributable installer from http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3&displaylang=en

Scott.
Logged

NoCodeUK

  • Citizen of the Universe
  • *****
  • Posts: 1820
Re:MC XML Export 0.1.0 beta
« Reply #10 on: October 30, 2003, 06:28:03 pm »

Thank you for this Scott...Its amazing.  Just what me and t'other Scott have been harping on about for so long ;D

Adam
Logged
"It's called No Code because it's full of code. It's misinformation." - Eddie Vedder

JoshuaHorowitz

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 56
  • nothing more to say... other than that MC rocks!
Re:MC XML Export 0.1.0 beta
« Reply #11 on: October 30, 2003, 07:29:39 pm »

Awesome work! It works perfectly, and I'm sure I'll have fun XSLTing stuff around. Several very minor cosmetic things though. First, the list of playlists seems to be completely unordered. It's actually kind of funny. Second, when the "Include link to XSL stylesheet:" checkbox is deactivated, the cooresponding textbox should be disabled.

;D. Brilliant.
Logged

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #12 on: October 30, 2003, 11:55:12 pm »

Scott.,

This might be more work than it's worth, but I have a suggestion:

Could you allow an export based on a View Scheme - both columns displayed (choosing the field) and items in the VS?  I have no idea if the SDK allows this, but it could also be a way of getting at custom fields.

Scott-
Logged

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re:MC XML Export 0.1.0 beta
« Reply #13 on: October 31, 2003, 02:32:58 am »

Quote
Like NoCode said,  it's just like installing VB6 runtimes. You can grab a ~20MB ......

yikes...20MB ?!?

we there no other free 3rd party libs ( besidis .NET) you could use for this XML stuff.

Idea being once you compiled everything, only a tiny dll would need to be provided.

Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #14 on: October 31, 2003, 03:57:37 am »

yikes...20MB ?!?
we there no other free 3rd party libs ( besidis .NET) you could use for this XML stuff.
Idea being once you compiled everything, only a tiny dll would need to be provided.
Yeah, I know a 20MB download isn't everyone's cup of tea, especially just to run a simple MC plugin, but it really came down to the fact that VS.NET is the only development environment that I own, so unless I want to make the plugins illegally, .NET's the only way to go. Besides, eventually you'll find something else that needs the .NET framework and once it's installed you never need to worry again, so, well, yeah. I havent got anything else, sorry.

Quote
Several very minor cosmetic things though. First, the list of playlists seems to be completely unordered. It's actually kind of funny. Second, when the "Include link to XSL stylesheet:" checkbox is deactivated, the cooresponding textbox should be disabled.
The listbox is populated in the order that the SDK returns the list of playlists. I have no idea how it's ordered. I might just alphabetise it, or should I leave it how it is? I couldn't decide so I left it as it was. What do you think?

Quote
Could you allow an export based on a View Scheme...
Not quite sure I follow you, could you elaborate?



Scott.
Logged

NoCodeUK

  • Citizen of the Universe
  • *****
  • Posts: 1820
Re:MC XML Export 0.1.0 beta
« Reply #15 on: October 31, 2003, 04:47:03 am »

Scott just one thing I noticed.  In the field list you have BMP...shouldn't this be BPM?

Adam
Logged
"It's called No Code because it's full of code. It's misinformation." - Eddie Vedder

Foxus

  • Regular Member
  • Member
  • *
  • Posts: 3
  • nothing more to say...
Re:MC XML Export 0.1.0 beta
« Reply #16 on: October 31, 2003, 05:42:09 am »

Hi, all

Been following this thread with some interest,  would just like to say that I`ve been using this XML COM component for a while in VB6 and its pretty good, and more importantly free.

http://www.chilkatsoft.com/ChilkatXml.asp.

Althought I doubt scott will want to be re-writing .net code to VB6..

Cheers

Paul

Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #17 on: October 31, 2003, 06:02:17 am »

Thanks for the tip, Paul.
That ChilkatXML software looks pretty cool. After a quick look though, I can't find anything to do with XSL transformations, which is ultimately what the plugin will be applying. Also, not having a copy of VB6 doesn't help either.

But thanks anyway, I'm sure it will come in useful for all the VB6 programmers out there :)

Scott.
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #18 on: October 31, 2003, 06:11:44 am »

Scott just one thing I noticed.  In the field list you have BMP...shouldn't this be BPM?

Adam

You're very right :)
Just remove that field and add the correctly spelled one. In the next version it will be fixed.
Thanks,

Scott.
Logged

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re:MC XML Export 0.1.0 beta
« Reply #19 on: October 31, 2003, 07:20:58 am »

Quote
eah, I know a 20MB download isn't everyone's cup of tea, especially just to run a simple MC plugin, but it really came down to the fact that VS.NET is the only development environment that I own, so unless I want to make the plugins illegally, .NET's the only way to go. .

Maybe if u explain what elements of .NET you need to do this plugin, andy the language you are using. You never know some one might be able to suggest an appropriate alternative.

- another approach would be is it possible to include in a dll in the install what .NET functions are used. or is this not possible at all ?
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #20 on: October 31, 2003, 08:38:23 am »

Quote
eah, I know a 20MB download isn't everyone's cup of tea, especially just to run a simple MC plugin, but it really came down to the fact that VS.NET is the only development environment that I own, so unless I want to make the plugins illegally, .NET's the only way to go. .

Maybe if u explain what elements of .NET you need to do this plugin, andy the language you are using. You never know some one might be able to suggest an appropriate alternative.

- another approach would be is it possible to include in a dll in the install what .NET functions are used. or is this not possible at all ?
MC XML Export is coded entirely in Visual Basic .NET. I'm not just using the XML part of the framework, but the entire thing, like IO streams, etc. The only way to distribute the framework is as a whole via the official Microsoft re-distributable. There's no way around downloading the re-distributable without either a) getting it on cd with a program you've paid for that uses .NET or b) re-writing in a different language.
It's not possible to include single dll's for .net in any install. For example, if a game you've got needs DirectX, you can't just grab the Direct3D file and hope it works. The entire thing has to be installed.
Sorry, but it's .net or .nothing

Scott.
Logged

LonWar

  • Citizen of the Universe
  • *****
  • Posts: 2874
Re:MC XML Export 0.1.0 beta
« Reply #21 on: October 31, 2003, 10:00:41 am »

I save the xml file and my web browser opens and displays:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

The system cannot locate the resource specified. Error processing resource 'file:///C:/Documents and Settings/qzl850/Desktop/AlbumGroup.xsl'.
 
Logged
-

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #22 on: October 31, 2003, 10:52:27 am »

The system cannot locate the resource specified. Error processing resource 'file:///C:/Documents and Settings/qzl850/Desktop/AlbumGroup.xsl'.

Looks like you have the XML and the XSLT in different folders.  If you're saving the Export to your desktop, make sure the XSLT is on the desktop as well.

Scott-
Logged

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #23 on: October 31, 2003, 11:02:20 am »


Quote
Could you allow an export based on a View Scheme...

Not quite sure I follow you, could you elaborate?

The View Scheme (VS) selected from the Media Library has a customizable set of columns and file restrictions.  If you could create a right-click or hotkey entry that lets the user select a VS and begin the export - using the columns in the VS and the media files in the VS - there would be an easy way of customizing the output of the Export.  As it stands, I need to manually select the columns desired.  Yeah - I could always export all the fields, but with a large document there is a *much* greater burden on the XSLT processor.

Of course, who knows if it's even possible to tie into MC's menus?  If not, here's another idea:

Is it possible to use configuration documents (XML, of course!) that holds information about fields to export, what XSLT to apply, and what action to take (render in browser or save to a file)?  Sort of like pre-defined options.  There might be one for XAlbum, one for SQLInserts, one for AccessImport, etc., etc.

Scott-
Logged

LonWar

  • Citizen of the Universe
  • *****
  • Posts: 2874
Re:MC XML Export 0.1.0 beta
« Reply #24 on: October 31, 2003, 11:29:56 am »

The system cannot locate the resource specified. Error processing resource 'file:///C:/Documents and Settings/qzl850/Desktop/AlbumGroup.xsl'.

Looks like you have the XML and the XSLT in different folders.  If you're saving the Export to your desktop, make sure the XSLT is on the desktop as well.

Scott-

Ok, All of what you said was foreighn...

Were should I be saving the file to?
Logged
-

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #25 on: October 31, 2003, 12:37:55 pm »

Quote
Ok, All of what you said was foreighn...

Were should I be saving the file to?

Save the Exported XML document to the same place where the XSLT document is located.

You do have the XSLT (AlbumGroup.xsl), don't you?  If not, it's listed in the thread http://yabb.jriver.com/interact/index.php?board=5;action=display;threadid=16293 - make sure you get the latest version (which is currently available at http://pages.sbcglobal.net/scottraymond/XAlbum060.zip.  Notice that the name of the XSLT has changed.

If you unzip the XAlbum060.zip file to a directory XYZ, set MCXMLExport to save the export to directory XYZ and enter AlbumGroupIE6.xsl for the transform.

Scott-
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #26 on: October 31, 2003, 09:39:26 pm »


Quote
Could you allow an export based on a View Scheme...

Not quite sure I follow you, could you elaborate?

The View Scheme (VS) selected from the Media Library has a customizable set of columns and file restrictions.  If you could create a right-click or hotkey entry that lets the user select a VS and begin the export - using the columns in the VS and the media files in the VS - there would be an easy way of customizing the output of the Export.  As it stands, I need to manually select the columns desired.  Yeah - I could always export all the fields, but with a large document there is a *much* greater burden on the XSLT processor.

Of course, who knows if it's even possible to tie into MC's menus?  If not, here's another idea:

Is it possible to use configuration documents (XML, of course!) that holds information about fields to export, what XSLT to apply, and what action to take (render in browser or save to a file)?  Sort of like pre-defined options.  There might be one for XAlbum, one for SQLInserts, one for AccessImport, etc., etc.

Scott-

I got you now. As it stands, I can't tie into MC's menus or interface, which is a shame. I can access the view schemes, but I'm not sure if I can access the columns that are displayed, only the files that come into the view scheme, but I'll have a look. It certainly would make things easier. I've nearly got the XSL transform happening, so I'll keep you posted.

Cheers,

Scott.
Logged

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #27 on: November 01, 2003, 12:28:05 pm »

Quote
I got you now. As it stands, I can't tie into MC's menus or interface, which is a shame. I can access the view schemes, but I'm not sure if I can access the columns that are displayed, only the files that come into the view scheme, but I'll have a look. It certainly would make things easier. I've nearly got the XSL transform happening, so I'll keep you posted.

What do you think about preconfiguration documents to store the settings?

Scott-
Logged

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #28 on: November 01, 2003, 10:15:49 pm »

Quote
What do you think about preconfiguration documents to store the settings?

Something like:

Code: [Select]
<MCXMLExportSettings>

   <Configuration name="AlbumGroup">
      <ExportFilename>c:\export\export.xml</ExportFilename>
      <ExportMediaItems type="Playlist">All Music</ExportMediaItems>
      <FieldsToExport>
         <Field>Name</Field>
         <Field>Artist</Field>
         <Field>Album</Field>
         <Field>Custom1</Field>
      </FieldsToExport>
      <XSLTToApply mode="AddAsProcessingInstruction">AlbumGroup.xsl</XSLTToApply>
      <LaunchFilename>c:\export\export.xml</LaunchFilename>

   <Configuration name="XAlbum">
      <ExportFilename>c:\export\export.xml</ExportFilename>
      <ExportMediaItems type="Playlist">All Music</ExportMediaItems>
      <FieldsToExport>
         <Field>Name</Field>
         <Field>Artist</Field>
         <Field>Album</Field>
         <Field>Custom1</Field>
      </FieldsToExport>
      <LaunchFilename>c:\export\XAlbum.htm</LaunchFilename>

   <Configuration name="AccessImport">
      <ExportFilename>c:\export\export.xml</ExportFilename>
      <ExportMediaItems type="View Scheme">Audio</ExportMediaItems>
      <FieldsToExport>
         <Field>Name</Field>
         <Field>Artist</Field>
         <Field>Album</Field>
         <Field>Custom1</Field>
      </FieldsToExport>
      <XSLTToApplyFilename mode="TransformXML" saveTransformedAsFilename="c:\export\access.xml">AccessImport.xsl</XSLTToApplyFilename>

</MCXMLExportSettings>

off the top of my head.

Scott-
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #29 on: November 02, 2003, 01:29:30 am »

That looks pretty cool - once I've got XSLT working I'll start on implementing something like that.
I've got a busy week ahead of me at Uni, so I probably won't be able to do much in the next few days, but we'll see.

Scott.
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #30 on: November 03, 2003, 05:55:36 am »

News Flash!!

The next beta of MC XML Export is just around the corner, so here's a special preview!

http://homepages.paradise.net.nz/~scottray/mcxml/mcxmlb2preview.jpg

By the way, it turns out that the .NET 1.0 framework has some problems with XSLT processing on large files (like the one's we're working with). If you haven't got it installed yet, download the .NET 1.1 framework so XSLT processing works in the new version. To see what version you're running, go to your Add/Remove Programs list. You can get 1.1 from either Windows Update or directly from the Microsoft Website:
http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3&displaylang=en

Have a good one,

Scott.
Logged

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #31 on: November 03, 2003, 09:52:41 am »

Scott.,

The screenshot looks awesome!

Scott-

P.S.  What degree are you working towards?
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:MC XML Export 0.1.0 beta
« Reply #32 on: November 03, 2003, 06:14:36 pm »

Cheers,

I'm working towards a Bachelor of Computing and Mathematical Sciences, majoring in Software Engineering. I'm just finishing my second year now.

MC XML Export Beta 2 is now available in the thread:
http://yabb.jriver.com/interact/index.php?board=5;action=display;threadid=16536


Scott.
Logged

sraymond

  • Guest
Re:MC XML Export 0.1.0 beta
« Reply #33 on: November 03, 2003, 07:16:37 pm »

Quote
I'm working towards a Bachelor of Computing and Mathematical Sciences, majoring in Software Engineering. I'm just finishing my second year now.

Interesting...  Software Engineering seems to be a field with lots of promise.  Things are sure done differently today than when Gates and Company developed WinWord.

Scott-
Logged
Pages: [1]   Go Up