Jason Hines | 1 Sep 2003 09:42

Re: bc notes / todo

Jean-Christophe Michel wrote:
>>>Very doubtful. We began to speak of this, it's a very hard way to go
>>>if we want to express conditions smartly.
>>
>>What if on a search page, you only want to search fields determined by 
>>user input?  IE: they search on name,title,description.  In another 
>>search, they search on just name,title..  etc.
>>
>>The only way to know what fields to search is by looking to Request and 
>>constructing a condition at runtime.
> 
> 
> You construct the where clause and replace it in prepared qry
> SELECT ... FROM ... %whereclause%;
> Of course a consistent way of describing conditions, limits,
> groupings... would be great; with xml and corresponding php;
> and appropriate translation for each db...
> but it's not a simple thing to do.

Ahh, I see your scope was _much_ higher.  I was thinking more of just a 
"criteria" object for constructing simple WHERE clauses.  I suppose this 
could be done in StorageSQL, but would break oo.  (it needs to do more 
than just concatenate.

%whereclause% is a workaround hack for the most part.  The result is 
right - as in ent2qry just prints the string.  But the app currently has 
to build up a SQL, which breaks all db independence in apps.  A base app 
for handling where clauses then is a good compromise imo.

>>>Are you sure we 'll never need another templating system ?
(Continue reading)

Jason Hines | 1 Sep 2003 10:01

Re: bc notes / todo

> role              operations            entity
> ---------------------------------------------------
> Public            view/add              Articles

Hmm furthur ..

This allows anonymous user to contribute and submit Articles.

> Public            view                  Users

Anonymous user can view a user's profile and can login (get), but cannot 
register (add) or edit his own or others (set), or delete another user.

RE: field/property level auth:

Say there is an Orders entity. Both SupportRole and GodRole process the 
new orders.  However only GodRole has access to see the credit card 
number.

yeah, need some more xml. =]

jason
Jean-Christophe Michel | 1 Sep 2003 22:07
Favicon

other problems to solve

Hi,

I begin here my own list of doleances :-)

* phing and modified files
When changing a datasource or an entitymap, bc_ent2* tools
don't rebuild the files if they are not deleted by hand or if source edf
is not changed. Is there a way to handle these dependencies
automatically, or simply to disable the date check and rebuild stupidly
all files ?
Same pb when building project, when you change strings file and not php
source: strings are not used or you have to rebuild.

My solution:
i added
    <delete file="${out_file}" />
for each simple target in tools/entity/entity_compiler.xml
and 
    <echo msg="Deleting all generated files" />
    <delete>
      <fileset dir="${env.BCHOME}/user/${workspace}/app/${app}">
        <include name="schema/*.schema.xml" />
        <include name="qry/*.qry.xml" />
        <exclude name="qry/*.custom.qry.xml" />
        <include name="cls/*.php" />
        <include name="form/*.ndf.xml" />
      </fileset>
    </delete>
in ent2all target. 

(Continue reading)

Ahti Kaukoniemi | 2 Sep 2003 07:06
Picon
Favicon

ent2all not building cls and qry

Hi!

When I'm running ent2all in testsite/app/website/
phign doesn't build classes and queries. Also the end
of EntityMap.conf.xml ends up looking like this:

    <section name="qry_realPaths"/>
    <section name="qry_importPaths"/>
    <section name="class_realPaths"/>
    <section name="class_importPaths"/>

The beginning of the file looks ok though. (The paths
are there.)
It seems to me that there's something wrong with xslt,
and maybe the fact that I'm on winXP has something to
do with it too. I've attached phing's debug output (at
least the part I can get out of command prompt).

I'd really appreciate it if some of you could help me
out with this, this is getting a bit too difficult for
me to fix as I don't know much about phing internals.

This is the first time I'm actually writing to the
list, though I've been lurking around for a while. I
must say that I'm pretty impressed by the system
you've created so far, and that the deeper I dig into
it the more I like it :)

-Ahti Kaukoniemi

(Continue reading)

Jean-Christophe Michel | 2 Sep 2003 18:46
Favicon

Re: simples quotes again

Le mar 19/08/2003 à 03:24, Jason Hines a écrit :
> I *think* this is here because of the way strings are being printed with 
> sprintf.  For example:
> 
> sprintf("foo 'bar'")
> 
> works, but:
> 
> sprintf('foo 'bar'')
> 
> ..obviously won't, so addslashes() added to allow both ' and " chars to 
> be used in the sprintf() call.  I may be wrong on the reasoning, but I 
> think this explains why some strings are being escaped, while others are 
> not.

