Slight improvement to automatic field array builder (service tools)

0 views
Skip to first unread message

Alexander Obuhovich

unread,
Dec 23, 2009, 8:56:09 AM12/23/09
to In-Portal Development

I propose to automatically set formatter to the field based on it's name and data type:

  • field's name ends with Date or On then it's kDateFormatter;
  • field's data type is tinyint, then it's sure kOptionsFormatter with Yes/No options.

Imported from wiki, originally suggested by S.G.
Task: http://tracker.in-portal.org/view.php?id=494  (0000494: Slight improvement to automatic field array builder (service tools)).

--
Best Regards,

http://www.in-portal.org
http://www.alex-time.com

Dmitry A.

unread,
Dec 23, 2009, 7:31:56 PM12/23/09
to In-Portal Development
Hi Alex,


Sorry, not to be pain in a butt, but would you please describe this
with a bit more details so we all can get the whole picture?

Currently it's very limited description of functionality we have now
and what we are trying to improve and how it's going to help us and
where.


Thanks!


DA.


On Dec 23, 7:56 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> I propose to automatically set formatter to the field based on it's name and
> data type:
>

>    - field's name ends with Date or On then it's kDateFormatter;
>    - field's data type is tinyint, then it's sure kOptionsFormatter with

Alexander Obuhovich

unread,
Dec 24, 2009, 6:13:04 AM12/24/09
to in-por...@googlegroups.com
When you create new unit config based on database table of course there is need to create Fields definitions. Here is where automatic field builder comes in (see http://guide.in-portal.org/eng/index.php/K4:%D0%9E%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5_%D0%BF%D0%BE%D0%BB%D0%B5%D0%B9_%D1%82%D0%B0%D0%B1%D0%BB%D0%B8%D1%86%D1%8B#Automatic%20Structuring). For now there is simple formatter detection method, but I propose to advance it a bit to save time for developer each time it creates a new unit config or adds new fields to existing one.

--

You received this message because you are subscribed to the Google Groups "In-Portal Development" group.
To post to this group, send email to in-por...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-dev?hl=en.


Dmitry A.

unread,
Jan 4, 2010, 12:07:07 AM1/4/10
to In-Portal Development
OK, this sounds reasonable!

On Dec 24 2009, 5:13 am, Alexander Obuhovich <aik.b...@gmail.com>
wrote:


> When you create new unit config based on database table of course there is
> need to create Fields definitions. Here is where automatic field builder

> comes in (seehttp://guide.in-portal.org/eng/index.php/K4:%D0%9E%D0%BF%D0%B8%D1%81%...).


> For now there is simple formatter detection method, but I propose to advance
> it a bit to save time for developer each time it creates a new unit config
> or adds new fields to existing one.
>
>
>
> On Thu, Dec 24, 2009 at 2:31 AM, Dmitry A. <dandre...@gmail.com> wrote:
> > Hi Alex,
>
> > Sorry, not to be pain in a butt, but would you please describe this
> > with a bit more details so we all can get the whole picture?
>
> > Currently it's very limited description of functionality we have now
> > and what we are trying to improve and how it's going to help us and
> > where.
>
> > Thanks!
>
> > DA.
>
> > On Dec 23, 7:56 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> > > I propose to automatically set formatter to the field based on it's name
> > and
> > > data type:
>
> > >    - field's name ends with Date or On then it's kDateFormatter;
> > >    - field's data type is tinyint, then it's sure kOptionsFormatter with
> > >    Yes/No options.
>
> > > Imported from wiki, originally suggested by S.G.

> > > Task:http://tracker.in-portal.org/view.php?id=494(0000494: Slight


> > > improvement to automatic field array builder (service tools)).
>
> > > --
> > > Best Regards,
>
> > >http://www.in-portal.orghttp://www.alex-time.com
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "In-Portal Development" group.
> > To post to this group, send email to in-por...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > in-portal-de...@googlegroups.com<in-portal-dev%2Bunsu...@googlegroups.com>

Nikita

unread,
Jan 19, 2010, 11:19:24 AM1/19/10
to In-Portal Development Team
I really like this idea, the only thing i would like to change is the
way how the config processor should detect whether formatter should be
automatically applied and which one exactly.
Offered method is convenient enough when you always remember about
that, but if you suddenly forgot about that - "strange" things may
happen as this method is absolutely "silent" (at least given
description of this new feature makes me think so), it doesnt inform
you at all.
So, for example when i have field named "occupatiON" i definetly do
not want it to became kDateFormatt-ed.
I would rather suggest to make this functionality catch up to the
"type" parameter, for example:
type=date, then => dynamically rewrite type to int: type=int,
formatter=kDateFormatted, default=#NOW#...;
type=image or type=file, then => dynamically rewrite type to string:
type=string, max_len=255, formatter=kUploadFormatted;
And so on...

On Dec 23 2009, 3:56 pm, Alexander Obuhovich <aik.b...@gmail.com>
wrote:


> I propose to automatically set formatter to the field based on it's name and
> data type:
>

>    - field's name ends with Date or On then it's kDateFormatter;
>    - field's data type is tinyint, then it's sure kOptionsFormatter with

Dmitry Andrejev

unread,
Jan 19, 2010, 11:28:46 AM1/19/10
to in-por...@googlegroups.com
Thanks for your input Nikita!

It's always good to have additional opinions.

Now, I guess we can name this Prefix config Type Validation method or something?

Alex what you think?

Cheers!

DA.

--
You received this message because you are subscribed to the Google Groups "In-Portal Development Team" group.

To post to this group, send email to in-por...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-de...@googlegroups.com.

Alexander Obuhovich

unread,
Jan 19, 2010, 11:31:59 AM1/19/10
to in-por...@googlegroups.com
I don't think, that we need to invent new field types, because this would be duplicate functionality related to formatters. In real life only developer knows what formatter should be applied to which field and config builder only tries to guess that. At the end developer should review each field declaration in case, because he should set required marks and so on. In time we could add more and more guessing rules and exceptions, so guessing will became more accurate.

--
You received this message because you are subscribed to the Google Groups "In-Portal Development Team" group.
To post to this group, send email to in-por...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-dev?hl=en.






--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry Andrejev

unread,
Jan 19, 2010, 9:54:33 PM1/19/10
to in-por...@googlegroups.com
Nikita even your idea is not that bad, I think Alex is right here.

The proposed logic will make developers to remember and start using wrong Data types while we barely have 5 or 6 all together.

One other nice idea would be to have description of the Formatters (link to it) handy. This can be done later of course.

What do think on this?


DA

On Tue, Jan 19, 2010 at 10:19 AM, Nikita <ingu...@gmail.com> wrote:

Alexander Obuhovich

unread,
Jan 20, 2010, 3:14:30 AM1/20/10
to in-por...@googlegroups.com
Description of all formatters already exists at http://guide.in-portal.org/rus/index.php/K4:Formatters page.

Dmitry A.

unread,
Jan 20, 2010, 4:55:04 PM1/20/10
to In-Portal Development Team
True!

We'll be complete the truslation of this apge to English (from
Russian) and I propose to add all those super useful Article to have
linked on System tools page so developers don't have to go far once
they need it.

