|
From: Peter S. <co...@pe...> - 2007-11-30 07:25:04
|
Hi Roberto,
Your concern about the complexity and performance is very important. The
suggested xml would solve the case, but as you say would lay very heavy
processing on the client. Another concern is that I just remembered that the
xml parser is not default in java 1.5 (comes with java6), which also means
that the applets will be much larger (xml parsing libraries are big). We
still have to support java5 since java6 is not yet supported by default in
Mac OSX.
At this point my need is to be able to set a criteria for one column, and
it's sufficient that the string matches - so I don't really need at this
point the possibility to match complex conditions. Could maybe be solved
using a properties file, but if we then in the future decides to go for more
complex matches, xml is a much better configuration scheme.
Another way, that I just thought about is to put the logic for setting
colors on the server, and rather introduce a MetaDataType just like the
media column, but instead let the value be a color. Just like you recognize
multimedia columns, you'd then recognize a "color column" and use the
information from this to set the color of the row. How do you think this
would work?
regards,
Peter
On Nov 29, 2007 6:43 PM, Roberto Milev <rob...@gm...> wrote:
> Hi Peter,
>
> Making a configuration file like this:
>
> <color-renderer>
> <metadata-id priority="1">
> <id>1006</id>
> <condition>
> <value>3309</value>
> <relation>eq</relation>
> <color>red</color>
> </condition>
> <condition>
> <value>3310</value>
> <relation>eq</relation>
> <color>red</color>
> </condition>
> <combine-type>or</combine-type>
> </metadata-id>
> <metadata-id priority="1">
> <id>1006</id>
> <condition>
> <value>3300</value>
> <relation>gt</relation>
> <color>yellow</color>
> </condition>
> <condition>
> <value>3310</value>
> <relation>lt</relation>
> <color>yellow</color>
> </condition>
> <combine-type>and</combine-type>
> </metadata-id>
> <metadata-id priority="1">
> <id>1006</id>
> <condition>
> <value>3300</value>
> <relation>lt</relation>
> <color>blue</color>
> </condition>
> <condition>
> <value>3310</value>
> <relation>gt</relation>
> <color>green</color>
> </condition>
> <combine-type>none</combine-type>
> </metadata-id>
> </color-renderer>
>
> would solve all possibilities for making a complicated conditions, for
> example this xml file sets the row color to red if its 1006 column has value
> of 3309 or 3310, yellow if the column value is in range of 3300 to 3310,
> green if value is greater than 3310 or blue if less than 3300, where the
> exact value ("eq" relation condition) has superiority when setting the
> color if two conditions overlap. If another metadataId is compared, then
> superiority will be given to the metadataId containing greater priority
> attribute in the config file. A static method (getting all row values in a
> list) will be created that will decide and return what color should be used
> for the row. The only thing that concerns me here is the speed of the
> application when big conditions are created, or there are a lot of table
> rows, because the color checking operation will be performed for each row.
>
> Regards,
> Roberto
>
>
> On Nov 29, 2007 3:41 AM, Peter Salomonsen <co...@pe...>
> wrote:
>
> > Hi Roberto,
> >
> > The basic need is to be able to set a color for the entire row based on
> > a value in a column. So the configuration would basically be to set a
> > metadata-id, and set a criteria for matching a value. You should be able to
> > set up multiple criterias that each assigns to a separate color for the
> > entire row.
> >
> > I've done some thinking and found that it's possibly better to skip the
> > idea of having custom renderers. In the future we can look at possibilities
> > for referencing custom rendereres in the defaultrenderer config file. But
> > until then you can put the color-config logic and the mms play buttons in
> > the default renderer. So we'll just use the current CustomRenderer as a
> > default renderer.
> >
> > Would you start looking at a color configuration like described above?
> >
> > regards,
> >
> > Peter
> >
> >
> > On Nov 28, 2007 5:45 PM, Roberto Milev < rob...@gm...> wrote:
> >
> > > Hi Peter,
> > >
> > > Read comments inline.
> > >
> > > Regards,
> > > Roberto
> > >
> > > On Nov 26, 2007 7:41 AM, Peter Salomonsen <co...@pe...>
> > > wrote:
> > >
> > > > Hi Roberto,
> > > >
> > > > I've looked at your CustomTableCellRenderer and see that you've put
> > > > the multimedia play button in there. At the same time I'm in the process of
> > > > creating another CustomTableCellRenderer for another project.
> > > >
> > > > The purpose of the tablecell renderer is to able to plug in your
> > > > own, but this won't work default logic is stored in CustomTableCellRenderer
> > > > (which will be replaced in other projects). If this class grows with default
> > > > logic - then there will be a lot I have to paste into other custom
> > > > renderers, and especially when talking about upgrades it will be hard to
> > > > maintain.
> > > >
> > > > Today I invoke getViewerTable().setDefaultRenderer() on a
> > > > MetaDataLogViewer object to replace the default renderer. If the multimedia
> > > > play button needs to be triggered from the renderer, then we maybe need to
> > > > introduce a default renderer that is always there - and this default
> > > > renderer can invoke another custom renderer.
> > > >
> > >
> > > This can be done, by creating a configuration file that can map the
> > > cell types to a specific renderer, for example for multimedia context a
> > > MultimediaRenederer can be mapped, and when the default renderer will be
> > > called than the getTableCellRendererComponent method will check the mapping
> > > and call the appropriate MultimediaRenederer.getTableCellRendererComponent.
> > > If no mapping is present, than the default renderer will be called. Shoud I
> > > start working on this?
> > >
> > >
> > > >
> > > > In addition to this design issue, I'm also considering a way to
> > > > configure basic rendering properties, such as background colors. If we
> > > > introduce a default renderer, then it might be possible to have a
> > > > configuration mechanism for this renderer ( e.g. an xml file), where
> > > > you also could configure colors based on search results values... If one was
> > > > to have specific behaviours this xml could reference class names that
> > > > contained the behavior logic...
> > > >
> > >
> > > I have problems understanding this concept, can you describe your idea
> > > in more details. For example: what will be the condition to make a decision
> > > on what color to use?
> > >
> > >
> > > >
> > > > Could you look at such a configuration mechanism, give a config file
> > > > proposal, and setup an example in the AirportWatch project?
> > > >
> > > > regards,
> > > >
> > > > Peter
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Regards,
> > > Roberto Milev
> >
> >
> >
>
>
> --
> Regards,
> Roberto Milev
|
|
From: Peter S. <co...@pe...> - 2007-12-12 11:09:27
|
---------- Forwarded message ---------- From: Peter Salomonsen <co...@pe...> Date: Dec 12, 2007 11:08 AM Subject: Re: CustomTableCellRenderer To: Roberto Milev <rob...@gm...>, lma...@li... Hi Roberto, Sorry for all the mess with the project files.. I had to recreate them for the web project - but it seems ok now. I've done a clean checkout from Netbeans, opened the AirportWatchProject and the subprojects (AirportWatch-ejb and AirportWatch-war), and then done "Clean and Build". I end up with the ear as attached. Then I do this: peter@powow:~/NetBeansProjects/openmam/AirportWatch$ /home/peter/glassfish-v2/bin/asadmin deploy /home/peter/NetBeansProjects/AirportWatch/dist/AirportWatch.ear Please enter the admin user name>admin Please enter the admin password>adminadmin Command deploy executed successfully with following warning messages: WARNING: (And then a lot of warnings......) Check it out now.. And see if it works. regards, Peter On Dec 11, 2007 7:46 PM, Peter Salomonsen <co...@pe...> wrote: > Hi Roberto, > > Seems like there's a mismatch with svn and my local copy.. I'll try to > figure out what it is and I'll come back to you tomorrow.. > > regards, > > Peter > > > On Dec 11, 2007 5:16 PM, Roberto Milev <rob...@gm...> wrote: > > > Hi Peter, > > > > I finally made the ear, now building is OK. However the database is now > > empty and I get null pointer exception error when running the applet (web or > > through launcher). I tried to call ImportServlet before, but the following > > exception occures: > > > > javax.servlet.ServletException: PWC1397: Wrapper cannot find servlet class openmam.examples.airportwatch.importer.ImportServlet or a class it depends on > > > > *root cause* > > > > java.lang.ClassNotFoundException > > > > > > > > : openmam.examples.airportwatch.importer.ImportServlet > > > > I opened the ear and the apropriate war, but there is no ImportServlet > > class in there. I think that something is wrong with the ant build. I > > checked the local build folder and the ImportServlet is not compiled either. > > Am I making some deploying mistake again or should I seek the problem and > > fix it? > > > > Regards, > > Roberto > > > > > > On Dec 11, 2007 1:09 AM, Peter Salomonsen <co...@pe... > > > wrote: > > > > > Hi Roberto, > > > > > > I've removed the capeclear webservice, cause I found problems with > > > it.. I'm now using a text file of stations that I parse from. The > > > temperatures however are live from NOAA.. > > > > > > I'm thinking that for this example, we could color the rows using the > > > temperature to pick a color on this scale... : > > > > > > http://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Color_temperature.svg/578px-Color_temperature.svg.png > > > > > > > > > Looking forward to see the colored example.. :) > > > > > > regards, > > > > > > Peter > > > > > > > > > On Dec 11, 2007 4:23 AM, Roberto MIlev < rob...@gm... > > > > wrote: > > > > > > > Hi Peter, > > > > > > > > I am currently looking into that. I will let you know once I commit > > > > the > > > > changes. > > > > > > > > Regards, > > > > Roberto > > > > > > > > Peter Salomonsen wrote: > > > > > Hi Roberto, > > > > > > > > > > Have you committed to the Airport-Watch project too? I couldn't > > > > see > > > > > that you've done that... > > > > > > > > > > regards, > > > > > > > > > > Peter > > > > > > > > > > On Dec 10, 2007 8:34 AM, Roberto MIlev < rob...@gm... > > > > > <mailto:rob...@gm...>> wrote: > > > > > > > > > > Hi Peter, > > > > > > > > > > Please note that all the requested changed are implemented and > > > > > > > > > committed. > > > > > > > > > > Regards, > > > > > Roberto > > > > > > > > > > Peter Salomonsen wrote: > > > > > > > > > > > > > > > > > > On Dec 5, 2007 5:26 AM, Roberto MIlev < > > > > rob...@gm... > > > > > <mailto:rob...@gm...> > > > > > > <mailto: rob...@gm... > > > > > <mailto:rob...@gm...>>> wrote: > > > > > > > > > > > > Hi Peter, > > > > > > > > > > > > The row painting capability is done on the eclipse svn > > > > project. > > > > > > You can > > > > > > test the capability by adding the following row to > > > > database: > > > > > > > > > > > > > > > > > > You can actually use eclipse or netbeans for > > > > lmappletserver-addons, > > > > > > I've also committed netbeans-project settings.. Whatever > > > > works > > > > > best.. > > > > > > > > > > > > > > > > > > > > > > > > insert into > > > > > > > > > > > > > > > `metadata`(`meta_id`,`name`,`context`,`priority`,`dataType`,`object_class_name`,`created`,`updated`,`searchProperty`,`numericValue`) > > > > > > > > > > > > > > > > > > > > > values (1016,'1006=3309:#FF00FF[Test]','',10,'',' > > > > > > > > > > > com.lightminds.appletserver.examples.metalog.Vehicle','2006-01-31 > > > > > > > > > > 12:06:14','2006-01-31 12:06:14','','\0') > > > > > > > > > > > > or edit existing metadata name by setting the conditions > > > > and its > > > > > > existing name like: 1006=3309:#FF00FF[speed] > > > > > > > > > > > > > > > > > > Very good. I found a small weakness by placing the text > > > > inside the > > > > > > brackets, since you won't be able to search the text unless > > > > the > > > > > field > > > > > > starts with it. Maybe we could change the format so that it > > > > is: > > > > > > Test[1006=3309:#FF00FF] ?? > > > > > > > > > > > > > > > > > > The painting is done row by row as you requested, > > > > however > > > > > during > > > > > > development I noticed that it might be useful if it is > > > > done > > > > > cell by > > > > > > cell. I made a TODO comment in CustomTableCellRenderer > > > > class > > > > > where you > > > > > > can change this behavior. > > > > > > > > > > > > > > > > > > At this moment I want to color the whole row. BTW. I can > > > > still see > > > > > > that the hardcoded color setting when "valuetocheck" equals > > > > "". > > > > > Maybe > > > > > > this should be removed now? > > > > > > > > > > > > > > > > > > For the netbeans project, I get the following error when > > > > calling > > > > > > dist on > > > > > > the projects ant: > > > > > > > > > > > > > > > > > > Seems like the web service reference has to be refreshed > > > > every time > > > > > > the project is loaded onto a new machine. Inside the > > > > > AirportWatch-war > > > > > > subproject, expand web service references and right click > > > > on the > > > > > > GlobalWeather reference. Choose "refresh client". > > > > > > > > > > > > now ant dist should work. > > > > > > > > > > > > regards, > > > > > > > > > > > > Peter > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Peter Salomonsen wrote: > > > > > > > > > > > > > > > > > > > > > On Dec 2, 2007 8:13 PM, Roberto MIlev < > > > > > rob...@gm... <mailto: rob...@gm...> > > > > > > <mailto:rob...@gm... > > > > > <mailto: rob...@gm... >> > > > > > > > <mailto: rob...@gm... > > > > > <mailto:rob...@gm... > > > > > > > <mailto: rob...@gm... > > > > > <mailto:rob...@gm...>>>> wrote: > > > > > > > > > > > > > > Hi Peter, > > > > > > > > > > > > > > I think that's a great idea, will add a metadata > > > > > column with > > > > > > data type > > > > > > > bgcolor (for example) and value like > > > > "1006=3309:red" or > > > > > > > "1006=3309:#3366aa". It is easy to implement and > > > > > maintain. I > > > > > > think > > > > > > > this > > > > > > > is the simplest yet efficient way. Can I start > > > > > implementing it? > > > > > > > > > > > > > > > > > > > > > Yes. I suppose you then mean the format: > > > > > MetadataID=Value:Color, > > > > > > and > > > > > > > these columns has a bgcolor datatype. This should > > > > color > > > > > the entire > > > > > > > row. In order to display some text - for the actual > > > > column > > > > > that it > > > > > > > creates, I also suggest that you can add this: > > > > > > > > > > > > > > MetaDataID=Value:Color[CustomText] > > > > > > > > > > > > > > an example: > > > > > > > > > > > > > > 1006=3309:#3366aa[Break in attempt] > > > > > > > > > > > > > > > > > > > > > I deployed the AirportWatch project but there are > > > > no > > > > > pages like > > > > > > > metalog, > > > > > > > should I put them my self in the project locally? > > > > > > > > > > > > > > > > > > > > > If you have run "ant dist" on the project root (which > > > > is > > > > > > > > > > > > > > > > > > > > > > https://openmam.svn.sourceforge.net/svnroot/openmam/examples/AirportWatch/ > > > > > > < > > > > > https://openmam.svn.sourceforge.net/svnroot/openmam/examples/AirportWatch/ > > > > >), > > > > > > > you should have got a "dist" folder that contains > > > > > AirportWatch.ear. > > > > > > > This file should then contain AirportWatch-war.war and > > > > > other ejb jar > > > > > > > files (AirportWatch, lmappletserver-addons ++).. The > > > > war > > > > > archive > > > > > > > contains a metalog applet in index.jsp - so there > > > > should > > > > > be no need > > > > > > > for you to add any additional pages. I don't know why > > > > you > > > > > don't find > > > > > > > this - but could you tell me how you deployed the > > > > project, > > > > > and I'll > > > > > > > try to sort out what might be wrong.. > > > > > > > > > > > > > > regards, > > > > > > > > > > > > > > Peter > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > Regards, > > Roberto Milev > > > |
|
From: Roberto M. <rob...@gm...> - 2007-12-02 19:14:05
|
Hi Peter,
I think that's a great idea, will add a metadata column with data type
bgcolor (for example) and value like "1006=3309:red" or
"1006=3309:#3366aa". It is easy to implement and maintain. I think this
is the simplest yet efficient way. Can I start implementing it?
I deployed the AirportWatch project but there are no pages like metalog,
should I put them my self in the project locally?
Regards,
Roberto
Peter Salomonsen wrote:
> Hi Roberto,
>
> Your concern about the complexity and performance is very important.
> The suggested xml would solve the case, but as you say would lay very
> heavy processing on the client. Another concern is that I just
> remembered that the xml parser is not default in java 1.5 (comes with
> java6), which also means that the applets will be much larger (xml
> parsing libraries are big). We still have to support java5 since java6
> is not yet supported by default in Mac OSX.
>
> At this point my need is to be able to set a criteria for one column,
> and it's sufficient that the string matches - so I don't really need
> at this point the possibility to match complex conditions. Could maybe
> be solved using a properties file, but if we then in the future
> decides to go for more complex matches, xml is a much better
> configuration scheme.
>
> Another way, that I just thought about is to put the logic for setting
> colors on the server, and rather introduce a MetaDataType just like
> the media column, but instead let the value be a color. Just like you
> recognize multimedia columns, you'd then recognize a "color column"
> and use the information from this to set the color of the row. How do
> you think this would work?
>
> regards,
>
> Peter
>
> On Nov 29, 2007 6:43 PM, Roberto Milev <rob...@gm...
> <mailto:rob...@gm...>> wrote:
>
> Hi Peter,
>
> Making a configuration file like this:
>
> <color-renderer>
> <metadata-id priority="1">
> <id>1006</id>
> <condition>
> <value>3309</value>
> <relation>eq</relation>
> <color>red</color>
> </condition>
> <condition>
> <value>3310</value>
> <relation>eq</relation>
> <color>red</color>
> </condition>
> <combine-type>or</combine-type>
> </metadata-id>
> <metadata-id priority="1">
> <id>1006</id>
> <condition>
> <value>3300</value>
> <relation>gt</relation>
> <color>yellow</color>
> </condition>
> <condition>
> <value>3310</value>
> <relation>lt</relation>
> <color>yellow</color>
> </condition>
> <combine-type>and</combine
> -type>
> </metadata-id>
> <metadata-id priority="1">
> <id>1006</id>
> <condition>
> <value>3300</value>
> <relation>lt</relation>
> <color>blue</color>
> </condition>
> <condition>
> <value>3310</value>
> <relation>gt</relation>
> <color>green</color>
> </condition>
> <combine-type>none</combine-type>
> </metadata-id>
> </color-renderer>
>
> would solve all possibilities for making a complicated conditions,
> for example this xml file sets the row color to red if its 1006
> column has value of 3309 or 3310, yellow if the column value is in
> range of 3300 to 3310, green if value is greater than 3310 or blue
> if less than 3300, where the exact value ("eq" relation condition)
> has superiority when setting the color if two conditions overlap.
> If another metadataId is compared, then superiority will be given
> to the metadataId containing greater priority attribute in the
> config file. A static method (getting all row values in a list)
> will be created that will decide and return what color should be
> used for the row. The only thing that concerns me here is the
> speed of the application when big conditions are created, or there
> are a lot of table rows, because the color checking operation will
> be performed for each row.
>
> Regards,
> Roberto
>
>
> On Nov 29, 2007 3:41 AM, Peter Salomonsen <
> co...@pe... <mailto:co...@pe...>>
> wrote:
>
> Hi Roberto,
>
> The basic need is to be able to set a color for the entire row
> based on a value in a column. So the configuration would
> basically be to set a metadata-id, and set a criteria for
> matching a value. You should be able to set up multiple
> criterias that each assigns to a separate color for the entire
> row.
>
> I've done some thinking and found that it's possibly better to
> skip the idea of having custom renderers. In the future we can
> look at possibilities for referencing custom rendereres in the
> defaultrenderer config file. But until then you can put the
> color-config logic and the mms play buttons in the default
> renderer. So we'll just use the current CustomRenderer as a
> default renderer.
>
> Would you start looking at a color configuration like
> described above?
>
> regards,
>
> Peter
>
>
> On Nov 28, 2007 5:45 PM, Roberto Milev <
> rob...@gm... <mailto:rob...@gm...>> wrote:
>
> Hi Peter,
>
> Read comments inline.
>
> Regards,
> Roberto
>
> On Nov 26, 2007 7:41 AM, Peter Salomonsen
> <co...@pe...
> <mailto:co...@pe...>> wrote:
>
> Hi Roberto,
>
> I've looked at your CustomTableCellRenderer and see
> that you've put the multimedia play button in there.
> At the same time I'm in the process of creating
> another CustomTableCellRenderer for another project.
>
> The purpose of the tablecell renderer is to able to
> plug in your own, but this won't work default logic is
> stored in CustomTableCellRenderer (which will be
> replaced in other projects). If this class grows with
> default logic - then there will be a lot I have to
> paste into other custom renderers, and especially when
> talking about upgrades it will be hard to maintain.
>
> Today I invoke getViewerTable().setDefaultRenderer()
> on a MetaDataLogViewer object to replace the default
> renderer. If the multimedia play button needs to be
> triggered from the renderer, then we maybe need to
> introduce a default renderer that is always there -
> and this default renderer can invoke another custom
> renderer.
>
>
> This can be done, by creating a configuration file that
> can map the cell types to a specific renderer, for example
> for multimedia context a MultimediaRenederer can be
> mapped, and when the default renderer will be called than
> the getTableCellRendererComponent method will check the
> mapping and call the appropriate
> MultimediaRenederer.getTableCel
> lRendererComponent. If no mapping is present, than the
> default renderer will be called. Shoud I start working on
> this?
>
>
>
> In addition to this design issue, I'm also considering
> a way to configure basic rendering properties, such as
> background colors. If we introduce a default renderer,
> then it might be possible to have a configuration
> mechanism for this renderer ( e.g. an xml file), where
> you also could configure colors based on search
> results values... If one was to have specific
> behaviours this xml could reference class names that
> contained the behavior logic...
>
>
> I have problems understanding this concept, can you
> describe your idea in more details. For example: what will
> be the condition to make a decision on what color to use?
>
>
>
> Could you look at such a configuration mechanism, give
> a config file proposal, and setup an example in the
> AirportWatch project?
>
> regards,
>
> Peter
>
>
>
>
>
> --
> Regards,
> Roberto Milev
>
>
>
>
>
> --
> Regards,
> Roberto Milev
>
>
|