[MGNLMODSTR-5] Cannot go to admincentral from domain root or rendered page on author Created: 19/Nov/13  Updated: 09/Sep/15  Resolved: 19/Sep/14

Status: Closed
Project: Modifystream (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Neutral
Reporter: Zdenek Skodik Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File sitemesh.patch    
Issue Links:
Relates
relates to MGNLUI-2520 Re-Enable multisite-resolution in Pag... Closed
duplicate
is duplicated by MULTISITE-35 Offer a login form redirecting to /.m... Closed
relation
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Doing domain mapping is a productivity boost and a time-saver for the team. However since 5.0 we return a page in preview fashion if editor access the site via a domain mapped to it, disallowing her to edit any content right away or switch to AdminCentral with one click.

To reproduce:

  • map a domain to site
  • request the site via its domain

4.5 behavior was to directly display the page too, but being logged in meant for the user to be in edit-mode.

The new page editor is bound to the page app, thus cannot run "standalone".



 Comments   
Comment by Philip Mundt [ 22/Nov/13 ]

What options do we have?

  • Always redirecting the user on an admin instance to /.magnolia/admincentral
    (No real options as the "real" preview of a page on admin wouldn't be possible anymore)
  • Just as the "logout" button, show admincentral button if user is logged in
  • ?
Comment by Philip Mundt [ 12/Dec/13 ]

Related to MGNLUI-2520 to the extent that "old functionality" has to be restored.

Comment by Mikaël Geljić [ 29/Jan/14 ]

Moving this issue to 1.0.x - we need further specification before anything happens there.

Comment by Mikaël Geljić [ 03/Apr/14 ]

Clarifying this issue by rephrasing title and shedding some light after a couple of rounds of investigation. This issue has the two following flavors:

1. From site domain root, after login we are currently redirected to such site's root page.
– We want to make it configurable per Site (redirectToSiteRoot) whether a site should redirect to admincentral or its site-root.
– Default would be 'redirect to admincentral', so that all domains pointing to author instance behave consistently.

2. From a rendered page on author, there's nothing to go straight to the admincentral's pages app so that I can edit that page directly.
– Not to spoil direct access to a page on author (also used in page-editor fwiw), we cannot guess behaviour as to whether we should redirect automatically to pages app or not. This would not work well either with a 'per domain'-based approach.
– We have to re-introduce a button at the top right of the page, which redirects to .magnolia/admincentral#app:pages:detail;/<url>:edit (design input yet to come).

Comment by Jan Haderka [ 06/Apr/14 ]

The option 1 is not working for the root/home page. You would be never able to see it, since link generated in menu is http://yourdomain/ which would then redirect you back to admin central.

Comment by Milan Divilek [ 16/Apr/14 ]

3. Re-introduce a green button which redirects to admincentral. It will be done by introducing filter which will add div with "admincentral" button into body of all pages (except .magnolia). Filter could be easily enable/disable and also of format of div with "admincentral" button will be configurable.

Comment by Philip Mundt [ 14/Jul/14 ]

Setting fixVersion to "1.0.x" as this issue will not be fixed in the maintenance release of "1.0.5".

Comment by Milan Divilek [ 18/Jul/14 ]

committed proposal of the module which inject admincentral button
https://git.magnolia-cms.com/gitweb/?p=user/mdivilek/injectadmincentralbutton.git;a=summary

Comment by Jan Haderka [ 21/Jul/14 ]

Looks good in general, but:

  • get rid of all the comments from pom and module descriptor generated by the artefact.
  • might want to discuss this with Christopher or Tomas or anyone who did more templating, but I think it would be safer to inject your extra div before end of body tag rather then after beginning of it. Since it's positioned via css it doesn't matter where it is physically, but it's definitively safer in case someone is counting divs from top because of other functionality. If that is the case, you probably need to extend functionality to be able to insert before the tag, not only after.
  • naming of variables initTag, closeTag ... seeing those are not really tags, and code doesn't limit you to tags it might be easier to call them "fragments" and it might be even better to replace those two with single regex ... might want to consult Robert about the regex for it.
  • lastly, get a project created on forge, and commit it there.
Comment by Milan Divilek [ 23/Jul/14 ]

it might be even better to replace those two with single regex

Checking fragments is done during writing byte to output stream. If we would want to use regex then this would have to be changed -> write whole stream and then do the check for fragment and injection. And in this case it would be probably better use some 3rd party library (probably jsoup) which allows find data using DOM traversal or CSS selectors.

lastly, get a project created on forge, and commit it there.

I changed name of module to magnolia-injection-filter, because it can be used for injection of any code into stream not only the admin central button. Is this name ok? If yes I'll move it to forge

Comment by Jan Haderka [ 24/Jul/14 ]

add 1) ok
add 2) also ok

Comment by Roman Kovařík [ 18/Aug/14 ]

Solution using SiteMesh.

Comment by Jan Haderka [ 12/Sep/14 ]

Where's the code? (Not the original commit in your private repo, but the one in target repo w/ updated pom and ready to be released)

Comment by Roman Kovařík [ 19/Sep/14 ]
  1. processCodeBeforeInjection is hardcoded in ModifystreamOutputStream. Since the modify stream could be used for any content modification, the admincentral button filter should have probably a custom class.
  2. injectAdmincentralButton is always bootstrapped which is OK as a modify filter example but should be probably disabled by default.
  3. Could you please also add test?
Generated at Mon Feb 12 10:19:58 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.