Re: Doing database creation before EOF gets involved ?

2014-01-30 Thread Theodore Petrosky
I have thought about this a bunch of times. My DB of choice is Postgresql. When 
you create the database cluster, PG automatically creates at least two 
databases. Template1 and the basis of Template1.

I have often thought it would be possible to first let my app connect to 
Template1 as it must exist for PG to function. Then I could issue the SQL 
directly in my first migration that creates the database that I want.

step two would be to then diddle the connection dictionary to point to the 
correct database.

now normal migrations take over to create the tables, relationships, etc.

I don't know that this would work. It was only an idea I had whilst driving to 
WOWODC13. It's a long drive from NYC to Montreal and what else is there to 
think about.

If someone that understands this at a deeper level, put me out of my misery.

Ted



On Jan 30, 2014, at 6:40 PM, Gavin Eadie  wrote:

> I'm working on a WebObjects project which uses a database of minor 
> complexity, and am wrestling mentally with finding a good way to let the 
> first run create the database.
> 
> Currently, the first run needs the EOModel's connection record to find the 
> database (which is created my hand, but empty), and then uses Migration to 
> read a SQL file that creates all the tables and fields.  But I want a kind of 
> "turn-key" start where, if the database doesn't exist, it gets created.
> 
> My thinking so far has taken me to consider catching the exception that the 
> missing database causes, using bare JDBC calls to create the database, and 
> then, somehow, resuming use of the EOModel.
> 
> But I learned years ago that if things are getting complicated in the WO/EOF 
> world, I'm not doing it right; maybe there are tricks in the heart of Wonder 
> that would help with this?  I'd much appreciate any helpful ideas to carry 
> this plan forward (or the suggestion to abandon it because it's an unnatural 
> act!).
> 
> Thanks .. Gavin
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
> 
> This email sent to tedp...@yahoo.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Doing database creation before EOF gets involved ?

2014-01-30 Thread Gavin Eadie
I'm working on a WebObjects project which uses a database of minor
complexity, and am wrestling mentally with finding a good way to let the
first run create the database.

Currently, the first run needs the EOModel's connection record to find the
database (which is created my hand, but empty), and then uses Migration to
read a SQL file that creates all the tables and fields.  But I want a kind
of "turn-key" start where, if the database doesn't exist, it gets created.

My thinking so far has taken me to consider catching the exception that the
missing database causes, using bare JDBC calls to create the database, and
then, somehow, resuming use of the EOModel.

But I learned years ago that if things are getting complicated in the
WO/EOF world, I'm not doing it right; maybe there are tricks in the heart
of Wonder that would help with this?  I'd much appreciate any helpful ideas
to carry this plan forward (or the suggestion to abandon it because it's an
unnatural act!).

Thanks .. Gavin
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Including Fonts into PDF using ERPDFGeneration

2014-01-30 Thread Johann Werner
Hi Christoph,

that’s how I create a PDF using ERPDFGeneration with custom fonts:

PDFTemplate pdfPage = pageWithName(PDFTemplate.class);
NSMutableDictionary config = new NSMutableDictionary();
config.takeValueForKey(new NSArray("Fonts/MyFont.ttf“, 
"Fonts/MyOtherFont.ttf"), "fonts");
NSData pdf = 
ERPDFUtilities.htmlAsPdf(pdfPage.generateResponse().contentString(), 
CharEncoding.UTF_8, null, config);

In this example the fonts are located in a directory „Fonts“ within „Resources“.

jw


Am 30.01.2014 um 13:13 schrieb Christoph Wick :

