Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » ModelQuery "todo" - always returns true on canInsert
ModelQuery "todo" - always returns true on canInsert [message #185428] Thu, 28 December 2006 03:11 Go to next message
Eclipse UserFriend
Originally posted by: eric.services.ideoform.org

I just went to test if some elements could be validly inserted according
to a DTD and it kept returning true. It turns out this is the reason why:

public boolean canInsert(Element parent, List cmNodeList, int index,
int validityChecking)
{
// todo
return true;
}

It would be nice if at least an exception was thrown. Though I'm not
sure this is 'todo' because it could at least be implemented with the
single element version and a for-loop.
Re: ModelQuery "todo" - always returns true on canInsert [message #185434 is a reply to message #185428] Thu, 28 December 2006 03:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eric.services.ideoform.org

Err, nevermind about the single-element version via looping because it
has to do more than that since the structure/order of the elements is
important. It has to test if it is valid to insert the elements in
/that/ order (or I hope that's what this method is for).

Eric Woodruff wrote:
> I just went to test if some elements could be validly inserted according
> to a DTD and it kept returning true. It turns out this is the reason why:
>
> public boolean canInsert(Element parent, List cmNodeList, int index,
> int validityChecking)
> {
> // todo
> return true;
> }
>
> It would be nice if at least an exception was thrown. Though I'm not
> sure this is 'todo' because it could at least be implemented with the
> single element version and a for-loop.
Re: ModelQuery "todo" - always returns true on canInsert [message #185470 is a reply to message #185434] Sat, 30 December 2006 02:13 Go to previous messageGo to next message
David Williams is currently offline David WilliamsFriend
Messages: 701
Registered: July 2009
Senior Member
On Wed, 27 Dec 2006 22:18:43 -0500, Eric Woodruff
<eric.services@ideoform.org> wrote:


>>
>> It would be nice if at least an exception was thrown. Though I'm not
>> sure this is 'todo' because it could at least be implemented with ...
>>

Feel free to open an enhancement request. I suspect it's "todo" only
since we, apparently, never found a need for it in WTP per se.

I suspect you could provide a proposed patch ... some form of
"getValidator().canInsert(...)" would seem to be the right approach,
if that works for you. Within the approriate switch statements, type
checks etc., similar to the implemented 'canInsert' method.
Some unit tests would help promote is adoption.

BTW, it's unlikely this would become official API in the 2.0 timeframe,
but ... the more requests, the higher the priority, even if for the next
version.
Re: ModelQuery "todo" - always returns true on canInsert [message #185487 is a reply to message #185470] Sat, 30 December 2006 04:18 Go to previous message
Eclipse UserFriend
Originally posted by: eric.services.ideoform.org

In the meantime, shouldn't the method be deleted? I can't imagine anyone
is depending on a completely unimplemented function. Or an
IllegalStateException should be thrown at a minimum.

David Williams wrote:
> On Wed, 27 Dec 2006 22:18:43 -0500, Eric Woodruff
> <eric.services@ideoform.org> wrote:
>
>
>>>
>>> It would be nice if at least an exception was thrown. Though I'm not
>>> sure this is 'todo' because it could at least be implemented with ...
>>>
>
> Feel free to open an enhancement request. I suspect it's "todo" only
> since we, apparently, never found a need for it in WTP per se.
>
> I suspect you could provide a proposed patch ... some form of
> "getValidator().canInsert(...)" would seem to be the right approach,
> if that works for you. Within the approriate switch statements, type
> checks etc., similar to the implemented 'canInsert' method.
> Some unit tests would help promote is adoption.
>
> BTW, it's unlikely this would become official API in the 2.0 timeframe,
> but ... the more requests, the higher the priority, even if for the next
> version.
>
Previous Topic:No J2EE perspective, no Dynamic web project
Next Topic:Servlet Publishing Problem
Goto Forum:
  


Current Time: Thu Dec 25 14:21:57 GMT 2014

Powered by FUDForum. Page generated in 0.07625 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software