Extending the link picker to elect multiple documents

58 views
Skip to first unread message

wim.lustenhouwer

unread,
Jul 3, 2015, 3:24:05 AM7/3/15
to hippo-c...@googlegroups.com
Hi all,

I'm building a Hippo 10 project and I've got a document that can have multiple linked documents. What I'd like to do is allow the user to select multiple documents at once. I found the LinkpickerPlugin class but I'm having a hard to time understanding it, much les how to extend it to be able to select multiple values. Can anyone help me out?

Tobias Jeger

unread,
Jul 3, 2015, 10:08:55 AM7/3/15
to hippo-c...@googlegroups.com
Hi Wim,

as you describe the use case, I'd expect you can just take the existing link picker (the "Link" field type) and mark it as "multiple" in the document type editor.

cheers

Tobi


On Fri, Jul 3, 2015 at 9:24 AM, wim.lustenhouwer <wim.lust...@finalist.com> wrote:
Hi all,

I'm building a Hippo 10 project and I've got a document that can have multiple linked documents. What I'd like to do is allow the user to select multiple documents at once. I found the LinkpickerPlugin class but I'm having a hard to time understanding it, much les how to extend it to be able to select multiple values. Can anyone help me out?

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

wim.lustenhouwer

unread,
Jul 3, 2015, 10:21:57 AM7/3/15
to hippo-c...@googlegroups.com
I have marked it as multiple. But when add is selected in a cms and you get the dialog box, you're only able to select one document. You have to press save, add another, open the dialog again etc. 

Basiccaly I just want to press CMD+ A/ CTRL +A en then press save.

Op vrijdag 3 juli 2015 16:08:55 UTC+2 schreef t.jeger:

wim.lustenhouwer

unread,
Jul 3, 2015, 10:25:38 AM7/3/15
to hippo-c...@googlegroups.com
To add a bit more info.

I have a document A that links to document B. 

There are about 60 documents of type B. Some A's take all of them, Some A's take like 43 of them (43 specific ones that is). other A's etc etc.

Op vrijdag 3 juli 2015 16:21:57 UTC+2 schreef wim.lustenhouwer:

Tobias Jeger

unread,
Jul 3, 2015, 10:26:03 AM7/3/15
to hippo-c...@googlegroups.com
I figured so much after reading the other thread, but have no cheaper advice than Jasper's...


wim.lustenhouwer

unread,
Jul 3, 2015, 10:28:59 AM7/3/15
to hippo-c...@googlegroups.com
That's okay, Could you point me in the right direction though? Jasper mentioned a Link Picker. Where am I supposed to look. I found a LinkPickerPlugin.class. But being somewhat wet behind the ears, I haven't been able to make much sense of it. 

Op vrijdag 3 juli 2015 16:26:03 UTC+2 schreef t.jeger:

marijan milicevic

unread,
Jul 3, 2015, 10:37:27 AM7/3/15
to hippo-c...@googlegroups.com
On Fri, Jul 3, 2015 at 4:26 PM, Tobias Jeger <t.j...@onehippo.com> wrote:
I figured so much after reading the other thread, but have no cheaper advice than Jasper's...

;-)

