Author Topic: Export template: HTML List (English + German)  (Read 188278 times)

0 Members and 1 Guest are viewing this topic.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Export template: HTML List (English + German)
« on: April 01, 2010, 03:18:03 pm »
I'd like to contribute an export template. It generates a HTML-list (an unordered list with some details) and is formatted via style sheets (HTML and CSS both stored in one file). The print styles differ from screen styles: different margins, smaller font, white background, black font color, font face is changed to "Calibri" (in screen view it's "Helvetica"). If either of them is not installed on your PC, the style switches to "Verdana" or to the standard sans-serif font selected in your browser.
The styles are W3C-compliant and should render fine with any modern browser, with older ones it might look crappy or even be unreadable. I tested them with Firefox 3.6 and IE 7 only.
Hope, someone will like it...

The first template is in English, the second one is in German.

----> You'll find the newest templates here
« Last Edit: September 06, 2014, 12:34:08 pm by svenne »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #1 on: April 01, 2010, 08:35:15 pm »
Thanks! It's nice that the print style is included. Just curious...Is it possible for that to print each movie on a separate page?

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #2 on: April 01, 2010, 11:47:05 pm »
Yes, print styles in general are a nice invention...  ;)
By the way, the print style already tells browsers to insert page-breaks only between list entries, so that a movie entry should not be split up over two pages if possible, but unfortunately only Opera implemented this CSS 2.0 standard feature till today.  ::)

But to print every movie on a new page is easy to achieve and works with most (up to date versions of) common browsers:
li.movie {page-break-after:always;}
should do the trick.
« Last Edit: April 15, 2014, 04:38:44 pm by svenne »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #3 on: April 02, 2010, 12:02:43 am »
Perfect! You're now our official HTML exportmeister. Congrats. ;)

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #4 on: April 02, 2010, 12:24:38 am »
Great!!   :) So, there are some things I need for my new working position, here's my wishlist...  ;) ok, only one wish to start with: I would really like to be able to export the film duration in seconds. Other apps I tested or worked with for some while want to have the duration in seconds for CSV-fileimport. It is always nice to know that you have the possibility to switch back to your old application. It makes it so much easier (emotionally ;) ) to give Personal Video Database a try...

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #5 on: April 02, 2010, 03:10:01 am »
Quote
I would really like to be able to export the film duration in seconds.

As I indicated here, this is unlikely possible. Maybe just as well...it saves me from explaining your position has no perks and is largely thankless. And you're not allowed to resign without a 2/3 majority of the membership. 8)

Although I'm not sure what they want or why, I'm hoping you might come up with a set of templates that would satisfy the somewhat regular request for some sort of print facility. ;)

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #6 on: April 02, 2010, 12:55:39 pm »
Every value that can be exported can be formatted for printing with HTML and CSS. The result would only be limited by the printing capabilities of the browser. Within the CSS you can even assign fixed font sizes in "pt" (point), just as it is done in Word, for example.

There is another possibility that might work out even better: I could try to write export templates for rich text files (.rtf). Did something similar few years ago.

Rich text is some kind of markup language, just like HTML, but more cryptic. Though the file format once was introduced by Microsoft, it's been there for decades now and every word processor I came across would open RTF-files with ease. It's not limited to Windows systems. The format is common to Mac- and Linux-applications, too. So anyone could open their exported movie details, movie lists, or whatever, with their standard word processor. RTF-files are already assigned to the standard word processor in most cases by default, so (double)click the RTF-file and it shows up. Then you can apply some changes to the content if you want to and just print it.

buah

  • Guest
Re: Export template: HTML List (English + German)
« Reply #7 on: April 02, 2010, 03:07:11 pm »
Really nice work svenne! I'm wondering could it be possible to make HTML export to looks just like PVD classic skin (with left and right frame)?

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #8 on: April 03, 2010, 07:05:53 am »
Quote
I could try to write export templates for rich text files

That's an interesting idea, but can those also be displayed in a browser? Some users want that (for a variety of reasons), while others want something they can print. It would be nice to kill two birds with one stone.

Quote
I'm wondering could it be possible to make HTML export to looks just like PVD classic skin (with left and right frame)?

I was wondering the same thing. It seems a logical place to start—a template that at least includes all the standard fields laid-out in a manner similar to the default skin. I wouldn't expect it to look exactly the same or that it would be the best presentation, but it may be a necessary lowest common denominator. It would be complete, familiar, and would serve as a good starting point for those who want to modify it.

It would also be nice to have something similar to the existing Index & Movies template. That is, a linked table of contents or index to the movies included in the report. If that were a one-movie-per-line listing, it might serve as a stand-alone listing as well as an index.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #9 on: April 07, 2010, 02:59:03 am »
No, RTF cannot be displayed in a browser. We can stick just to HTML and CSS and first see what's possible, that makes sense.