http://guide.in-portal.org/eng/index.php/K4:Formatters

Comments?

On Jan 20, 2:14 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> Description of all formatters already exists athttp://guide.in-portal.org/rus/index.php/K4:Formatterspage.
>

> On Wed, Jan 20, 2010 at 4:54 AM, Dmitry Andrejev <dandre...@gmail.com>wrote:
>
>
>
>
>
> > Nikita even your idea is not that bad, I think Alex is right here.
>
> > The proposed logic will make developers to remember and start using wrong
> > Data types while we barely have 5 or 6 all together.
>
> > One other nice idea would be to have description of the Formatters (link to
> > it) handy. This can be done later of course.
>
> > What do think on this?
>
> > DA
>

> >> > Task:http://tracker.in-portal.org/view.php?id=494(0000494: Slight


> >> > improvement to automatic field array builder (service tools)).
>
> >> > --
> >> > Best Regards,
>
> >> >http://www.in-portal.orghttp://www.alex-time.com
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "In-Portal Development Team" group.
> >> To post to this group, send email to in-por...@googlegroups.com.
> >> To unsubscribe from this group, send email to

> >> in-portal-de...@googlegroups.com<in-portal-dev%2Bunsubscribe@goog legroups.com>


> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/in-portal-dev?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "In-Portal Development Team" group.
> > To post to this group, send email to in-por...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > in-portal-de...@googlegroups.com<in-portal-dev%2Bunsubscribe@goog legroups.com>

Reply all
Reply to author
Forward
0 new messages