This is an automated email from the ASF dual-hosted git repository. juanpablo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit a20613b41432b2ea62c0548ce8dcfa3ade09d98c Author: juanpablo <juanpa...@apache.org> AuthorDate: Wed Sep 30 22:37:44 2020 +0200 JSPWIKI-1131: provide context to workflow methods so it can be passed around --- jspwiki-war/src/main/webapp/Login.jsp | 2 +- jspwiki-war/src/main/webapp/UserPreferences.jsp | 2 +- jspwiki-war/src/main/webapp/Workflow.jsp | 18 ++++++------------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/jspwiki-war/src/main/webapp/Login.jsp b/jspwiki-war/src/main/webapp/Login.jsp index 6ba1740..6d68542 100644 --- a/jspwiki-war/src/main/webapp/Login.jsp +++ b/jspwiki-war/src/main/webapp/Login.jsp @@ -62,7 +62,7 @@ // If no errors, save the profile now & refresh the principal set! if ( wikiSession.getMessages( "profile" ).length == 0 ) { try { - userMgr.setUserProfile( wikiSession, profile ); + userMgr.setUserProfile( wikiContext, profile ); CookieAssertionLoginModule.setUserCookie( response, profile.getFullname() ); } catch( DuplicateUserException due ) { // User collision! (full name or wiki name already taken) diff --git a/jspwiki-war/src/main/webapp/UserPreferences.jsp b/jspwiki-war/src/main/webapp/UserPreferences.jsp index edf8db6..615c233 100644 --- a/jspwiki-war/src/main/webapp/UserPreferences.jsp +++ b/jspwiki-war/src/main/webapp/UserPreferences.jsp @@ -74,7 +74,7 @@ { try { - userMgr.setUserProfile( wikiSession, profile ); + userMgr.setUserProfile( wikiContext, profile ); CookieAssertionLoginModule.setUserCookie( response, profile.getFullname() ); } catch( DuplicateUserException due ) diff --git a/jspwiki-war/src/main/webapp/Workflow.jsp b/jspwiki-war/src/main/webapp/Workflow.jsp index 7b70a27..f13f4a9 100644 --- a/jspwiki-war/src/main/webapp/Workflow.jsp +++ b/jspwiki-war/src/main/webapp/Workflow.jsp @@ -62,22 +62,16 @@ Outcome outcome = Outcome.forName( outcomeKey ); // Iterate through our actor decisions and see if we can find an ID match Collection< Decision > decisions = dq.getActorDecisions(wikiSession); - for (Iterator< Decision > it = decisions.iterator(); it.hasNext();) - { + for (Iterator< Decision > it = decisions.iterator(); it.hasNext();) { Decision d = it.next(); - if (d.getId() == id) - { + if( d.getId() == id ) { // Cool, we found it. Now make the decision. - dq.decide(d, outcome); + dq.decide( d, outcome, wikiContext ); } } - } - catch ( NumberFormatException e ) - { + } catch ( NumberFormatException e ) { log.warn("Could not parse integer from parameter 'decision'. Somebody is being naughty."); - } - catch ( NoSuchOutcomeException e ) - { + } catch ( NoSuchOutcomeException e ) { log.warn("Could not look up Outcome from parameter 'outcome'. Somebody is being naughty."); } } @@ -95,7 +89,7 @@ if (w.getId() == id) { // Cool, we found it. Now kill the workflow. - w.abort(); + w.abort( wikiContext ); } } }