Would it be possible to use
preg_replace(
         array(  '/"#([a-zA-Z_-\.]+)#"/e',
                 "/'([a-zA-Z_-\.]+)#'/e"),
         array(  '"\"".str_replace("\"", "\\\"", $strings["\1"])."\""',
                 '"\'".str_replace("\'", "\\\'", $strings["\1"])."\'"', 
);
--

-- 
Jean-Christophe Michel <jc.michel@...>
Symétrie
alex black | 2 Sep 2003 23:50

Re: scope of events

I like this a lot. 

> Le mar 26/08/2003 à 17:47, Jason Hines a écrit :
>> What do you think of using events to trigger Debug on BC_EVENT_SHUTDOWN
>> rather than init'ing it as a seperate top-level App?
> 
> Good. Would it mean that debug could be activated by a conf value ?
alex black | 3 Sep 2003 00:05

Re: Propel

Hi all,

caveat: I have just returned from burningman and have not read any mail
"newer" than this, but I'll react:

> * Feature-rich Base classes include methods for fetching related [fkey]
> objects.
> * Convenience methods for performing single queries that join in related
> tables.
> * Cascading save() delete() operations.
> * Related entities are automatically updated (or detached) when foreign
> keys are modified.
> * Entity customizations are written in PHP in entity subclasses.

Excellent.

> Each entity actually consists of 4 classes.  If we define an "author" table
> in the schema file, the following 4 classes will be created:  Author,
> AuthorPeer, BaseAuthor, and BaseAuthorPeer.  The "Peer" classes are static
> classes that handle the actual manipulation of data in the DB (Peer clases
> build the queries, hold the static db map, contain convenience methods like
> doSelectAuthorJoinPublisher() etc.); the other classes (Author, which
> extends BaseAuthor) are the the objects that represent the table rows.  The
> BaseAuthor and BaseAuthorPeer class are auto-generated and will be
> overwritten every time you build; the Author and AuthorPeer classes are
> created as empty subclasses that can override or add new functionality.

All makes sense and is logical.

> building queries and does not use XML/MetaL for entity customization.
(Continue reading)

alex black | 3 Sep 2003 00:09

Re: bc notes / todo

> pdf is a way of printing a page, as html.
> For an invoice it can be a good way to be sure on how it'll be printed.
> I'd like to have a smarty-like way, with tpls and replaced values, to
> generate pdf reports.

Agreed here. PDF is just a different kind of output.

Actually, also....

I would like to ditch Template.php and template abstraction altogether. If
an app is going to use smarty then let it use smarty. The API isn't complex
and I don't see a reason to abstract it.

I think the same goes for PDF, excel, and other libs that generate an output
stream that is to go to the client. No reason to abstract that.

_a
alex black | 3 Sep 2003 00:13

Re: bc notes / todo

> determine how to handle it's own Table ROW display.  Creating individual
> table cells per field proved impossible in some case because of the many
> ways you'll want to display rows.  For example:  Name displays two
> fields: first_name and last_name.  This was done without problem if the
> template is on the row level.

I agree VERY VERY VERY STRONGLY with this. I did one table where tableRow
was the thing that had the template (not each tablecell) and it was
100000000000000 times easier.

> IMO, Libraries handle this fine (PDF, Excel, Image generation).  I don't
> know if using NDF to write PDF,Excel,Images is reasonable.

It absolutely must be. One of the major points of BC is that it is output
stream-agnostic. The render tree should not even be specific to a server
environment. If it is anywhere in the current code we need to slowly work
those specifics out of the node tree. Something which would be helped a lot
I think by separating the node stuff into a package.

> Probably best to handle each type:
> XMLStorage
> FileStorage (would have a seperator defined in conf/Datasources.conf.xml)

I am backing away from this. I don't think it's useful. I.e. If you are
stoing to files you should use a good library that manages that for you.
Perhaps one exists we can adapt for use in BC.

But I think the storage system we use for DBs should be different than XML,
etc. 

(Continue reading)

alex black | 3 Sep 2003 00:16

Re: bc notes / todo

> Yeah, I looked for a pdf smarty plugin.  If htmldoc generates better
> quality PDFs than PHP libs (free) do I'd rather not add the additional
> layer to node.
> 
> The idea of using BC directly from templates is very appealling imo.  It
> reduces much of the load on current entity design.
> 
> For example:
> {$amount|CurrencyFilter}

I would amend this to:

{$amount|FormatCurrency}

Ie. Filters should be used for direct data operations (removing html from
input or output, for example). Where the syntax above should be used to
"format for display" which is a different purpose.

> The way I see to do this is have Node register with smarty output filter
> handler method, and pre-load the (smarty/bc compatible) filters defined
> in NDF.

> Maybe this can be done in SmartyTemplate?  humm

Cool. I think this should be done in the app talking directly with smarty.

_a

Gmane