[Yanel-dev] State of View
Michael Wechner
michael.wechner at wyona.com
Wed May 7 09:35:28 CEST 2008
Josias Thöny wrote:
> Michael Wechner wrote:
>
>> Michael Wechner wrote:
>>
>>> Hi
>>>
>>> Has anyone an idea why we hardcoded the StateOfView within the
>>> YanelServlet?
>>
>>
>>
>> I comes to my mind that the reason was that all resources which are
>> WorkflowableV1, but are not published will result in a 404:
>>
>> if (workflowable.isLive()) {
>> view =
>> workflowable.getLiveView(viewId);
>> } else {
>> String message = "This document
>> has not been published yet: " + res.getPath();
>> log.warn(message);
>> do404(request, response, doc,
>> message);
>> return;
>> }
>>
>> which would have led to a lot 404!
>>
>> But I think a better else statement would be to check if a version
>> exists and then display this one as a start
>
>
> But this means that content which has not been published yet will be
> visible in the live view. It's somehow against my understanding of a
> review/publish workflow.
> Or do I misunderstand something?
no, you are correct. The problem is that people already using this (for
example XMLResource) would suddenly receive a lot 404s and probably
wouldn't know to configure the workflow or set all the pages to live.
This is why I made note/TODO within the YanelServlet code that maybe
this should be made configurable.
Also I guess it would make sense to replace the content of the 404 that
this isn't missing but rather has not published yet.
WDYT?
Cheers
Michi
>
> josias
>
>>
>> Cheers
>>
>> Michi
>>
>>>
>>> String stateOfView = StateOfView.AUTHORING;
>>> //String area =
>>> map.getStateOfView(request.getServletPath());
>>> //log.debug("url: " + request.getServletPath());
>>> //log.debug("state of view: " + stateOfView);
>>> /*String area = null;
>>> if (isToolbarEnabled(request)) {
>>> area = "authoring";
>>> } else {
>>> area = "live";
>>> }*/
>>>
>>>
>>> Thanks
>>>
>>> Michi
>>>
>>
>>
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Yanel, Yulup
http://www.wyona.com
michael.wechner at wyona.com, michi at apache.org
+41 44 272 91 61
More information about the Yanel-development
mailing list