Ok, frames...
At the moment templates don't allow saving the additional HTML-file containing the frameset, do they?
For frames you'd have to save this file + the movie list + the movie detail pages. But I could do something similar using iframes (inner frames), or I'd better say, I already did that.  ;)
Iframes are not so very different from frames, they are standard HTML since HTML 4.0 and supported by all modern browsers, as far as I know.
I didn't include all possible fields, but I could add more to the template in near future.

There are four attachments. The first two are just updated versions of "HTML List" (the templates are now replacing <, > and & with proper HTML codes). The last two are those with iframes, just try them and you will see what they do...

(see latest post of mine in this thread for attachments!!)
« Last Edit: April 07, 2010, 03:35:02 pm by svenne »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #10 on: April 07, 2010, 05:07:44 am »
Very nice! 8)

Understandably, only the selected movie in HTML Frames can be printed. Is there any way all of the movies could be printed at once?

Hyperlinks (i.e., those created by PVD's hyperlink function) are displayed as code. Can these be handled so they show their display text? And can those that are URL links be translated into HTML hyperlinks?

mgpw4me@yahoo.com

  • Guest
Re: Export template: HTML List (English + German)
« Reply #11 on: April 07, 2010, 09:14:43 am »
Very cool  8)

As usual, (you'll have to excuse me) I have some suggestions  ;D

Exporting the movie data to JavaScript arrays would allow you to do regional character transformations, sorts and create views.  A few javascript links to populate the list to create views (people, movie, genre, etc.) and I'd buy it !!  ...and Rick.ca would only be a couple of JS lines away from his long-awaited 'people of interest' template.


Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #12 on: April 07, 2010, 03:33:36 pm »
Topic: links...
First of all I changed the templates to replace the pvd link codes to some kind of silent but W3C conform HTML code (span class='pvdlink' title='[linktype and reference]'...) using a chain(!) of "replace" statements. Funny (and very useful, of course...) that it works this way...
I will use javascript to "reactivate" all pvd links based on movie IDs and URLs later, that's all I can do. The export functionality for templates is limited and there is no direct access to the database contents. For pvd link types "title", "name", "original title", "genre", "country", and so on, the templates can't fetch information to which HTML subpage(s) the exported links should point, or can they?
I wasn't aware myself, but by the way: per default PVD exports all internal link codes as is. That means they show up in the exported HTML source as <link contry="Loompaland">...</link> and so on. You don't see the code when exporting via "Web Pages(IndexMovies)", because they can't be interpreted by the browser and are kindly omitted. But they are there. Nasty, nasty links! They break HTML specifications... The HTML <link>-tag is not allowed within the <body>-tag. That might become problematic, if the W3C or some browser developer considers <link> within the <body> tag to do something, that shurely would differ from its beviour within PVD. Furthermore, the HTML attributes "id", "name" and "title" already have purposes that have nothing to do with their function within PVD. This can lead to very unexpected behaviour in some cases, especially when export templates become more complex, containing CSS and javascript functionality relying on IDs, for instance.
The templates I wrote just replaced "<" or ">" with "&lt;" and "&gt;" to prevent these characters (whenever they appear in floating text) to be misinterpreted as HTML tags, hence all the link codes became visible... Oops!  :)

Topic: printing...
To print all movies at once you'll need a template that exports all the data (you want to print) into a single file. Of course you could add some javasript to the iframe template that gathers all the information by following all links to the subpages, then inserts all of it into the current page and then calls the browser's print dialog, but that's complicated and not reliable. Javascript would need to have access to the different HTML files and depending on security settings and browser behavior this is impossible in some or even most cases.

Topic: javascript functionality...
Regional characters: There should be no problem with regional characters right now since almost every exotic character can be displayed: within the HTML pages the charset is declared as utf-8. Are there some special characters displayed incorrectly after export? Then please tell me more details about that. Or perhaps I didn't understand your suggestion?
Sorting: You can sort the list in PVD and then export it. The sort order will be the same in the exported file. Of course it would be nice to have all the major functionality of PVD in the exported HTML, too. But with all the data that would have to be stored in the HTML file and all the necessary restructuring of HTML content via javascript that follows, it would be easier to have a MySQL-Database with some PHP as frontend. Or a Firebird database... um...
We already have that, or kind of, I'd say even something better, and it is freeware, too! Thanks to Nostra!  ;)
I don't want to mock your suggestions, of course, they are quite neat. But it would be a lot of work to recode the functions of PVD and even internal functions of Firebird to achieve all this funtionality. Let's face it, we've got an export template here, not another fully functional front end to the database. To write something to access a PVD database through the internet with enhanced fuctionality, that is a different task, I guess. But being able to re-sort the movie list in different ways within the HTML file is a cool idea nevertheless, so I probably will spend a lot of spare time and add that... some day...  ;)
By the way (see Nostras post here), the sorting problems of PVD will shurely be addressed sooner or later, though it seems to be a little bit tricky...

The new templates are attached:
« Last Edit: April 08, 2010, 02:04:48 am by svenne »

