GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 
XML Calendar


https://support.genopro.com/Topic18713.aspx
Print Topic | Close Window

By beraha - Tuesday, July 31, 2007
Is there any way to take the XML file which was created by Genopro and to put some of the data in a PHP or Javascript calendar?

I want to add a monthly calendar to my website and to dispaly all birthday dates which is taken from the Genopro XML file.

By maru-san - Tuesday, July 31, 2007
http://support.genopro.com/Topic12836-58-1.aspx#bm12936

Above was an answer from GenoPro some time ago.
May be you can find something suitable on the net, Ron can work on and implement into the report.
By beraha - Tuesday, July 31, 2007
maru-san (7/31/2007)

May be you can find something suitable on the net, Ron can work on and implement into the report.

I've found a nice free PHP calendar at:

http://www.bmgadg.com/ajax_calendar.php

But I don't know if it's possible to integrate the data From the Genopro XML database.

Maybe Ron can do something with that on His Report generator.

By genome - Wednesday, August 1, 2007
Personally I would steer away from PHP based scripts as not all web servers have this facility. I did find an alternative javascript-only free event calendar here that is very simple to use and should be quite straight forward to generate the DefineEvent/AddEvent scripts required using the Report Generator. The timeline scripts already extract the information on events. There would be just a small amount of code to filter bith dates and wedding anniversaries of living individuals and change the year and output a separate file.

I wonder if this should be a free-standing Report or should it be integrated into the existing Narrative Report?

For example you could install the event calendar script on your own web page and just use a separate Report Generator skin to refresh the event data for the calendar, as and when required.

I am happy to tackle this either way, although it will be a week or two before I have some time to delve further.

By maru-san - Wednesday, August 1, 2007
Ron (8/1/2007)

I wonder if this should be a free-standing Report or should it be integrated into the existing Narrative Report?

Of course there are many ways to display and use such calendar.
One way could be the use of a calendar icon in the heading frame, show then the calendar in the popup frame and hyperlink shown individuals in the calendar to the detail frame.
You then have an overview who else in that month has an anniversary event.
Just an idea.
By beraha - Wednesday, August 1, 2007
Ron (8/1/2007)
I wonder if this should be a free-standing Report or should it be integrated into the existing Narrative Report?

For example you could install the event calendar script on your own web page and just use a separate Report Generator skin to refresh the event data for the calendar, as and when required.

I am happy to tackle this either way, although it will be a week or two before I have some time to delve further.

 

I prefer a stand-alone skin to generate an html code which will display the calender, so I'll be able to put this calendar on the root page of my website.

If it's not a problem, maybe a solution is to make it possible on both ways: A stand alone skin and also a calendar-script integrated on the current report.

 

By maru-san - Wednesday, August 1, 2007
Attached is a layout sample with calendar icon next to the timeline icon and a full month in the popup frame shown.

The link goes to a test, showing the calendar in the detail frame:
http://familytrees.genopro.com/maru-san/

Have transferred the calendar function to above site.
By beraha - Thursday, August 2, 2007
maru-san (8/1/2007)
Attached is a layout sample with calendar icon next to the timeline icon and a full month in the popup frame shown.

The link goes to a test, showing the calendar in the detail frame:
http://familytrees.genopro.com/maru-san/wam/

Hi Maru-San

What a beautiful implementation of the calendar feature.

Well done Smile

How can I add such a calendar into my report?

Is it possible also to generate another  "stand-alone" calendar to put on the root-page of the site (a page which is external to the genopro report)? I understand that in this method the Links to the "individual pages" might not work, and it would be a "Static" Calendar, but it could be nice too.

Thanks

Kobi

By maru-san - Friday, August 3, 2007
beraha (8/3/2007)
Hi Maru-San
What a beautiful implementation of the calendar feature.
Well done Smile
How can I add such a calendar into my report?

Is it possible also to generate another "stand-alone" calendar to put on the root-page of the site (a page which is external to the genopro report)? I understand that in this method the Links to the "individual pages" might not work, and it would be a "Static" Calendar, but it could be nice too.
Thanks
Kobi


