[opencms-dev] DownloadGalleryWidget: Change (selected) default gallery

Legasa Xabier Xabier.Legasa at panoptic.biz
Tue Feb 9 14:31:12 CET 2010


Hi Rüdiger, 

Thanks for the fast answer:) Im using OpenCMS 7.0 but its good to know this feature for if we upgrade. 
Anyway, I will have to try to solve the problem in another way, since I need a startup gallery to be different depending on which page the user is. So I will need to specify in the directedit link I guess. Here my idea: 

This is the generated code for the DIRECT EDIT button: 

<script type="text/javascript">
ocms_de_data['ocms_531324']= {
	id: 'ocms_531324',
	deDisabled: false,
	hasEdit: true,
	hasDelete: true,
	hasNew: false,
	resource: '/allDocuments/Coordinatieteams/docs_0009',
	editLink: '/system/workplace/editors/editor.jsp',
	language: 'nl',
	element: 'null',
	backlink: '/Coordinatieteams/CT-BE/documenten.html',
	newlink: 'allInFolderPriorityDateDesc%257C%252FallDocuments%252FCoordinatieteams%Definitieve_verslagen%252Fdocs_%2524%257Bnumber%257D.html%257Cwenzdocument%257C100',
	closelink: '/Coordinatieteams/documenten.html',
	deletelink: '/system/workplace/commons/delete.jsp',
	button_edit: 'Direct Edit',
	button_delete: 'Delete',
	button_new: 'New',
	editortitle: 'Editing (new resource)'
};
</script>

Maybe I could try this
editLink: '/system/workplace/editors/editor.jsp?defaultGallery=/gallery/A',
instead of this
editLink: '/system/workplace/editors/editor.jsp',

Or add a new variable, but the goal would be to let know editor.jsp about this path. 

And then in this jsp: http://my-intranet/system/workplace/editors/editor.jsp
try to get that variable and send it to the gallery widget:
http://my-intranet/system/workplace/editors/xmlcontent/editor_form.jsp?..... &defaultGallery=/gallery/A'

This is just an idea. Do you think it would work? Maybe its too complicated?

Thanks, 
Xabi



-----Original Message-----
From: Rüdiger Kurz [mailto:r.kurz at alkacon.com] 
Sent: 09 February 2010 14:06
To: The OpenCms mailing list
Cc: Legasa Xabier
Subject: Re: [opencms-dev] DownloadGalleryWidget: Change (selected) default gallery

Hello,

Since Version 7.5.0 it is possible for all gallery-widgets to setup a 
global start-gallery and a starting point.

Therefore you have to modify the the node <layout> in the xsd-schema 
with an optional attribute.

The configuration for a download gallery could look like the following
...
<xsd:element name="Download" type="OpenCmsVfsFile" />
...
<layouts>
   <layout element="Download" widget="DownloadGalleryWidget"
   configuration="{startup:"/demo_de/documents/",type:"gallery"}" /> 

</layouts>


A configuration for e link gallery could look like:
...
<xsd:element name="Link" type="OpenCmsVfsFile" />
...
<layouts>
     <layout element="Link" widget="LinkGalleryWidget" 
configuration="{startup:"externe/sprache/",type:"category"}" />
</layouts>

While defining a category the first "/" has not to be at the beginning.

Kind regards
Rüdiger

Am 09.02.2010 13:49, schrieb Legasa Xabier:
> Hi everybody !
>
> PROBLEM:
>
> Does anybody know *how could I configure the default selected gallery*
> in a *DownloadGalleryWidget* dialog ? (used to upload a file into a
> download gallery)
>
> PRACTICAL EXAMPLE:
>
> User /John/ its allowed to upload stuff to gallery //gallery/A/ and
> //gallery/B/ . At this moment selected gallery at
> *DownloadGalleryWidget* dialog by default is always A. How can I make
> that from the page /documents.html/ the selected gallery is A and from a
> different page /news.html/ the default selected gallery in the widget is B ?
>
> CODE:
>
> In the direct-edit feature, I edit a lets say */personalDoc/* which
> layout is a DownloadGalleryWidget. But because the user is allowed to
> upload stuff to different galleries, I need to specify in the
> direct-edit button or somewhere, which is the default gallery for this
> resource. This is my */personalDoc.xsd /*file*/:/*
>
> <xsd:element name="Resource" type="OpenCmsVfsFile" minOccurs="1"
> maxOccurs="1"/>
>
> ...
>
> <layouts>
>
> <layout element="Resource" widget="*DownloadGalleryWidget*"/>
>
> </layouts>
>
> ...
>
> Any idea there ?
>
> Thanks!
>
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev

-- 
Kind Regards,
Rüdiger

-------------------
Rüdiger Kurz

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org



More information about the opencms-dev mailing list