> Hi List,
> 
> I try to include fonts into a PDF document using ERPDFGeneration. The 
> documentation of ERPFDWrapper tells me that there is a binding called 
> "fonts". The binding is described as "(optional) array of font filenames to 
> include for PDF generation".
> 
> OK so far. But whatever I set the "fonts" bindings to, I get an 
> ClassCastException that a String cannot be casted to NSArray. 
> Stacktrace below.
> 
> I've looked into the code and I found line 120 in FlyingSaucerImpl.java:
> 
>   NSArray fonts = (NSArray) 
> configuration.objectForKey("fonts"); 
> 
> So, what's the correct syntax of the bindings value string to be converted 
> into an NSArray of Strings? I've tried ['Font 1', 'Font2'] as well as {'Font 
> 1', 'Font2'}, but that all doesn't work.
> 
> Thx,
> C.U.CW
> 
> 
> Stacktrace:
> 
> Error:java.lang.ClassCastException: java.lang.String cannot be cast 
> to com.webobjects.foundation.NSArray
> Reason:   java.lang.String cannot be cast to 
> com.webobjects.foundation.NSArray
> Stack trace:  
> File  Line#   Method  Package
> FlyingSaucerImpl.java 120 fontsFromConfiguration  er.pdf.builder
> FlyingSaucerImpl.java 91  setSource   er.pdf.builder
> ERPDFUtilities.java   132 htmlAsPdf   er.pdf
> ERPDFWrapper.java 89  responseAsPdf   er.pdf
> ERPDFWrapper.java 66  appendToResponseer.pdf
> WOComponent.java  1122appendToResponsecom.webobjects.appserver
> ERXComponent.java 195 appendToResponseer.extensions.components
> WOSession.java1385appendToResponsecom.webobjects.appserver
> WOApplication.java1794appendToResponsecom.webobjects.appserver
> ERXApplication.java   2005appendToResponseer.extensions.appserver
> ERXComponentRequestHandler.java   190 _dispatchWithPreparedPage   
> er.extensions.appserver
> ERXComponentRequestHandler.java   235 _dispatchWithPreparedSession
> er.extensions.appserver
> ERXComponentRequestHandler.java   268 
> _dispatchWithPreparedApplicationer.extensions.appserver
> ERXComponentRequestHandler.java   302 _handleRequest  
> er.extensions.appserver
> ERXComponentRequestHandler.java   378 handleRequest   
> er.extensions.appserver
> WOApplication.java1687dispatchRequest com.webobjects.appserver
> ERXApplication.java   2109dispatchRequestImmediately  
> er.extensions.appserver
> ERXApplication.java   2074dispatchRequest er.extensions.appserver
> WOWorkerThread.java   144 runOnce com.webobjects.appserver._private
> WOWorkerThread.java   226 run com.webobjects.appserver._private
> Thread.java   722 run java.lang
> 
> 
> -- 
> Christoph Wick - Diplom Informatiker, Managing Director
> i4innovation GmbH, Professor-Neu-Allee 39, 53225 Bonn, Germany
> 
> T +49 2 28 28 62 97 93
> M +49 1 51 22 65 78 90
> F +49 2 28 28 62 97 99
> M c...@i4innovation.de
> W www.i4innovation.de
> Skype: christoph_wick
> 
> Geschäftsführer: Thomas Heep, Christoph Wick
> Sitz der Gesellschaft: Bonn | Amtsgericht Bonn HRB 18548 | USt-IdNr.: 
> DE276502600
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/jw%40oyosys.com
> 
> This email sent to j...@oyosys.com



signature.asc
Description: Message signed with OpenPGP using GPGMail
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Including Fonts into PDF using ERPDFGeneration

2014-01-30 Thread Theodore Petrosky
actually the font name would be something like   Arial.ttf or Helvetica.ttf  

the docs do say 'filename'.



On Jan 30, 2014, at 7:38 AM, Theodore Petrosky  wrote:

