cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Johnson <bljohn...@gmail.com>
Subject Endless Looping in Flow
Date Thu, 28 Oct 2004 20:50:31 GMT
I've got a page where the user can modify something (the title of an
XML document in this case).  Here's what I'm doing in the flowscript:

function showLayoutListPage() {
    var page = cocoon.parameters.page;

    if (isLoggedIn()) {

        while (true) {
            cocoon.sendPageAndWait("content/" + page + ".html", {
"page" : page, "user" : cocoon.session.getAttribute("user"), "layouts"
: getLayoutList() });

            var action = cocoon.request.get("doit");
            var filename = cocoon.request.get("filename");

            if (action == "setTitle") {
                // set the title for the layout
                var layout = getLayoutByFilename(filename);
                layout.setTitle(cocoon.request.get("title"));
                layout.save();
            }
        }

    } else {
        cocoon.redirectTo("/public/index.html");
    }
}

So there's an infinite loop there.  Is that going to be a problem? 
See there's really no "end" to this flow.  As long as they're sitting
on the layout manager page they're wanting to "do" something.  The
only end to this continuation would be when they clicked on some other
page rather than clicking "Set Title" or something similar.

Anyone have any thoughts on this?  Will this continually eat up
resources as time goes on or anything?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message