some hints: 
you'll most probably need to override existing grid and probably add checkboxes or something similar [1].
I've built similar grid for hippo console [2] (Delete * or multi node delete), which works with CTRL + click multiple selection,
however without select all implementation, but that would be easy to implement (e.g. by adding a shortcut or "Select all" checkbox

cheers
marijan 


Jasper Floor

unread,
Jul 6, 2015, 5:46:04 AM7/6/15
to hippo-c...@googlegroups.com
I'm afraid it is a bit of wicket coding you have to understand. It builds your view and attaches actions to it which can be called later (like when you press a button). Take a look at the MirrorTemplatePlugin as well. I'm working on 7.9 atm so if I say anything that doesn't match it's because I'm referencing old code, but that shouldn't matter for these plugins I think. The MTT reuses some things from the LinkPickerPlugin so it may help understanding how to customize it.

More than that it becomes really detailed. Once you get Wicket it should become easier.

mvg,
Jasper

Wim Lustenhouwer

unread,
Jul 10, 2015, 3:58:33 AM7/10/15
to hippo-c...@googlegroups.com
Thanx a ton all. It seems I’m in way over my head. I’ll try a fully different way to handle this. 

I do wonder though. Shouldn’t being able to select multiple documents from the dialog be a standard feature? It speeds up a ton of processes greatly. And I don’t really see what drawbacks it might have. I have seen however that it isn’t really easy to implement through the current selection tools.

I’m considering writing an updater script that takes all documents from a user selected folder and add it to a user selected document that way. 


Telefoon +31 6 52 51 85 03

Jasper Floor

unread,
Jul 10, 2015, 4:14:07 AM7/10/15
to hippo-c...@googlegroups.com
Wicket can be daunting, but once you understand how  it works it really is more awkward than difficult. The problem with using an updater is that you generally don't want editors to have that level of access. It is powerful access with which you also do a lot of damage.

Yeah, the pickers could possibly be more advanced, but as you saw it isn't quite trivial. Also, we have to design for the general case of all customers which is almost impossible really because someone will want to do it the opposite way of whatever you think.  It's also just a matter of time, the single picker covers most use cases so other issues are more important. Even if we put this on our idea list there is no guarantee when or if this would be adopted.

If you ever feel like figuring it out then you could contribute it to the community. We have the Hippo forge for that, though in the future we are working on a marketplace which is accessible as a dashboard, but that isn't ready yet.

mvg,
Jasper

marijan milicevic

unread,
Jul 10, 2015, 4:42:30 AM7/10/15
to hippo-c...@googlegroups.com
Hi Wim,
On Fri, Jul 10, 2015 at 9:59 AM, Wim Lustenhouwer <wim.lust...@finalist.com> wrote:
Thanx a ton all. It seems I’m in way over my head. I’ll try a fully different way to handle this. 

I do wonder though. Shouldn’t being able to select multiple documents from the dialog be a standard feature? It speeds up a ton of processes greatly. And I don’t really see what drawbacks it might have. I have seen however that it isn’t really easy to implement through the current selection tools.

 
I’m considering writing an updater script that takes all documents from a user selected folder and add it to a user selected document that way. 


why just not select folder and list documents by code? 
Linking more than, lets say 5 documents, is not very common case (and I've seen  many Hippo projects since I work here),
Another look at your application model might save you (and the end user) a lot of work. 
cheers
marijan  

Wim Lustenhouwer

unread,
Jul 10, 2015, 6:58:14 AM7/10/15
to hippo-c...@googlegroups.com
Hi Marijan. 

Thanks for the tip. I guess I should explain the full use-case. I am a junior Developer fresh from college working in a Hippo team. I have a personal project that allows me to try out creating functionalities so I can be more effective in actual customer-projects, so I’ll take your comment to heart when you say that this is not a common scenario.

Having said that let me explain what I’m trying to accomplish. 
I’m writing a cms to administer a video-game database. 

Certain video games can interact with physical toys called Amiibos. These amiibo’s are saved as documents too. Amiibo’s come in various forms and individual amigo’s can work on multiple games.

Now I have one game called smash brothers that work with 60-something specific amiibo’s.  I have another game that works with 57 amiibos/ Out of those 57, 3 don’t work work with the smash brothers game. 

So basically. I figured that I needed to link an amiibo document to a game document. But It would be quite cumbersome to open a dialog 60 times, so I thought Why not either have a multiple select, or a single button to select all and then de-select certain toys.

Again, this is for a personal project that helps me get a good grip on Hippo-development. So I’ts low priority. But for what little I have done with databases, mulitple on multiple tables have been a common case. Which is why i thought this would be a usefull issue to tackle.

Op 10 jul. 2015, om 10:42 heeft marijan milicevic <m.mil...@onehippo.com> het volgende geschreven:

Hi Wim,
On Fri, Jul 10, 2015 at 9:59 AM, Wim Lustenhouwer <wim.lust...@finalist.com> wrote:
Thanx a ton all. It seems I’m in way over my head. I’ll try a fully different way to handle this. 

I do wonder though. Shouldn’t being able to select multiple documents from the dialog be a standard feature? It speeds up a ton of processes greatly. And I don’t really see what drawbacks it might have. I have seen however that it isn’t really easy to implement through the current selection tools.

 
I’m considering writing an updater script that takes all documents from a user selected folder and add it to a user selected document that way. 


why just not select folder and list documents by code? 
Linking more than, lets say 5 documents, is not very common case (and I've seen  many Hippo projects since I work here),
Another look at your application model might save you (and the end user) a lot of work. 
cheers
marijan  



 

marijan milicevic

unread,
Jul 10, 2015, 7:30:05 AM7/10/15
to hippo-c...@googlegroups.com
Hi Wim,

On Fri, Jul 10, 2015 at 12:58 PM, Wim Lustenhouwer <wim.lust...@finalist.com> wrote:
Hi Marijan. 

Thanks for the tip. I guess I should explain the full use-case. I am a junior Developer fresh from college working in a Hippo team. I have a personal project that allows me to try out creating functionalities so I can be more effective in actual customer-projects, so I’ll take your comment to heart when you say that this is not a common scenario.

Having said that let me explain what I’m trying to accomplish. 
I’m writing a cms to administer a video-game database. 

Certain video games can interact with physical toys called Amiibos. These amiibo’s are saved as documents too. Amiibo’s come in various forms and individual amigo’s can work on multiple games.

Now I have one game called smash brothers that work with 60-something specific amiibo’s.  I have another game that works with 57 amiibos/ Out of those 57, 3 don’t work work with the smash brothers game. 

So basically. I figured that I needed to link an amiibo document to a game document. But It would be quite cumbersome to open a dialog 60 times, so I thought Why not either have a multiple select, or a single button to select all and then de-select certain toys.

Again, this is for a personal project that helps me get a good grip on Hippo-development. So I’ts low priority. But for what little I have done with databases, mulitple on multiple tables have been a common case. Which is why i thought this would be a usefull issue to tackle.

ok. that explains a few things ;-)

To give you a hint you can explore (I am not familiar with your model, but you could think about better/similar solution(s)):

-  you could introduce a field, lets call it "compatibilityVersion"  and assign it to each of the Amiibos items and  in your Game item, you could have a field called "compatibleWithVersion and than use HstQuery to retrieve all compatible items. (note: field could be split into 2 fields e.g. lower and upper bound, like: minimal version and max compatible version....)

After this, you can use HstFilters to filter data (e.g. addGreaterOrEqualThan or addBetween methods can be handy). 
Now you can say: give me all Games compatible with this Amiibos or other way around, give me all Ambiios this game can run on..

In addition to above flexibility,  you get scalability (paging results with limit/skip), and you also can store content any way you want and move it around as you wish. 

Even better, you can have a look at Faceted navigation and have automatic filtering of your content, see for example left menu filtering on 

hth,
cheers
marijan

Woonsan Ko

unread,
Jul 10, 2015, 10:36:39 AM7/10/15
to hippo-c...@googlegroups.com
Hi Wim,

In my project, I used External Document Field Picker plugin [1] to be
able to select multiple hippo internal documents. External document
picker is simply invoking your facade interface implementation and it's
agnostic to how to handle the data, but focusing only on UI.
In my use case, I needed to let end users be able to select multiple
link documents in a picker dialog.
So, I was able to use it in one of my project, by extending some core
classes of the plugin, successfully.

HTH,

Woonsan

[1] http://exdocpickerbase.forge.onehippo.org/field/architecture.html


On 7/10/15 6:58 AM, Wim Lustenhouwer wrote:
> Hi Marijan.
>
> Thanks for the tip. I guess I should explain the full use-case. I am a
> junior Developer fresh from college working in a Hippo team. I have a
> personal project that allows me to try out creating functionalities so I
> can be more effective in actual customer-projects, so I’ll take your
> comment to heart when you say that this is not a common scenario.
>
> Having said that let me explain what I’m trying to accomplish.
> I’m writing a cms to administer a video-game database.
>
> Certain video games can interact with physical toys called Amiibos.
> These amiibo’s are saved as documents too. Amiibo’s come in various
> forms and individual amigo’s can work on multiple games.
>
> Now I have one game called smash brothers that work with 60-something
> specific amiibo’s. I have another game that works with 57 amiibos/ Out
> of those 57, 3 don’t work work with the smash brothers game.
>
> So basically. I figured that I needed to link an amiibo document to a
> game document. But It would be quite cumbersome to open a dialog 60
> times, so I thought Why not either have a multiple select, or a single
> button to select all and then de-select certain toys.
>
> Again, this is for a personal project that helps me get a good grip on
> Hippo-development. So I’ts low priority. But for what little I have done
> with databases, mulitple on multiple tables have been a common case.
> Which is why i thought this would be a usefull issue to tackle.
>
>> Op 10 jul. 2015, om 10:42 heeft marijan milicevic
>> <m.mil...@onehippo.com <mailto:m.mil...@onehippo.com>> het
>> volgende geschreven:
>>
>> Hi Wim,
>> On Fri, Jul 10, 2015 at 9:59 AM, Wim
>> Lustenhouwer <wim.lust...@finalist.com
>> <mailto:wim.lust...@finalist.com>> wrote:
>>
>> Thanx a ton all. It seems I’m in way over my head. I’ll try a
>> fully different way to handle this.
>>
>> I do wonder though. Shouldn’t being able to select multiple
>> documents from the dialog be a standard feature? It speeds up a
>> ton of processes greatly. And I don’t really see what drawbacks it
>> might have. I have seen however that it isn’t really easy to
>> implement through the current selection tools.
>>
>>
>>
>> I’m considering writing an updater script that takes all documents
>> from a user selected folder and add it to a user selected document
>> that way.
>>
>>
>> why just not select folder and list documents by code?
>> Linking more than, lets say 5 documents, is not very common case (and
>> I've seen many Hippo projects since I work here),
>> Another look at your application model might save you (and the end
>> user) a lot of work.
>> cheers
>> marijan
>>
>>
>>
>>
>>
>>
>>> Op 6 jul. 2015, om 11:46 heeft Jasper Floor <j.f...@onehippo.com
>>> <mailto:j.f...@onehippo.com>> het volgende geschreven:
>>>
>>> I'm afraid it is a bit of wicket coding you have to understand.
>>> It builds your view and attaches actions to it which can be
>>> called later (like when you press a button). Take a look at the
>>> MirrorTemplatePlugin as well. I'm working on 7.9 atm so if I say
>>> anything that doesn't match it's because I'm referencing old
>>> code, but that shouldn't matter for these plugins I think. The
>>> MTT reuses some things from the LinkPickerPlugin so it may help
>>> understanding how to customize it.
>>>
>>> More than that it becomes really detailed. Once you get Wicket it
>>> should become easier.
>>>
>>> mvg,
>>> Jasper
>>>
>>> On Fri, Jul 3, 2015 at 4:37 PM, marijan
>>> milicevic <m.mil...@onehippo.com
>>> <mailto:m.mil...@onehippo.com>> wrote:
>>>
>>> On Fri, Jul 3, 2015 at 4:26 PM, Tobias
>>> Jeger <t.j...@onehippo.com <mailto:t.j...@onehippo.com>> wrote:
>>>
>>> I figured so much after reading the other thread, but
>>> have no cheaper advice than Jasper's...
>>>
>>>
>>> ;-)
>>>
>>> some hints:
>>> you'll most probably need to override existing grid and
>>> probably add checkboxes or something similar [1].
>>> I've built similar grid for hippo console [2] (Delete * or
>>> multi node delete), which works with CTRL + click multiple
>>> selection,
>>> however without select all implementation, but that would be
>>> easy to implement (e.g. by adding a shortcut or "Select all"
>>> checkbox
>>>
>>> cheers
>>> marijan
>>>
>>>
>>> [1] http://www.wicket-library.com/inmethod-grid/data-grid/item-selection
>>> [2] http://localhost:8080/cms/console/
>>>
>>>
>>>
>>>
>>> On Fri, Jul 3, 2015 at 4:21 PM,
>>> wim.lustenhouwer <wim.lust...@finalist.com
>>> www.onehippo.com <http://www.onehippo.com/>
>>>
>>>
>>> --
>>> Hippo Community Group: The place for all discussions
>>> and announcements about Hippo CMS (and HST,
>>> repository etc. etc.)
>>>
>>> To post to this group, send email
>>> to hippo-c...@googlegroups.com
>>> <mailto:hippo-c...@googlegroups.com>
>>> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
>>> ---
>>> You received this message because you are subscribed
>>> to the Google Groups "Hippo Community" group.
>>> To unsubscribe from this group and stop receiving
>>> emails from it, send an email
>>> to hippo-communi...@googlegroups.com
>>> <mailto:hippo-communi...@googlegroups.com>.
>>> Visit this group
>>> at http://groups.google.com/group/hippo-community.
>>> For more options,
>>> visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>>
>>> --
>>> Amsterdam - Oosteinde 11, 1017 WT Amsterdam
>>> Boston - 101 Main Street, Cambridge, MA 02142
>>>
>>> US +1 877 414 4776 (toll free)
>>> Europe +31(0)20 522 4466
>>> www.onehippo.com <http://www.onehippo.com/>
>>>
>>> --
>>> Hippo Community Group: The place for all discussions and
>>> announcements about Hippo CMS (and HST, repository etc. etc.)
>>>
>>> To post to this group, send email
>>> to hippo-c...@googlegroups.com
>>> <mailto:hippo-c...@googlegroups.com>
>>> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
>>> ---
>>> You received this message because you are subscribed to
>>> the Google Groups "Hippo Community" group.
>>> To unsubscribe from this group and stop receiving emails
>>> from it, send an email
>>> to hippo-communi...@googlegroups.com
>>> <mailto:hippo-communi...@googlegroups.com>.
>>> Visit this group
>>> at http://groups.google.com/group/hippo-community.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>> Hippo Community Group: The place for all discussions and
>>> announcements about Hippo CMS (and HST, repository etc. etc.)
>>>
>>> To post to this group, send email
>>> to hippo-c...@googlegroups.com
>>> <mailto:hippo-c...@googlegroups.com>
>>> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
>>> ---
>>> You received this message because you are subscribed to the
>>> Google Groups "Hippo Community" group.
>>> To unsubscribe from this group and stop receiving emails from
>>> it, send an email
>>> to hippo-communi...@googlegroups.com
>>> <mailto:hippo-communi...@googlegroups.com>.
>>> Visit this group
>>> at http://groups.google.com/group/hippo-community.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>> Hippo Community Group: The place for all discussions and
>>> announcements about Hippo CMS (and HST, repository etc. etc.)
>>>
>>> To post to this group, send email
>>> to hippo-c...@googlegroups.com
>>> <mailto:hippo-c...@googlegroups.com>
>>> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
>>> ---
>>> You received this message because you are subscribed to the
>>> Google Groups "Hippo Community" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to hippo-communi...@googlegroups.com
>>> <mailto:hippo-communi...@googlegroups.com>.
>>> Visit this group at http://groups.google.com/group/hippo-community.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> Hippo Community Group: The place for all discussions and
>> announcements about Hippo CMS (and HST, repository etc. etc.)
>>
>> To post to this group, send email
>> to hippo-c...@googlegroups.com
>> <mailto:hippo-c...@googlegroups.com>
>> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
>> ---
>> You received this message because you are subscribed to the Google
>> Groups "Hippo Community" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to hippo-communi...@googlegroups.com
>> <mailto:hippo-communi...@googlegroups.com>.
>> Visit this group at http://groups.google.com/group/hippo-community.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Hippo Community Group: The place for all discussions and announcements
>> about Hippo CMS (and HST, repository etc. etc.)
>>
>> To post to this group, send email to hippo-c...@googlegroups.com
>> <mailto:hippo-c...@googlegroups.com>
>> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
>> ---
>> You received this message because you are subscribed to the Google
>> Groups "Hippo Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to hippo-communi...@googlegroups.com
>> <mailto:hippo-communi...@googlegroups.com>.
>> Visit this group at http://groups.google.com/group/hippo-community.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> Hippo Community Group: The place for all discussions and announcements
> about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS:
> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google
> Groups "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hippo-communi...@googlegroups.com
> <mailto:hippo-communi...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.


--
w....@onehippo.com www.onehippo.com
Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Reply all
Reply to author
Forward
0 new messages