mgpw4me@yahoo.com

  • Guest
Re: Export template: HTML List (English + German)
« Reply #13 on: April 07, 2010, 04:24:59 pm »
No takers, huh?  Oh well, I'll have to write Rick's POI code myself <grin>...maybe soon.

The export works perfectly fine.  If sorting was to be done, then translations would be desirable...and simple...if you only have to deal with a single locale (and locale isn't Kanji).  I have all the people names in my database translated to English characters in the 'transname' field.

Before PVD, I used JavaScript as described to keep my data.  One line of characters (0-Z) for each of title, actor, genre populating the list from lookup tables.  The results were displayed from a second file that was specialized for the title or actor using numeric parameters and loading smaller, more detailed script arrays.
« Last Edit: April 07, 2010, 05:12:22 pm by mgpw4me@yahoo.com »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export template: HTML List (English + German)
« Reply #14 on: April 07, 2010, 07:28:07 pm »
Wow, svenne, really great work!

Be sure to see your templates in the standard installation package of 0.9.9.20 ;)
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #15 on: April 07, 2010, 10:35:27 pm »
...and Rick.ca would only be a couple of JS lines away from his long-awaited 'people of interest' template.

It must be long awaited—I can't remember what it is! ???

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #16 on: April 07, 2010, 11:35:40 pm »
Quote
I will use javascript to "reactivate" all pvd links based on movie IDs and URLs later, that's all I can do.

I wasn't expecting more, and even this isn't essential. It now looks okay.

BTW, I appreciate you taking the time to explain all this, as well as coding the templates. While I don't understand fully, it helps me understand what's feasible. And begging others to do what I already know is feasible is always more effective. ;D

And I agree the object here is not to replace PVD with some kind of Java-Web contraption. It's to find ways to extend the functionality of the program. And in doing so, if nostra is relieved of the burden of providing the same function within the program, so much the better. Printing may be a good example of this. I've always wondered what users expect when they ask for a "printing feature." A full-blown report generator would be overkill and beyond the capability of most users. A non-configurable solution would be of limited use. And it's hard to imagine what half-measures might work. So printing using templates like these seems like a good solution.

While I like the HTML Frames template, I wonder what you think of my original idea of a separate list (one movie per line) linked to a detailed report. My thought was, being separate, the list could provide the means to print a simple list of the selected movies, while the detailed report would provide the means to print the details (with each movie starting on a new page). In other words, the details would all be in one page, with the links from the list being to anchors. It wouldn't be as slick as what you've done for browsing purposes, but maybe it would be a way of displaying the same information while also providing the means to print two different reports. Being in one template also makes it easier to use and maintain.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #17 on: April 08, 2010, 02:47:56 am »
Nice to hear these templates will find their way into the standard installation package!  :)

I could write a template for a seperate movie list linking to detailed reports (plural!). In fact I just would have to modify the existing iframe template a little bit (and throw out the iframe). A list linked to a single detailed report file is not possible, sorry. Templates allow two ways of data export: either one single list (that can be split into some smaller portions with a maximum number of movies per page) or: a list linking to several subpages each containig the data for one movie.
For printing purposes I could extend the single list template adding some more standard fields and the poster images. JavaScript can be used to show or hide details for a selected movie or for all of the movies at once. Hence you would be able to print the index (without page breaks between each entry, of course) or all the movie entries with all the details visible (with each movie starting on a new page when printed).
That should become a third template called "Detailed HTML List", because I really like the simpler one, too. It's compact and nice to send per eMail. Including the poster-images in the detailed list will blow up the summed file size of the exported data quite a lot!

So, for the new versions of the iframes and list templates I added some JavaScript to revive the ID-links and URL-links. Of course, whenever you export only a portion of your database, the id-links pointing to movies that were NOT exported will then point to files that do not exist, that means they will be broken. No way to avoid that. But I think that won't be too annoying. At least I can live with it... ;)
« Last Edit: April 08, 2010, 04:09:58 pm by svenne »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #18 on: April 08, 2010, 07:45:58 am »
Quote
Of course, whenever you export only a portion of your database, the id-links pointing to movies that were NOT exported will then point to files that do not exist, that means they will be broken.

I don't think anyone will have a problem with that. But since you're inclined to think about such things... URL links can be to local files, and these don't require a protocol to work in PVD. Is it possible to detect these and add the "file://" prefix they would require to work in a browser?

Quote
A list linked to a single detailed report file is not possible, sorry.

Then I suppose the next best thing would be a pair of templates that would be run at the same time (i.e., with the same file selection). One would print as a simple list that could be used as an index or table of contents. The other would print the details with each movie starting on a new page.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #19 on: April 08, 2010, 04:23:58 pm »
Yes, I understand what you'd like to have for printing purposes. I will see what I can do.

New versions of the templates...
I modified the javascript part. Links to local files should work now.
« Last Edit: April 09, 2010, 02:21:51 am by svenne »