Article View: ibm.software.vajava.beans
Article #24Re: Customize bean extending Commerce Bean
From: geo
Date: Wed, 24 Apr 2002 21:32
Date: Wed, 24 Apr 2002 21:32
88 lines
4365 bytes
4365 bytes
The queries are returned by sequence number ordering implicitly, I would prefer
to be able to change that but you can easily do forward and reverse order any
customer ordering would require your own new finder.
Set the sequence numbers in the cattogrp for root categories and in the
catgrprel for subcategories and they should show up in the correct order in your
display.
Automagically.
:-)
geo
Anthony Pomtree wrote:
> In my JSP (for category display) I have the following:
>
> <jsp:useBean id="category"
> class="com.ibm.commerce.catalog.beans.CategoryDataBean" scope="page">
> <%
> category.setCategoryId(categoryId);
> category.setCatalogId(catalogId);
> com.ibm.commerce.beans.DataBeanManager.activate(category, request);
> %>
> </jsp:useBean>
>
> CategoryDataBean subcats[], cat;
> subcats = category.getSubCategories();
>
> <%
> for (int i = 0; i < subcats.length; ++i)
> {
> cat = subcats[i];
> if (cat.getDescription().getPublished().equals("1"))
> {
> %>
> <tr><td><div align="right"><font face="Arial" size="-2" class="linkstyle">
> <a href="blah.html"
> class="linkstyle"><%=cat.getDescription().getName()%></a></font></div>
> </td></tr>
> <%
> }
> }
> %>
>
> ----------------------------------------------------------------------------
> -------------------
>
> I need to be able to sort these by their sequence number, but from what I
> can
> see the sequence number is not something that can be gotten through any
> getter.
> So my thinking was I need to create a customized bean that extended
> CategoryDataBean... or something along those lines. Am I just thinking
> wrong
> or is there another way to handle this?
>
> Thanks.
>
> "Thomas Tolborg" <news@tolborg.dk> wrote in message
> news:aa7065$19ns$1@news.boulder.ibm.com...
> > "Anthony Pomtree" <apomtree@yahoo.com> wrote in message
> > news:aa6oeu$165a$1@news.boulder.ibm.com...
> > > Trying to set up shopping page that pulls back list of categories from
> > > DB2 table. Process works fine, but I need to customize and add a
> > > field (sequence number) so I can have the categories sorted based
> > > on a sequence number on the table. I assume I need to create my
> > > own custom bean that extends a current data bean in order to be able
> > > to sort on the sequence number. If this is correct, could someone
> > > please give a little (actually a lot) of insight on this... if this is
> not
> > > the
> > > case, could you please set me straight.
> > >
> > > Thanks.
> > >
> > > p.s. Examples would be most appreciative.
> > >
> >
> > What is it exactly that you want to do. There is already a sequence column
> > on the relationtables (CATGRPREL, CATTOGRP, CATGPENREL).
> >
> > Remember that if you uses the sequence column, then you are forced to sort
> > the categories the same way in every language, which might not be a good
> > idea.
> >
> > /Thomas Tolborg
> >
> >
Technical Details
Message-ID:
<3CC723D1.B1673AFB@eglobal-sol.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!cox.net!news2.east.cox.net.POSTED!53ab2750!not-for-mailReferences:
<aa6oeu$165a$1@news.boulder.ibm.com> <aa7065$19ns$1@news.boulder.ibm.com> <aa766v$1484$1@news.boulder.ibm.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f4581,8a31c3a56595988c X-Google-Attributes: gidf4581,public X-Google-Thread: 109e56,8a31c3a56595988c X-Google-Attributes: gid109e56,public X-Google-Thread: 109b1c,8a31c3a56595988c X-Google-Attributes: gid109b1c,public X-Google-Thread: 110ea8,8a31c3a56595988c X-Google-Attributes: gid110ea8,public X-Google-ArrivalTime: 2002-04-24 14:32:16 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!cox.net!news2.east.cox.net.POSTED!53ab2750!not-for-mail Message-ID: <3CC723D1.B1673AFB@eglobal-sol.com> From: geo <george@eglobal-sol.com> X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: ibm.software.vajava.beans,ibm.software.vajava.enterprise,ibm.software.vajava.enterprise.wte,ibm.software.websphere.commerce-suite Subject: Re: Customize bean extending Commerce Bean References: <aa6oeu$165a$1@news.boulder.ibm.com> <aa7065$19ns$1@news.boulder.ibm.com> <aa766v$1484$1@news.boulder.ibm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 89 Date: Wed, 24 Apr 2002 21:32:13 GMT NNTP-Posting-Host: 68.7.207.172 X-Complaints-To: abuse@cox.net X-Trace: news2.east.cox.net 1019683933 68.7.207.172 (Wed, 24 Apr 2002 17:32:13 EDT) NNTP-Posting-Date: Wed, 24 Apr 2002 17:32:13 EDT Organization: Cox Communications