You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Vitaly Baranovsky <vi...@gmail.com> on 2006/10/02 20:08:41 UTC

How can I store preference with length more then 254 symbols?

Good day!

I've written html-portlet, which simply shows html entered in edit mode. But
when I enter text in textarea with more than 254 symbols length, I have
javax.portlet.PortletModeException when store this text in preference.

How can I write portlet that stores long text (more than 254 symbols
length)?

Thanks!

With best regards,
Vitaly Baranovsky.

P.S.: Sorry for my bad English

Re: How can I store preference with length more then 254 symbols?

Posted by "Marc F." <ma...@gmail.com>.

Vitaly Baranovsky-3 wrote:
> 
> Good day!
> 
> I've written html-portlet, which simply shows html entered in edit mode.
> But
> when I enter text in textarea with more than 254 symbols length, I have
> javax.portlet.PortletModeException when store this text in preference.
> 
> How can I write portlet that stores long text (more than 254 symbols
> length)?
> 
> Thanks!
> 
> With best regards,
> Vitaly Baranovsky.
> 
> P.S.: Sorry for my bad English
> 

Well, I agree that 254 is not sufficient. It could be a bit more, maybe 500
is enough. But, by the way, we should never forget the specification, that
says:

"Portlet preferences are intended to store basic configuration data for
portlets. It is not the purpose of the portlet preferences to replace
general purpose databases."


Marc F.
-- 
View this message in context: http://www.nabble.com/How-can-I-store-preference-with-length-more-then-254-symbols--tf2371519.html#a7220715
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How can I store preference with length more then 254 symbols?

Posted by Vitaly Baranovsky <vi...@gmail.com>.
I have changed entries in  prefs_repository.xml to:
</field-descriptor>
           <field-descriptor
               name="propertyValue"
               column="PROPERTY_VALUE"
               jdbc-type="CLOB"
               nullable="true"
               length="1048576"
           >

and I have changed field PROPERTY_VALUE to CLOB(1048576). Now I can store
Preferences with length more than 254 but less then 8193 bytes. When I store
preference with 8192 bytes length all is ok. But when I try to store
preference with 8193 bytes length, I have still the same error: "public void
net.liga.portal.htmlportlet.Edit.doAction() throws
javax.portlet.PortletModeException' on $Edit_22@16a6c70[Edit]: Value too
long".

Why?? Why do I have 8192 bytes limit now? What can I do to store preferences
with unlimited size?


2006/10/3, David Sean Taylor <da...@bluesunrise.com>:
>
> >
> > 2006/10/3, Stephen Greenlee <sg...@gmail.com>:
> >
> >>
> >> Vitaly,
> >>
> >> We also set "PROPERTY_VALUE" of type BLOB for the same reason. I think
> >> that you can do so without any problem.
> >>
> >> Stephen
> >>
> >> On 10/3/06, Vitaly Baranovsky <vi...@gmail.com> wrote:
> >> > Hmm... Maybe, making column "PROPERTY_VALUE" of type BLOB would be
> >> better
> >> > decision? Because there can be preference with big length. And
> >> length of
> >> > preference doesn't limited in JSR-168 specification. How do you
> think?
> >> >
>
> Changing the column data type will require a change to the jdbc-type om
> the object-relational mapping file prefs_repository.xml found inside the
> prefs jar:
>
>            </field-descriptor>
>            <field-descriptor
>                name="propertyValue"
>                column="PROPERTY_VALUE"
>                jdbc-type="VARCHAR"
>                nullable="true"
>                length="254"
>            >
>
> Hopefully it supports mapping CLOB onto java.lang.String, it should
> Also, you will want to experiment with changing and removing the length
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: How can I store preference with length more then 254 symbols?

Posted by David Sean Taylor <da...@bluesunrise.com>.
> 
> 2006/10/3, Stephen Greenlee <sg...@gmail.com>:
> 
>>
>> Vitaly,
>>
>> We also set "PROPERTY_VALUE" of type BLOB for the same reason. I think
>> that you can do so without any problem.
>>
>> Stephen
>>
>> On 10/3/06, Vitaly Baranovsky <vi...@gmail.com> wrote:
>> > Hmm... Maybe, making column "PROPERTY_VALUE" of type BLOB would be
>> better
>> > decision? Because there can be preference with big length. And 
>> length of
>> > preference doesn't limited in JSR-168 specification. How do you think?
>> >

Changing the column data type will require a change to the jdbc-type om 
the object-relational mapping file prefs_repository.xml found inside the 
prefs jar:

	    </field-descriptor>
	    <field-descriptor
	        name="propertyValue"
	        column="PROPERTY_VALUE"
	        jdbc-type="VARCHAR"
	        nullable="true"
	        length="254"
	    >

Hopefully it supports mapping CLOB onto java.lang.String, it should
Also, you will want to experiment with changing and removing the length


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How can I store preference with length more then 254 symbols?

Posted by Vitaly Baranovsky <vi...@gmail.com>.
I have changed type of field "PROPERTY_VALUE" in my portal database to
CLOB(1048676), but my error still the same when I enter big text in my
portlet:
"Exception invoking listener method doAction of component Edit: Failure
invoking listener method 'public void
net.liga.portal.htmlportlet.Edit.doAction() throws
javax.portlet.PortletModeException' on $Edit_22@16a6c70[Edit]: Value too
long"