> the docs say:
> 
> (optional) array of font filenames to include for PDF generation
> 
> It doesn't say a dictionary.
> 
> NSArray fontsArray = NSArray("Arial", "Helvetica");
> 
> Is how I would do it according to the documentation. Of course, I generally 
> just use JasperReports and convert fonts to .jar files and put them in the 
> build path.Then I don't have to worry.
> 
> Ted
> 
> On Jan 30, 2014, at 7:13 AM, Christoph Wick  wrote:
> 
>> Hi List,
>> 
>> I try to include fonts into a PDF document using ERPDFGeneration. The 
>> documentation of ERPFDWrapper tells me that there is a binding called 
>> "fonts". The binding is described as "(optional) array of font filenames to 
>> include for PDF generation".
>> 
>> OK so far. But whatever I set the "fonts" bindings to, I get an 
>> ClassCastException that a String cannot be casted to NSArray. 
>> Stacktrace below.
>> 
>> I've looked into the code and I found line 120 in FlyingSaucerImpl.java:
>> 
>>  NSArray fonts = (NSArray) 
>> configuration.objectForKey("fonts"); 
>> 
>> So, what's the correct syntax of the bindings value string to be converted 
>> into an NSArray of Strings? I've tried ['Font 1', 'Font2'] as well as {'Font 
>> 1', 'Font2'}, but that all doesn't work.
>> 
>> Thx,
>> C.U.CW
>> 
>> 
>> Stacktrace:
>> 
>> Error:   java.lang.ClassCastException: java.lang.String cannot be cast 
>> to com.webobjects.foundation.NSArray
>> Reason:  java.lang.String cannot be cast to 
>> com.webobjects.foundation.NSArray
>> Stack trace: 
>> File Line#   Method  Package
>> FlyingSaucerImpl.java120 fontsFromConfiguration  er.pdf.builder
>> FlyingSaucerImpl.java91  setSource   er.pdf.builder
>> ERPDFUtilities.java  132 htmlAsPdf   er.pdf
>> ERPDFWrapper.java89  responseAsPdf   er.pdf
>> ERPDFWrapper.java66  appendToResponseer.pdf
>> WOComponent.java 1122appendToResponsecom.webobjects.appserver
>> ERXComponent.java195 appendToResponseer.extensions.components
>> WOSession.java   1385appendToResponsecom.webobjects.appserver
>> WOApplication.java   1794appendToResponsecom.webobjects.appserver
>> ERXApplication.java  2005appendToResponseer.extensions.appserver
>> ERXComponentRequestHandler.java  190 _dispatchWithPreparedPage   
>> er.extensions.appserver
>> ERXComponentRequestHandler.java  235 _dispatchWithPreparedSession
>> er.extensions.appserver
>> ERXComponentRequestHandler.java  268 
>> _dispatchWithPreparedApplicationer.extensions.appserver
>> ERXComponentRequestHandler.java  302 _handleRequest  
>> er.extensions.appserver
>> ERXComponentRequestHandler.java  378 handleRequest   
>> er.extensions.appserver
>> WOApplication.java   1687dispatchRequest com.webobjects.appserver
>> ERXApplication.java  2109dispatchRequestImmediately  
>> er.extensions.appserver
>> ERXApplication.java  2074dispatchRequest er.extensions.appserver
>> WOWorkerThread.java  144 runOnce com.webobjects.appserver._private
>> WOWorkerThread.java  226 run com.webobjects.appserver._private
>> Thread.java  722 run java.lang
>> 
>> 
>> -- 
>> Christoph Wick - Diplom Informatiker, Managing Director
>> i4innovation GmbH, Professor-Neu-Allee 39, 53225 Bonn, Germany
>> 
>> T +49 2 28 28 62 97 93
>> M +49 1 51 22 65 78 90
>> F +49 2 28 28 62 97 99
>> M c...@i4innovation.de
>> W www.i4innovation.de
>> Skype: christoph_wick
>> 
>> Geschäftsführer: Thomas Heep, Christoph Wick
>> Sitz der Gesellschaft: Bonn | Amtsgericht Bonn HRB 18548 | USt-IdNr.: 
>> DE276502600
>> 
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
>> 
>> This email sent to tedp...@yahoo.com
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
> 
> This email sent to tedp...@yahoo.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Including Fonts into PDF using ERPDFGeneration

2014-01-30 Thread Theodore Petrosky
the docs say:

(optional) array of font filenames to include for PDF generation

It doesn't say a dictionary.

NSArray fontsArray = NSArray("Arial", "Helvetica");

Is how I would do it according to the documentation. Of course, I generally 
just use JasperReports and convert fonts to .jar files and put them in the 
build path.Then I don't have to worry.

Ted

On Jan 30, 2014, at 7:13 AM, Christoph Wick  wrote:

> Hi List,
> 
> I try to include fonts into a PDF document using ERPDFGeneration. The 
> documentation of ERPFDWrapper tells me that there is a binding called 
> "fonts". The binding is described as "(optional) array of font filenames to 
> include for PDF generation".
> 
> OK so far. But whatever I set the "fonts" bindings to, I get an 
> ClassCastException that a String cannot be casted to NSArray. 
> Stacktrace below.
> 
> I've looked into the code and I found line 120 in FlyingSaucerImpl.java:
> 
>   NSArray fonts = (NSArray) 
> configuration.objectForKey("fonts"); 
> 
> So, what's the correct syntax of the bindings value string to be converted 
> into an NSArray of Strings? I've tried ['Font 1', 'Font2'] as well as {'Font 
> 1', 'Font2'}, but that all doesn't work.
> 
> Thx,
> C.U.CW
> 
> 
> Stacktrace:
> 
> Error:java.lang.ClassCastException: java.lang.String cannot be cast 
> to com.webobjects.foundation.NSArray
> Reason:   java.lang.String cannot be cast to 
> com.webobjects.foundation.NSArray
> Stack trace:  
> File  Line#   Method  Package
> FlyingSaucerImpl.java 120 fontsFromConfiguration  er.pdf.builder
> FlyingSaucerImpl.java 91  setSource   er.pdf.builder
> ERPDFUtilities.java   132 htmlAsPdf   er.pdf
> ERPDFWrapper.java 89  responseAsPdf   er.pdf
> ERPDFWrapper.java 66  appendToResponseer.pdf
> WOComponent.java  1122appendToResponsecom.webobjects.appserver
> ERXComponent.java 195 appendToResponseer.extensions.components
> WOSession.java1385appendToResponsecom.webobjects.appserver
> WOApplication.java1794appendToResponsecom.webobjects.appserver
> ERXApplication.java   2005appendToResponseer.extensions.appserver
> ERXComponentRequestHandler.java   190 _dispatchWithPreparedPage   
> er.extensions.appserver
> ERXComponentRequestHandler.java   235 _dispatchWithPreparedSession
> er.extensions.appserver
> ERXComponentRequestHandler.java   268 
> _dispatchWithPreparedApplicationer.extensions.appserver
> ERXComponentRequestHandler.java   302 _handleRequest  
> er.extensions.appserver
> ERXComponentRequestHandler.java   378 handleRequest   
> er.extensions.appserver
> WOApplication.java1687dispatchRequest com.webobjects.appserver
> ERXApplication.java   2109dispatchRequestImmediately  
> er.extensions.appserver
> ERXApplication.java   2074dispatchRequest er.extensions.appserver
> WOWorkerThread.java   144 runOnce com.webobjects.appserver._private
> WOWorkerThread.java   226 run com.webobjects.appserver._private
> Thread.java   722 run java.lang
> 
> 
> -- 
> Christoph Wick - Diplom Informatiker, Managing Director
> i4innovation GmbH, Professor-Neu-Allee 39, 53225 Bonn, Germany
> 
> T +49 2 28 28 62 97 93
> M +49 1 51 22 65 78 90
> F +49 2 28 28 62 97 99
> M c...@i4innovation.de
> W www.i4innovation.de
> Skype: christoph_wick
> 
> Geschäftsführer: Thomas Heep, Christoph Wick
> Sitz der Gesellschaft: Bonn | Amtsgericht Bonn HRB 18548 | USt-IdNr.: 
> DE276502600
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
> 
> This email sent to tedp...@yahoo.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Including Fonts into PDF using ERPDFGeneration