Kobi, thanks for your nice comment.
I found on the website Ron recommended a zip file for download and tried my hands on this.
A stand-alone version is possible. There are also instructions on how to make the event list (birthday, wedding days,etc). But since I prefer the integrated version I made the icon, put this into the heading.htm (target=detail frame) and made an event list (sample files are available) from the table content(copy>paste>safe as and modified). But this is as far as I will do it. I hope Ron will find his time to put his professional touch to the coding of this calendar (i.e.images are not necessary).
For my own curiosity I might look further into this, that`s all.
By genome - Friday, August 3, 2007
I have started coding the necessary changes to the Narrative report and I will find the time to complete it but unfortunately I may not get time to progress it for about a week.

You will also be able to run the same code in a separate skin just to generate the data file (calendarevents.js) to populate your own Calendar on your web page (providing you are using Rick Pike's Javascript calendar refered to in my post and illustrated by maru-san). The links could still be made to work, e.g. by adding an HTML 'base' tag to your page with an href attribute pointing to your Narrative Report folder.

By genome - Monday, August 13, 2007
I have finally managed to get some scripting finished for the calendar feature. Attached is an English Narrative Report skin with it included. Also attached in a 'standalone' calendar skin 'calandarskin.zip' that can be used as a custom skin to generate the data to populate a calendar on your own web page. It is based on a pared down version of Narrative skin  and has a modified Config.xml that includes just two template files, Init.htm and calendarevents.js. The skin generates two other files in addition to calendarevents.js , layercalendar.js which is a modified version of Rick Pike's script and a prototype calendar.htm file that you can use as the basis of your own web page. Note that in order for the hyperlinks to work you will need to change the 'base' tag href attribute to point to the URL where your Narrative Report pages are located.

Both reports take fixed text , including month & day names, from Dictionary.xml so that it can be translated to other languages if required.

I have some more work to do on the calendar at a later date. I would like the styling to be handled via the style.css stylesheet rather than being hardcoded in layercalendar.js. Also it should perhaps generate two or more years of birthdays/anniversaries rather than one year as at present.

Update 24/08/07 Amended skins

By haep - Monday, August 13, 2007
Hi Ron,

I got the following error, but it's only on my famili tree:

Error en la línea 37, posición 2 (calendarevents.js): No coinciden los tipos: '[string: "(null)"]' Error de Microsoft VBScript en tiempo de ejecución 800A000D

 I tried with other sample files and there's no generation problem, but I can't see the calendar in the generated report, is there any additional required plugin?

Line: 26
Char: 1
Error: Object expected
Code: 0
Url: calendar.htm

PS.I'm using IE6SP2, GenoPro2.0.0.9, Skin 2.0.1.0.RC4

Thanks,

Hugo

By genome - Monday, August 13, 2007
Thanks Hugo. I was perhaps a bit hasty in posting (as usual!). I had only tested with Firefox which works fine. As you have found IE (I tried IE7) doesn't display the calendar. I'll work on the IE issue. Don't you just love cross-browser compatibility! Crazy

As regards your first problem, possibly you have a marriage date without any year? I will need to check for this.

By haep - Monday, August 13, 2007
Ron (8/13/2007)
Thanks Hugo. I was perhaps a bit hasty in posting (as usual!). I had only tested with Firefox which works fine. As you have found IE (I tried IE7) doesn't display the calendar. I'll work on the IE issue. Don't you just love cross-browser compatibility! Crazy

As regards your first problem, possibly you have a marriage date without any year? I will need to check for this.

Many thanks Ron, you are right, it's a marriage date without year. Smile

I also download a firefox browser, so I can finally see it... HeheIt's a perfect solution for somebody like me with a non-stick memory... (I always forget almost all birthdays TongueSmile Congratulations Ron! It's excellent. Smile

A suggestion... the calendar it's only filled from the generation date and on... could it be filled from the beginning of the year? or at least from the beginning of the current month?

Regards,

Hugo

By maru-san - Monday, August 13, 2007
Well done Ron and thanks a lot.
But can you please look again into the background color of the calendar table. Now it is transparent and if the overall background of your pages does not match, the calendar does not look nice. My suggestion is to fix the background of the calendar table(days) to the beige level (in calendar.htm), the same as if your overall background has no background at all. Easy to check if you change the background in the style sheet. Changed this in my report.

Ron, tried the calendar for a Japanese report, which did not work properly with regard to the links. Japanese characters are not used in file names and it will use either the full name plus ID or only the ID for individuals and family-and-famID for families or a complete filename, depending on the couples` names.
By genome - Tuesday, August 14, 2007
After nearly tearing my hair out I have finally discovered the cause of the IE failure. Rather an obscure error that was not flagged. (For the technically-minded I had used a reserved word, export, as an identifier in an object literal. IE discarded the script file, Firefox didn't mind. Amended skins are attached to my earlier post. Also fixed issue with birth/marriage dates with no year. I will work on further improvements as time permits. Ideally I'd like to have tabs for months rather than the existing hyperlinks.

maru-san (8/13/2007)
But can you please look again into the background color of the calendar table. Now it is transparent and if the overall background of your pages does not match, the calendar does not look nice.

I looked into this and discovered a # missing before the colour code in layercalendar.js so should be OK now. There will be more control once I convert to using CSS styles.


Ron, tried the calendar for a Japanese report, which did not work properly with regard to the links. Japanese characters are not used in file names and it will use either the full name plus ID or only the ID for individuals and family-and-famID for families or a complete filename, depending on the couples` names.

I need Dan to look at this and tell me how the html filenames are generated by GenoPro. In the Narrative report they are available in the 'Href' property but this is blank in the standaalone report, hence the requirement to generate them. Currently I just strip accents & punctuation and use the outputfile template from Config.xml

By beraha - Tuesday, August 14, 2007
Thanks Ron

When I was trying to generate a report using the new skins, I could see the calender but not the events. The same problem also on the Stand-Alone version.

The Calendarevents.js, is not containing any data except :

months=['','January','February','March','April','May','June','July','August','September','October','November','December'];
weekdays=['','Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
oDic = {
'view':'View',
'changes':'Apply changes',
'print':'Printer friendly',
'export':'Export events displayed',
'filter':'Filter events',
'jump':'Jump to month'}

Of course , The GNO file that I used, was with many individuals and dates.

By genome - Tuesday, August 14, 2007
Hum, the calendar only has 'live' events i.e. birthdays for those still alive and anniversaries for couples still together. Dates must be complete dates with day month & year.

There could be an issue with locale. The script uses the vbscript function IsDate to check for valid dates. Does your Windows locale match your GenoPro date formats? Perhaps I should recode to avoid IsDate.

Update: scripts amended to avoid IsDate

By beraha - Tuesday, August 14, 2007
Ron (8/14/2007)
Hum, the calendar only has 'live' events i.e. birthdays for those still alive and anniversaries for couples still together. Dates must be complete dates with day month & year.

There could be an issue with locale. The script uses the vbscript function IsDate to check for valid dates. Does your Windows locale match your GenoPro date formats? Perhaps I should recode to avoid IsDate.

Update: scripts amended to avoid IsDate

 

I went to the Control Panel of WinXP and changed the date format from Hebrew to English(US). Now I can see the events.

 On RC6 it seems to work also on the Hebrew date format only on one of my gno files. I tried to generate the report from a big GNO, and it's not working. I can't see the events. I attach the file.

I've also noticed that it's possible to see only future events. for example: My birthday is on 23 Feb. I could see this event only at 23 Feb 2008 and not at 23 Feb 2007 (Current year).

Also, when I click on the event link, it goes to "Harry Potter" family tree and not to my tree.(I've checked the stand-alone version) 

on the full skin, the link is broken.

By haep - Tuesday, August 14, 2007
Hi Ron,

I found a problem in the distribution of the days in the table     
If the months are translated in the dictionary.xml file, then the script doesn't find the correct month, and make a bad distribution on the table (the first day of the month always begins in Sunday )

<-- Ver JulioAgosto 2007 Ver Septiembre -->
DomLunMarMieJueVierSab
1  
2  
3  
4  
5  
6  
7  
8  
9  
10 
11 
12 
13 
14 

If the months are not translated, then it's ok...

<-- Ver JulyAugust 2007 Ver September -->
DomLunMarMieJueVierSab
   
1  
2  
3  
4  
5  
6  
7  
8  
9  
10 
11 

Ron (8/14/2007)
I need Dan to look at this and tell me how the html filenames are generated by GenoPro. In the Narrative report they are available in the 'Href' property but this is blank in the standaalone report, hence the requirement to generate them. Currently I just strip accents & punctuation and use the outputfile template from Config.xml

Also I found that some links are not working in the calendar (Narrative_2.0.1.0RC5.zip) , so I compare the links and I found this:
In aniversaries, missing the prefix "family-"
file:///C:/Familiograma/VictorOrtizFloresElizabethEsquivelCervantes-fam00019.htm --calendar link
file:///C:/Familiograma/family-VictorOrtizFloresAndElizabethEsquivelCervantes-fam00019.htm --in any other part in the report


Missing dot
file:///C:/Familiograma/Melgar-MaEstela-ind00531.htm --calendar link
file:///C:/Familiograma/Melgar-Ma.Estela-ind00531.htm  ----in any other part in the report

file:///C:/Familiograma/Martagon-MadelCarmen-ind00251.htm --calendar link
file:///C:/Familiograma/Martagon-Ma.delCarmen-ind00251.htm --in any other part in the report


The "ñ" is replaced with "n"
file:///C:/Familiograma/Carca%C3%B1o-Dolores-ind00331.htm --calendar link
file:///C:/Familiograma/Carcano-Dolores-ind00331.htm  --in any other part in the report

if name is missing then there should be only one "-"
file:///C:/Familiograma/Morales--ind01417.htm  --calendar link
file:///C:/Familiograma/Morales-ind01417.htm  --in any other part in the report

Regards,

Hugo

By genome - Tuesday, August 14, 2007
Thanks for testing & the feedback Kobi & Hugo. I have updated the skins again. We are getting nearly to a working solution. Non-english month names should now work. I have changed the html filename generation but there still could be exceptions I have not catered for.

I've also noticed that it's possible to see only future events. for example: My birthday is on 23 Feb. I could see this event only at 23 Feb 2008 and not at 23 Feb 2007 (Current year).
This was originally by design. Hugo has also requested this change (populate months of current year with events). I will work on this amendment.

Also, when I click on the event link, it goes to "Harry Potter" family tree and not to my tree.(I've checked the stand-alone version) 
The standalone script makes no assumptions as to where you have placed your Narrative Report files in relation to your calendar page. You may have missed my earlier comment
Note that in order for the hyperlinks to work you will need to change the 'base' tag href attribute to point to the URL where your Narrative Report pages are located.
It is set to Harry Potter by default in the prototype calendar.htm.
By beraha - Wednesday, August 15, 2007
When the individual's name is in Hebrew, there is a problem on the way that the text is displayed.

e.g: Look at the attached photo.

It is written:  "Ruth רות Adut 20 אדוט th birthday"

instead of:     "Ruth רות Adut אדוט l 20th birthday"  (Skip the " l " symbol)

By haep - Wednesday, August 15, 2007
Hi Ron,

Thanks, almost all problems are fixed in Narrative_2.0.1.0RC7.zip but the problem with the "ñ" still there (I think I was not clear, apologies for inconvenience...), what I meant was the "ñ" must be remplaced with the "n"

file:///C:/Familiograma/Carcaño-Dolores-ind00331.htm --Version 2.0.1.0RC6
file:///C:/Familiograma/Carcao-Dolores-ind00331.htm --Version 2.0.1.0RC7
file:///C:/Familiograma/Carcano-Dolores-ind00331.htm  --This is the OK link

And I found a problem with anniversaries... the Anniversaries are calculated ok for current year, but in 2008 keep the same value as it was 2007...

pe. A wedding in 1 sep 2006 is calculated on sep 2007 as first annivesary --->It's OK
    but....
A wedding in 1 jun 2006 is calculated on jun 2008 as first annivesary -->must be the 2nd

Regards,

Hugo

By genome - Friday, August 17, 2007
Well, have made a few more updates so attachments in my earlier post have been updated once more.

Found a hidden 'feature' in Report Generator - i.Href & f.Href only get generated when template present in Config.xml. So instead of trying to generate the html filename I have simply added dummy templates individual.htm & family.htm in the standalone skin so can now use i.Href & f.Href so links should match Narrative Report.

I'm confused by bidirectional stuff and so I have fixed this issue with a hack - I place 'nth birthday' bit in a <span> element with dir='ltr' attribute. This seems to stop the browser placing the rtl (e.g. Hebrew) name to the right of the number.

Fixed anniversaries and also now populate calendar with events from the beginning of the current year.

By haep - Friday, August 17, 2007
Hehe It's working perfect!! Thanks Ron, excellent job.

Regards,

Hugo

By beraha - Saturday, August 18, 2007
Ron (8/17/2007)
I'm confused by bidirectional stuff and so I have fixed this issue with a hack - I place 'nth birthday' bit in a <span> element with dir='ltr' attribute. This seems to stop the browser placing the rtl (e.g. Hebrew) name to the right of the number.

The problem is still sometimes there. Here is an example

 

By maru-san - Saturday, August 18, 2007
Ron, I have another small problem when making a German report. I need to set the weekdays to 2 digits rather than the 3 for English at the moment. (Mo, Di, Mi, Do, Fr, Sa, So)
What needs to be changed?
By genome - Sunday, August 19, 2007
beraha (8/18/2007)
The problem is still sometimes there.  

Ok I'll look further. It would be helpful if you could post or send me a small sample .gno file with mixed English/Hebrew names.

maru-san (8/19/2007)
I need to set the weekdays to 2 digits rather than the 3 for English 

You can just set the required value in a 'S' attribute for each day of the week in the Dictionary <DateFormatting> section e.g.

 <Weekdays>
  <Mon S="Mo">Montag</Mon>
  <Tue S="Di">Dienstag</Tue>

etc.

By genome - Sunday, August 19, 2007
Thanks for the test file Kobi. I have updated the skins with just a change to the Dictionary.xml to use the html <bdo> tag instead of <span> around just the ordinal number.

It all looks OK now with your test file.

I found this useful tutorial on dealing with bidirectional text in HTML.

By genome - Tuesday, August 21, 2007
I have made a couple of tweaks to the code so that links to the Narrative Report from a standalone calendar behave correctly when the standalone calendar is within a frameset. script.js has been changed so that it detects when the Narrative Report is within a different frameset. This means the original Narrative Report to which the calendar links must be regenerated (or at least script.js updated) for this change to work.  Again for the standalone report, I have added a LinkPrefix variable to layercalendar.js and calendar.htm so that the links go to the Narrative Report frameset directly, rather than to the individual page first and then to the frameset.
By beraha - Tuesday, August 21, 2007
Ron (8/21/2007)
I have made a couple of tweaks to the code so that links to the Narrative Report from a standalone calendar behave correctly when the standalone calendar is within a frameset. script.js has been changed so that it detects when the Narrative Report is within a different frameset. This means the original Narrative Report to which the calendar links must be regenerated (or at least script.js updated) for this change to work.  Again for the standalone report, I have added a LinkPrefix variable to layercalendar.js and calendar.htm so that the links go to the Narrative Report frameset directly, rather than to the individual page first and then to the frameset.

Thanks Ron

The Frameset issue was solved now Smile I'm so Happy to have that great feature.

I Would suggest to change the line:

document.write("<FONT SIZE=1>" + tmp + "</FONT>");

into:

document.write("<FONT SIZE=2>" + tmp + "</FONT>");

It's much readable that way.

By Alex - Thursday, August 23, 2007
Hi Ron!
In Calendar (Narrative_2.0.1.0RC10) do not change month.
And in all previous versions:
- In Configuration Settings: Picture Settings - Show picture name below picture? – “NO”.
But picture name is showing in Report. (?)

Thanks.
Alex.
By genome - Thursday, August 23, 2007
Thanks for reporting these issues Alex. I had made some changes to the calendar to remove the need for cookies and only tested the standalone version of the calendar which works fine -  this is what we know in the UK as 'Sod's Law' - if anything can go wrong -it will!

I'll look into it, also the picture thingy.

By genome - Friday, August 24, 2007
Ok I think the calendar is now fixed (attachments updated).

With the picture name, there were some typos in the Config Params in the Dictionary. Show picture name below picture? should be Hide picture name below picture?. Also fUsePictureID should be fUsePictureId. I have also changed picture name to picture title to reflect the fact that the 'Picture Name' field in GenoPro does not have to be the filename - you change it to any title you wish (and you do not have to rename your pictures!).

By 260240 - Monday, August 27, 2007
Dear friends,

I have found a little bug in the calendar. Whenever I have a birthday on the current date, it displays the age as if the person was becoming a year older. Only happens when the birthday matches the current day.

And I have a request... is there a way to print in the calendar also birthdays of people whom I do not have the year of birth, but I have the rest of the date???

Thanks,

PACO LUNA

By genome - Tuesday, August 28, 2007
Thanks for reporting this Paco. I hope I have found the solution in this post (unzip attachment as custom skin)
By beraha - Monday, October 8, 2007
Here is a small problem I've just found about the calendar (Tested only at the stand-alone version):

If someone has a birthday today and you generate a report on the same day that he has a birthday, the calendar will show that he is older in one year then he really is.

e.g:

1. create an individual who has a birthday today and he is 1 years old. (He was born last year at the same day).

2, generate a stand-alone calendar report

3. the result will be that he is 2 !! years old. of course - it's a mistake.

By genome - Thursday, October 11, 2007
beraha (10/9/2007) Here is a small problem I've just found about the calendar (Tested only at the stand-alone version):

If someone has a birthday today and you generate a report on the same day that he has a birthday, the calendar will show that he is older in one year then he really is.

Hugo reported a similar problem earlier and this has been fixed in the Narrative Report version of the calendar and my testing does not show this problem. I do not intend to maintain the standalone version as the code is identical to the one embedded in the Narrative Report. Could you try replacing the layercalendar.js and calendarevents.js files in your standalone skin with the sames files from the latest Narrative Report skin and see if that fixes it?

By beraha - Thursday, October 11, 2007
Ron (10/11/2007)
[quote][b]

Hugo reported a similar problem earlier and this has been fixed in the Narrative Report version of the calendar and my testing does not show this problem. I do not intend to maintain the standalone version as the code is identical to the one embedded in the Narrative Report. Could you try replacing the layercalendar.js and calendarevents.js files in your standalone skin with the sames files from the latest Narrative Report skin and see if that fixes it?

 

I did what you have suggested, but the same problem remains.

The problem is still there even when I generate a full report using the default english skin

By genome - Thursday, October 11, 2007
I am puzzled by this. If I do as you suggest and set say Harry Potter's birthday to be one year ago 11th Oct 2006 and generate a Narrative Report using 2.0.1.1 I get the correct result in the calendar, i.e. Harry is one year old today:

By beraha - Thursday, October 11, 2007
Ron (10/11/2007)
I am puzzled by this. If I do as you suggest and set say Harry Potter's birthday to be one year ago 11th Oct 2006 and generate a Narrative Report using 2.0.1.1 I get the correct result in the calendar, i.e. Harry is one year old today

 

O.k - first I'm sorry - I was using by mistake ver 2.0.1.0.  on ver 2.0.1.1 the problem is gone using the english report.

However - I tried again to replace the layercalendar.js and calendarevents.js files in my standalone skin with the sames files from the latest Narrative Report skin (ver 2.0.1.1) but I get this error message and non of the events are dispalyed.

 

I hope that you could fix also the stand alone version on that matter.

Thank you