What can I do else? Need I rebuild my jetspeed from sources to work with
CLOB datatype?

2006/10/3, Stephen Greenlee <sg...@gmail.com>:
>
> Vitaly,
>
> We also set "PROPERTY_VALUE" of type BLOB for the same reason. I think
> that you can do so without any problem.
>
> Stephen
>
> On 10/3/06, Vitaly Baranovsky <vi...@gmail.com> wrote:
> > Hmm... Maybe, making column "PROPERTY_VALUE" of type BLOB would be
> better
> > decision? Because there can be preference with big length. And length of
> > preference doesn't limited in JSR-168 specification. How do you think?
> >
> > 2006/10/3, David Sean Taylor <da...@bluesunrise.com>:
> > >
> > > Vitaly Baranovsky wrote:
> > > > Good day!
> > > >
> > > > I've written html-portlet, which simply shows html entered in edit
> mode.
> > > > But
> > > > when I enter text in textarea with more than 254 symbols length, I
> have
> > > > javax.portlet.PortletModeException when store this text in
> preference.
> > > >
> > > > How can I write portlet that stores long text (more than 254 symbols
> > > > length)?
> > > >
> > > Thats the limit on our db schema.
> > > See the prefs schema:
> > >
> > >         <column name="PROPERTY_VALUE" size="254" type="VARCHAR"/>
> > >
> > > A quick fix: alter the column size in your database (if your database
> > > supports larger column sizes on varchar columns)
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > >
> > >
> >
> >
>
>
> --
> Stephen Greenlee
> sgreenlee@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: How can I store preference with length more then 254 symbols?

Posted by Stephen Greenlee <sg...@gmail.com>.
Vitaly,

We also set "PROPERTY_VALUE" of type BLOB for the same reason. I think
that you can do so without any problem.

Stephen

On 10/3/06, Vitaly Baranovsky <vi...@gmail.com> wrote:
> Hmm... Maybe, making column "PROPERTY_VALUE" of type BLOB would be better
> decision? Because there can be preference with big length. And length of
> preference doesn't limited in JSR-168 specification. How do you think?
>
> 2006/10/3, David Sean Taylor <da...@bluesunrise.com>:
> >
> > Vitaly Baranovsky wrote:
> > > Good day!
> > >
> > > I've written html-portlet, which simply shows html entered in edit mode.
> > > But
> > > when I enter text in textarea with more than 254 symbols length, I have
> > > javax.portlet.PortletModeException when store this text in preference.
> > >
> > > How can I write portlet that stores long text (more than 254 symbols
> > > length)?
> > >
> > Thats the limit on our db schema.
> > See the prefs schema:
> >
> >         <column name="PROPERTY_VALUE" size="254" type="VARCHAR"/>
> >
> > A quick fix: alter the column size in your database (if your database
> > supports larger column sizes on varchar columns)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
>


-- 
Stephen Greenlee
sgreenlee@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How can I store preference with length more then 254 symbols?

Posted by Aaron Evans <aa...@gmail.com>.
On 10/3/06, Vitaly Baranovsky <vi...@gmail.com> wrote:
> Hmm... Maybe, making column "PROPERTY_VALUE" of type BLOB would be better
> decision? Because there can be preference with big length. And length of
> preference doesn't limited in JSR-168 specification. How do you think?
>

Personally, I don't think prefs were really designed for holding huge
amounts of data.

However, I supposed 254 characters could be considered too small.  I
would think a varchar2(2000) for oracle or a longtext for mysql would
be ok...

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How can I store preference with length more then 254 symbols?

Posted by Vitaly Baranovsky <vi...@gmail.com>.
Hmm... Maybe, making column "PROPERTY_VALUE" of type BLOB would be better
decision? Because there can be preference with big length. And length of
preference doesn't limited in JSR-168 specification. How do you think?

2006/10/3, David Sean Taylor <da...@bluesunrise.com>:
>
> Vitaly Baranovsky wrote:
> > Good day!
> >
> > I've written html-portlet, which simply shows html entered in edit mode.
> > But
> > when I enter text in textarea with more than 254 symbols length, I have
> > javax.portlet.PortletModeException when store this text in preference.
> >
> > How can I write portlet that stores long text (more than 254 symbols
> > length)?
> >
> Thats the limit on our db schema.
> See the prefs schema:
>
>         <column name="PROPERTY_VALUE" size="254" type="VARCHAR"/>
>
> A quick fix: alter the column size in your database (if your database
> supports larger column sizes on varchar columns)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: How can I store preference with length more then 254 symbols?

Posted by David Sean Taylor <da...@bluesunrise.com>.
Vitaly Baranovsky wrote:
> Good day!
> 
> I've written html-portlet, which simply shows html entered in edit mode. 
> But
> when I enter text in textarea with more than 254 symbols length, I have
> javax.portlet.PortletModeException when store this text in preference.
> 
> How can I write portlet that stores long text (more than 254 symbols
> length)?
> 
Thats the limit on our db schema.
See the prefs schema:

         <column name="PROPERTY_VALUE" size="254" type="VARCHAR"/>

A quick fix: alter the column size in your database (if your database 
supports larger column sizes on varchar columns)

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org