[opencms-dev] edit xml content in administration view (OpenCms 6)
Nacho Fernandez
snatcho at gmail.com
Wed May 10 13:14:43 CEST 2006
Hi Michael!
Thank you so much for your quick response. I am sorry not to have thanked
you before, but I wanted to try and get the full idea working before. While
I was writing to you for further help for a last detail I found the final
solution, so I'll post what I did:
In a file where you get after clicking the admin tool icon you want that
sends the "resource" parameter with the resource name to edit, you should
write:
<%
String editor = "/system/workplace/editors/editor.jsp"; <----- if I use
"getEditorUri" it doesn't work properly (don't ask me why)
String backlink = intermediate_jsp;
String resource = the_resource_to_edit;
%>
Response.Write("<script>window.open( "<%= editor %>?<%=
CmsEditor.PARAM_RESOURCE %>=<%= resource %>&<%=
CmsEditor.PARAM_BACKLINK%>=<%= backlink %>&<%=
CmsEditor.PARAM_DIRECTEDIT %>=true","_top");</script>")
The intermediate jsp I mention as backlink is nothing but a copy of
"/system/workplace/views/workplace.jsp" where you fix the root of the body
page to load the page to redirect back to, more precisely to the right admin
jsp with the "path" parameter correctly set. That is, inside "cms.link" you
write "/system/workplace/views/admin/admin-fs.jsp?path=path_to_admin_tool",
where path_to_admin_tool is correctly set in the file system.
Thank you very much for your help and I hope this helps someone else.
Greetings,
Nacho.
On 5/8/06, Michael Moossen <m.moossen at alkacon.com> wrote:
>
> Hi, Nacho!
>
> that is 'almost' the right approach!
> the point is that the editor only works unframed, so you have to load it
> into
> the top frame. CmsToolManager#jspForwardPage is unable to do that.
>
> one idea is to forward to an intermediate html/jsp file, to load the
> editor in
> the top frame.
>
> Kind Regards,
> Michael
>
> -------------------
> Michael Moossen
>
> Alkacon Software GmbH - The OpenCms Experts
> http://www.alkacon.com - http://www.opencms.org
>
>
>
>
> Quoting Nacho Fernandez <snatcho at gmail.com>:
>
> > Hi all!
> >
> > I would be very grateful if someone could help me to open the xml editor
>
> > from a link in the administration view to correctly edit a xml content.
> But
> > now I have managed to open the editor with the correct data, but any
> button
> > pushing leads nowhere (be it close, save or save and exit). What I've
> done
> > so far is building an administration page and add a link that executes
> the
> > following code:
> >
> > params.put( CmsEditor.PARAM_RESOURCE, resource_name );
> > String editor = new CmsEditorHandler().getEditorUri( resource_name,
> getJsp()
> > );
> > getToolManager().jspForwardPage(this, editor, params);
> >
> > The variable "resource_name" contains the url to the resource to edit,
> and
> > it's working because the content gets correctly loaded.
> >
> > I've tried several combinations of parameters added (PARAM_BACKLINK,
> > PARAM_ACTION and the like) but none gets the desired result. Most likely
> I'm
> > getting the wrong approach. Can someone please help me? (to me this
> solution
> > is basic for building admin subsections for content listing/editing and
> > probably of good use to others as well). Thanks in advance.
> >
> > snatcho.
> >
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060510/65408330/attachment.htm>
More information about the opencms-dev
mailing list