Exceptions checking

Bart Pietercil bart.pietercil at cognosis.be
Sun Sep 14 14:11:35 CDT 2008


Hi Ruslan,
On 14 Sep 2008, at 20:32, Ruslan Zasukhin wrote:

> On 9/14/08 9:20 PM, "Bart Pietercil" <bart.pietercil at cognosis.be>  
> wrote:
>
> Hi Bart,
>
>>> Yes, this idea is our dream
>>>
>>>   VRecources/English/*.xml
>>>   VRecources/German/*.xml
>>>
>>> Third party developer must be able translate xml files self, put
>>> them into additional folder, and setup own language.
>>>
>>> I think name of language should be the same as name of folder,
>>>   so in SQL will sounds like
>>>
>>>       SET PROPERTY Language OF CONNECTION TO 'German'
>>>
>>> And engine must search for folder with such name and load XMLs from
>>> there.
>>>
>>> This feature not works yet. Request via Mantis if needed.
>>
>> I think it would be a mistake to name the file after a language.  
>> Years
>> of experience in multi-lingual programming has let me to believe
>> that the only viable soultion is specifiying the full file path (or
>> directory in this case) to use at the connection level.
>>
>> In our case that would be
>> SET PROPERTY exceptiondirectory OF CONNECTION TO 'specify a FULL path
>> here'
>
> Hmm, I do not see need in this!
>
> You now think about VSERVER, but the same should work for e.g. V4RB  
> LOCAL
> app. So we exactly cannot use absolute path here Bart.
>
> V4RB app know self where is vcomponents folder, so it is able locate
> VRecources folder. And inside of it find folder with name "Language".
>
> What problems you see here ?
>
>
>> we need to be able to specify a full path here because then the only
>> thing  needed is that the vserver can 'reach out' to this directory.
>
>> The reason I want it OUTSIDE of anything that has to do with  
>> Valentina
>> is because I want to be able to parse the xml from the client app.
>> In our case that would be PHP.
>>
>> And I most certainly do NOT want to give APACHE  webacces to a
>> directory that leads to the database engine (seems silly from a
>> security standpoint).
>> So I want it the other way around, no files inside Valentina Paths  
>> but
>> being able to specify to valentina where it can find the files to use
>> in exception reporting.
>
> Aha, I see your point of view.
>
>> It seems to me it would be a minor change for Valentina and it would
>> make the xml solution immediately workable for all clients that know
>> how to handle an xml-file.
>>
>> Hope you get the idea
>
> Now question is
>
>    1) what task is MAJOR for you and how much urgent?
>
>    2) what way you prefer... Absolute path to what?
>        folder with 2 our XML files?

I think the absolute path is the most important. So we can move the  
xml files into a web accesible directory.

>
>
>    3) or you need yet THIRD XML file?

If I understood Ivan correctly we can raise any number (as long as it  
is not used by kernel.xml or sql.xml) inside the range of user_errors.
Once the file is in reach of php I don't need Valentina any more  
because now php can look itself for a user_defined.xml in the correct  
language
and I can raise exceptions as I want

raise 50001

exception in php is received
php retrieves the correct file for the language of the user and parses  
the xml picking up the message I want the user to see

>
>
> Ivan have try today add codes to our XML files, as you can do, and  
> says this
> works. Only issue with this way -- you need correct this file after  
> each
> install.
>

That's why I started this tread, and why I proposed to have a third  
file user_defined.xml. You guys are in charge of kernel and sql.xml,  
the developer can add all custom errors to his file and you can update  
without a problem.
But as said , if I understood correctly that I can raise my own (non- 
defined where vserver is concerned) exceptions and pass the exception  
number from a stored procedure to PHP, I can continue

Bart





More information about the Valentina mailing list