2014-01-30 Thread Christoph Wick
Hi List,

I try to include fonts into a PDF document using ERPDFGeneration. The 
documentation of ERPFDWrapper tells me that there is a binding called "fonts". 
The binding is described as "(optional) array of font filenames to include for 
PDF generation".

OK so far. But whatever I set the "fonts" bindings to, I get an 
ClassCastException that a String cannot be casted to NSArray. 
Stacktrace below.

I've looked into the code and I found line 120 in FlyingSaucerImpl.java:

NSArray fonts = (NSArray) 
configuration.objectForKey("fonts"); 

So, what's the correct syntax of the bindings value string to be converted into 
an NSArray of Strings? I've tried ['Font 1', 'Font2'] as well as {'Font 1', 
'Font2'}, but that all doesn't work.

Thx,
C.U.CW


Stacktrace:

Error:  java.lang.ClassCastException: java.lang.String cannot be cast to 
com.webobjects.foundation.NSArray
Reason: java.lang.String cannot be cast to com.webobjects.foundation.NSArray
Stack trace:
FileLine#   Method  Package
FlyingSaucerImpl.java   120 fontsFromConfiguration  er.pdf.builder
FlyingSaucerImpl.java   91  setSource   er.pdf.builder
ERPDFUtilities.java 132 htmlAsPdf   er.pdf
ERPDFWrapper.java   89  responseAsPdf   er.pdf
ERPDFWrapper.java   66  appendToResponseer.pdf
WOComponent.java1122appendToResponsecom.webobjects.appserver
ERXComponent.java   195 appendToResponseer.extensions.components
WOSession.java  1385appendToResponsecom.webobjects.appserver
WOApplication.java  1794appendToResponsecom.webobjects.appserver
ERXApplication.java 2005appendToResponseer.extensions.appserver
ERXComponentRequestHandler.java 190 _dispatchWithPreparedPage   
er.extensions.appserver
ERXComponentRequestHandler.java 235 _dispatchWithPreparedSession
er.extensions.appserver
ERXComponentRequestHandler.java 268 _dispatchWithPreparedApplication
er.extensions.appserver
ERXComponentRequestHandler.java 302 _handleRequest  er.extensions.appserver
ERXComponentRequestHandler.java 378 handleRequest   er.extensions.appserver
WOApplication.java  1687dispatchRequest com.webobjects.appserver
ERXApplication.java 2109dispatchRequestImmediately  
er.extensions.appserver
ERXApplication.java 2074dispatchRequest er.extensions.appserver
WOWorkerThread.java 144 runOnce com.webobjects.appserver._private
WOWorkerThread.java 226 run com.webobjects.appserver._private
Thread.java 722 run java.lang


-- 
Christoph Wick - Diplom Informatiker, Managing Director
i4innovation GmbH, Professor-Neu-Allee 39, 53225 Bonn, Germany

T +49 2 28 28 62 97 93
M +49 1 51 22 65 78 90
F +49 2 28 28 62 97 99
M c...@i4innovation.de
W www.i4innovation.de
Skype: christoph_wick

Geschäftsführer: Thomas Heep, Christoph Wick
Sitz der Gesellschaft: Bonn | Amtsgericht Bonn HRB 18548 | USt-IdNr.: 
DE276502600


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com