Return-Path: Delivered-To: apmail-incubator-jspwiki-commits-archive@locus.apache.org Received: (qmail 61231 invoked from network); 3 Aug 2008 12:26:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Aug 2008 12:26:21 -0000 Received: (qmail 3965 invoked by uid 500); 3 Aug 2008 12:26:20 -0000 Delivered-To: apmail-incubator-jspwiki-commits-archive@incubator.apache.org Received: (qmail 3948 invoked by uid 500); 3 Aug 2008 12:26:20 -0000 Mailing-List: contact jspwiki-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-commits@incubator.apache.org Received: (qmail 3938 invoked by uid 99); 3 Aug 2008 12:26:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Aug 2008 05:26:20 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Aug 2008 12:25:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 619EF2388A03; Sun, 3 Aug 2008 05:25:29 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r682149 [3/3] - in /incubator/jspwiki: branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/url/ branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/util/ branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/ branch... Date: Sun, 03 Aug 2008 12:25:26 -0000 To: jspwiki-commits@incubator.apache.org From: ajaquith@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080803122529.619EF2388A03@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Step.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Step.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Step.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Step.java Sun Aug 3 05:25:25 2008 @@ -1,24 +1,26 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.workflow; +import java.io.Serializable; import java.security.Principal; import java.util.Collection; import java.util.Date; @@ -60,7 +62,7 @@ * @author Andrew Jaquith * @since 2.5 */ -public interface Step +public interface Step extends Serializable { /** @@ -75,7 +77,7 @@ * the Step to associated with this Outcomes (null * denotes no Steps) */ - public void addSuccessor(Outcome outcome, Step step); + public void addSuccessor( Outcome outcome, Step step ); /** * Returns a Collection of available outcomes, such as "approve", "deny" or @@ -116,8 +118,7 @@ * multiple times. *

* - * @return the result of the Step, where true means success, - * and false means abort + * @return the result of the Step, expressed as an Outcome * @throws WikiException * if the step encounters errors while executing */ @@ -155,7 +156,7 @@ * * @return the message arguments. */ - public Object[] getMessageArguments(); + public Serializable[] getMessageArguments(); /** * Returns the Outcome of this Step's processing; by default, @@ -223,7 +224,7 @@ * * @param outcome whether the step should be considered completed */ - public void setOutcome(Outcome outcome); + public void setOutcome( Outcome outcome ); /** * Convenience method that returns the owner of the Workflow by delegating @@ -241,6 +242,6 @@ * the outcome * @return the next step */ - public Step getSuccessor(Outcome outcome); + public Step getSuccessor( Outcome outcome ); } Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/SystemPrincipal.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/SystemPrincipal.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/SystemPrincipal.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/SystemPrincipal.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.workflow; @@ -29,7 +30,7 @@ public final class SystemPrincipal implements Principal { /** The JSPWiki system user */ - public static final Principal SYSTEM_USER = new SystemPrincipal("System User"); + public static final Principal SYSTEM_USER = new SystemPrincipal( "System User" ); private final String m_name; @@ -37,7 +38,7 @@ * Private constructor to prevent direct instantiation. * @param name the name of the Principal */ - private SystemPrincipal(String name) + private SystemPrincipal( String name ) { m_name = name; } Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Task.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Task.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Task.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Task.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ -/* +/* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2007 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.workflow; @@ -54,8 +55,8 @@ public Task( String messageKey ) { super( messageKey ); - super.addSuccessor(Outcome.STEP_COMPLETE, null); - super.addSuccessor(Outcome.STEP_ABORT, null); + super.addSuccessor( Outcome.STEP_COMPLETE, null ); + super.addSuccessor( Outcome.STEP_ABORT, null ); } /** @@ -67,7 +68,7 @@ * @param messageKey * the i18n message key */ - public Task(Workflow workflow, String messageKey) + public Task( Workflow workflow, String messageKey ) { this( messageKey ); setWorkflow( workflow ); @@ -92,7 +93,7 @@ * @param step * the successor */ - public final synchronized void setSuccessor(Step step) + public final synchronized void setSuccessor( Step step ) { m_successor = step; } Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Workflow.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Workflow.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Workflow.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/Workflow.java Sun Aug 3 05:25:25 2008 @@ -1,24 +1,26 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.workflow; +import java.io.Serializable; import java.security.Principal; import java.util.*; @@ -134,7 +136,7 @@ * array is retrieved via {@link #getMessageArguments()}; the first two array * elements will always be these: a String representing work flow owner's name, * and a String representing the current actor's name. Workflow participants - * can add to this array by invoking {@link #addMessageArgument(Object)}. + * can add to this array by invoking {@link #addMessageArgument(Serializable)}. * *

Example

*

@@ -197,10 +199,12 @@ * * @author Andrew Jaquith */ -public class Workflow +public class Workflow implements Serializable { + private static final long serialVersionUID = 5228149040690660032L; + /** Time value: the start or end time has not been set. */ - public static final Date TIME_NOT_SET = new Date(0); + public static final Date TIME_NOT_SET = new Date( 0 ); /** ID value: the workflow ID has not been set. */ public static final int ID_NOT_SET = 0; @@ -224,7 +228,7 @@ public static final int CREATED = -2; /** Lazily-initialized attribute map. */ - private Map m_attributes; + private Map m_attributes; /** The initial Step for this Workflow. */ private Step m_firstStep; @@ -240,7 +244,7 @@ private final Principal m_owner; - private final List m_messageArgs; + private final List m_messageArgs; private int m_state; @@ -271,7 +275,7 @@ m_id = ID_NOT_SET; m_key = messageKey; m_manager = null; - m_messageArgs = new ArrayList(); + m_messageArgs = new ArrayList(); m_owner = owner; m_started = false; m_state = CREATED; @@ -291,27 +295,27 @@ public final synchronized void abort() { // Check corner cases: previous abort or completion - if (m_state == ABORTED) + if ( m_state == ABORTED ) { - throw new IllegalStateException("The workflow has already been aborted."); + throw new IllegalStateException( "The workflow has already been aborted." ); } - if (m_state == COMPLETED) + if ( m_state == COMPLETED ) { - throw new IllegalStateException("The workflow has already completed."); + throw new IllegalStateException( "The workflow has already completed." ); } - if (m_currentStep != null) + if ( m_currentStep != null ) { - if (m_manager != null && m_currentStep instanceof Decision) + if ( m_manager != null && m_currentStep instanceof Decision ) { Decision d = (Decision)m_currentStep; - m_manager.getDecisionQueue().remove(d); + m_manager.getDecisionQueue().remove( d ); } - m_currentStep.setOutcome(Outcome.STEP_ABORT); - m_history.addLast(m_currentStep); + m_currentStep.setOutcome( Outcome.STEP_ABORT ); + m_history.addLast( m_currentStep ); } m_state = ABORTED; - fireEvent(WorkflowEvent.ABORTED); + fireEvent( WorkflowEvent.ABORTED ); cleanup(); } @@ -324,14 +328,14 @@ * an IllegalArgumentException. * @param obj the object to add */ - public final void addMessageArgument(Object obj) + public final void addMessageArgument( Serializable obj ) { - if (obj instanceof String || obj instanceof Date || obj instanceof Number) + if ( obj instanceof String || obj instanceof Date || obj instanceof Number ) { - m_messageArgs.add(obj); + m_messageArgs.add( obj ); return; } - throw new IllegalArgumentException("Message arguments must be of type String, Date or Number."); + throw new IllegalArgumentException( "Message arguments must be of type String, Date or Number." ); } /** @@ -342,7 +346,7 @@ */ public final synchronized Principal getCurrentActor() { - if (m_currentStep == null) + if ( m_currentStep == null ) { return null; } @@ -379,13 +383,13 @@ * the name of the attribute * @return the value */ - public final synchronized Object getAttribute(String attr) + public final synchronized Object getAttribute( String attr ) { - if (m_attributes == null) + if ( m_attributes == null ) { return null; } - return m_attributes.get(attr); + return m_attributes.get( attr ); } /** @@ -398,10 +402,10 @@ */ public final Date getEndTime() { - if (isCompleted()) + if ( isCompleted() ) { Step last = m_history.getLast(); - if (last != null) + if ( last != null ) { return last.getEndTime(); } @@ -434,19 +438,19 @@ * *

* Workflow and Step subclasses are free to append items to this collection - * with {@link #addMessageArgument(Object)}. + * with {@link #addMessageArgument(Serializable)}. *

* * @return the array of message arguments */ - public final Object[] getMessageArguments() + public final Serializable[] getMessageArguments() { - List args = new ArrayList(); - args.add(m_owner.getName()); + List args = new ArrayList(); + args.add( m_owner.getName() ); Principal actor = getCurrentActor(); - args.add(actor == null ? "-" : actor.getName()); - args.addAll(m_messageArgs); - return args.toArray(new Object[args.size()]); + args.add( actor == null ? "-" : actor.getName() ); + args.addAll( m_messageArgs ); + return args.toArray( new Serializable[args.size()] ); } /** @@ -505,7 +509,7 @@ */ public final List getHistory() { - return Collections.unmodifiableList(m_history); + return Collections.unmodifiableList( m_history ); } /** @@ -554,7 +558,7 @@ */ public final Step getPreviousStep() { - return previousStep(m_currentStep); + return previousStep( m_currentStep ); } /** @@ -568,12 +572,12 @@ */ public final synchronized void restart() throws WikiException { - if (m_state != WAITING) + if ( m_state != WAITING ) { - throw new IllegalStateException("Workflow is not paused; cannot restart."); + throw new IllegalStateException( "Workflow is not paused; cannot restart." ); } m_state = RUNNING; - fireEvent(WorkflowEvent.RUNNING); + fireEvent( WorkflowEvent.RUNNING ); // Process current step try @@ -588,23 +592,23 @@ } /** - * Temporarily associates an Object with this Workflow, as a named attribute, for the - * duration of workflow execution. The passed Object can be anything required by - * an executing Step. Note that when the workflow completes or aborts, all - * attributes will be cleared. + * Temporarily associates an object with this Workflow, as a named attribute, for the + * duration of workflow execution. The passed object can be anything required by + * an executing Step, although it should be serializable. Note that when the workflow + * completes or aborts, all attributes will be cleared. * * @param attr * the attribute name * @param obj * the value */ - public final synchronized void setAttribute(String attr, Object obj) + public final synchronized void setAttribute(String attr, Object obj ) { - if (m_attributes == null) + if ( m_attributes == null ) { - m_attributes = new HashMap(); + m_attributes = new HashMap(); } - m_attributes.put(attr, obj); + m_attributes.put( attr, obj ); } /** @@ -627,7 +631,7 @@ * @param id * the unique identifier */ - public final synchronized void setId(int id) + public final synchronized void setId( int id ) { this.m_id = id; } @@ -638,10 +642,10 @@ * @param manager * the workflow manager */ - public final synchronized void setWorkflowManager(WorkflowManager manager) + public final synchronized void setWorkflowManager( WorkflowManager manager ) { m_manager = manager; - addWikiEventListener(manager); + addWikiEventListener( manager ); } /** @@ -655,21 +659,21 @@ */ public final synchronized void start() throws WikiException { - if (m_state == ABORTED) + if ( m_state == ABORTED ) { - throw new IllegalStateException("Workflow cannot be started; it has already been aborted."); + throw new IllegalStateException( "Workflow cannot be started; it has already been aborted." ); } - if (m_started) + if ( m_started ) { - throw new IllegalStateException("Workflow has already started."); + throw new IllegalStateException( "Workflow has already started." ); } m_started = true; m_state = RUNNING; - fireEvent(WorkflowEvent.RUNNING); + fireEvent( WorkflowEvent.RUNNING ); // Mark the first step as the current one & add to history m_currentStep = m_firstStep; - m_history.add(m_currentStep); + m_history.add( m_currentStep ); // Process current step try @@ -691,12 +695,12 @@ */ public final synchronized void waitstate() { - if (m_state != RUNNING) + if ( m_state != RUNNING ) { - throw new IllegalStateException("Workflow is not running; cannot pause."); + throw new IllegalStateException( "Workflow is not running; cannot pause." ); } m_state = WAITING; - fireEvent(WorkflowEvent.WAITING); + fireEvent( WorkflowEvent.WAITING ); } /** @@ -720,7 +724,7 @@ if ( !isCompleted() ) { m_state = COMPLETED; - fireEvent(WorkflowEvent.COMPLETED); + fireEvent( WorkflowEvent.COMPLETED ); cleanup(); } } @@ -735,8 +739,8 @@ */ protected final Step previousStep(Step step) { - int index = m_history.indexOf(step); - return index < 1 ? null : (Step) m_history.get(index - 1); + int index = m_history.indexOf( step ); + return index < 1 ? null : m_history.get( index - 1 ); } /** @@ -749,29 +753,29 @@ */ protected final void processCurrentStep() throws WikiException { - while (m_currentStep != null) + while ( m_currentStep != null ) { // Start and execute the current step - if (!m_currentStep.isStarted()) + if ( !m_currentStep.isStarted() ) { m_currentStep.start(); } try { Outcome result = m_currentStep.execute(); - if (Outcome.STEP_ABORT.equals(result)) + if ( Outcome.STEP_ABORT.equals( result ) ) { abort(); break; } - if (!m_currentStep.isCompleted()) + if ( !m_currentStep.isCompleted() ) { - m_currentStep.setOutcome(result); + m_currentStep.setOutcome( result ); } } - catch (WikiException e) + catch ( WikiException e ) { throw e; } @@ -779,22 +783,22 @@ // Get the execution Outcome; if not complete, pause workflow and // exit Outcome outcome = m_currentStep.getOutcome(); - if (!outcome.isCompletion()) + if ( !outcome.isCompletion() ) { waitstate(); break; } // Get the next Step; if null, we're done - Step nextStep = m_currentStep.getSuccessor(outcome); - if (nextStep == null) + Step nextStep = m_currentStep.getSuccessor( outcome ); + if ( nextStep == null ) { complete(); break; } // Add the next step to Workflow history, and mark as current - m_history.add(nextStep); + m_history.add( nextStep ); m_currentStep = nextStep; } @@ -809,9 +813,9 @@ * @param listener * the event listener */ - public final synchronized void addWikiEventListener(WikiEventListener listener) + public final synchronized void addWikiEventListener( WikiEventListener listener ) { - WikiEventManager.addWikiEventListener(this, listener); + WikiEventManager.addWikiEventListener( this, listener ); } /** @@ -821,9 +825,9 @@ * @param listener * the event listener */ - public final synchronized void removeWikiEventListener(WikiEventListener listener) + public final synchronized void removeWikiEventListener( WikiEventListener listener ) { - WikiEventManager.removeWikiEventListener(this, listener); + WikiEventManager.removeWikiEventListener( this, listener ); } /** @@ -833,11 +837,11 @@ * @param type * the event type to be fired */ - protected final void fireEvent(int type) + protected final void fireEvent( int type ) { - if (WikiEventManager.isListening(this)) + if ( WikiEventManager.isListening( this ) ) { - WikiEventManager.fireEvent(this, new WorkflowEvent(this, type)); + WikiEventManager.fireEvent( this, new WorkflowEvent( this, type ) ); } } Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowBuilder.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowBuilder.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowBuilder.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowBuilder.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.workflow; @@ -32,7 +33,7 @@ */ public final class WorkflowBuilder { - private static final Map BUILDERS = new HashMap(); + private static final Map BUILDERS = new HashMap(); private final WikiEngine m_engine; /** @@ -129,9 +130,9 @@ // Add facts to the Decision, if any were supplied if ( facts != null ) { - for ( int i = 0; i < facts.length; i++ ) + for ( Fact fact: facts ) { - decision.addFact( facts[i] ); + decision.addFact( fact ); } // Add the first one as a message key if ( facts.length > 0 ) Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowManager.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowManager.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowManager.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/workflow/WorkflowManager.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.workflow; @@ -46,7 +47,7 @@ private final Set m_workflows; - private final Map m_approvers; + private final Map m_approvers; private final List m_completed; @@ -61,7 +62,7 @@ { m_next = 1; m_workflows = new HashSet(); - m_approvers = new HashMap(); + m_approvers = new HashMap(); m_completed = new ArrayList(); } @@ -86,7 +87,7 @@ * * @return the current workflows */ - public Collection getWorkflows() + public Collection getWorkflows() { return new HashSet( m_workflows ); } @@ -95,7 +96,7 @@ * Returns a collection of finished workflows; that is, those that have aborted or completed. * @return the finished workflows */ - public List getCompletedWorkflows() + public List getCompletedWorkflows() { return new ArrayList( m_completed ); } @@ -122,7 +123,7 @@ m_engine = engine; // Identify the workflows requiring approvals - for ( Iterator it = props.keySet().iterator(); it.hasNext(); ) + for ( Iterator it = props.keySet().iterator(); it.hasNext(); ) { String prop = (String) it.next(); if ( prop.startsWith( PROPERTY_APPROVER_PREFIX ) ) @@ -242,7 +243,7 @@ * @param session the wiki session * @return the collection workflows the wiki session owns, which may be empty */ - public Collection getOwnerWorkflows(WikiSession session) + public Collection getOwnerWorkflows( WikiSession session ) { List workflows = new ArrayList(); if ( session.isAuthenticated() ) @@ -251,9 +252,9 @@ for ( Workflow w : m_workflows ) { Principal owner = w.getOwner(); - for ( int i = 0; i < sessionPrincipals.length; i++ ) + for ( Principal sessionPrincipal : sessionPrincipals ) { - if ( sessionPrincipals[i].equals(owner) ) + if ( sessionPrincipal.equals( owner ) ) { workflows.add( w ); break; Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.xmlrpc; @@ -34,7 +35,6 @@ /** * Provides definitions for RPC handler routines. * - * @author Janne Jalkanen * @since 1.6.13 */ @@ -75,13 +75,13 @@ m_engine = context.getEngine(); } - protected abstract Hashtable encodeWikiPage( WikiPage p ); + protected abstract Hashtable encodeWikiPage( WikiPage p ); public Vector getRecentChanges( Date since ) { checkPermission( PagePermission.VIEW ); - Collection pages = m_engine.getRecentChanges(); - Vector> result = new Vector>(); + Collection pages = m_engine.getRecentChanges(); + Vector> result = new Vector>(); // Transform UTC into local time. Calendar cal = Calendar.getInstance(); @@ -90,8 +90,9 @@ (cal.get( Calendar.ZONE_OFFSET ) + (cal.getTimeZone().inDaylightTime( since ) ? cal.get( Calendar.DST_OFFSET ) : 0 )) ); - for( WikiPage page : pages ) + for( Iterator i = pages.iterator(); i.hasNext(); ) { + WikiPage page = (WikiPage)i.next(); if( page.getLastModified().after( cal.getTime() ) ) { @@ -106,7 +107,6 @@ * Checks whether the current user has permission to perform the RPC action; * throws an exception if not allowed by {@link com.ecyrd.jspwiki.auth.AuthorizationManager}. * - * @throws AuthenticationFailed A RuntimeException, if the authentication fails and the user has no permission. * @param perm the Permission to check */ protected void checkPermission( Permission perm ) Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/MetaWeblogHandler.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/MetaWeblogHandler.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/MetaWeblogHandler.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/MetaWeblogHandler.java Sun Aug 3 05:25:25 2008 @@ -1,37 +1,44 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2004 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.xmlrpc; -import java.io.*; -import com.ecyrd.jspwiki.*; -import com.ecyrd.jspwiki.action.AttachActionBean; -import com.ecyrd.jspwiki.action.ViewActionBean; +import java.io.ByteArrayInputStream; +import java.util.*; + +import org.apache.log4j.Logger; +import org.apache.xmlrpc.XmlRpcException; + +import com.ecyrd.jspwiki.PageTimeComparator; +import com.ecyrd.jspwiki.WikiContext; +import com.ecyrd.jspwiki.WikiEngine; +import com.ecyrd.jspwiki.WikiPage; import com.ecyrd.jspwiki.attachment.Attachment; import com.ecyrd.jspwiki.attachment.AttachmentManager; +import com.ecyrd.jspwiki.auth.AuthenticationManager; +import com.ecyrd.jspwiki.auth.AuthorizationManager; +import com.ecyrd.jspwiki.auth.WikiSecurityException; +import com.ecyrd.jspwiki.auth.permissions.PermissionFactory; import com.ecyrd.jspwiki.plugin.WeblogEntryPlugin; import com.ecyrd.jspwiki.plugin.WeblogPlugin; import com.ecyrd.jspwiki.providers.ProviderException; -import java.util.*; - -import org.apache.log4j.Logger; -import org.apache.xmlrpc.XmlRpcException; /** * Provides handlers for all RPC routines of the MetaWeblog API. @@ -42,22 +49,22 @@ * in a wiki-compatible manner. And you cannot choose your page names * either. Since 2.1.94 the entire MetaWeblog API is supported. * - * @author Janne Jalkanen * @since 2.1.7 */ public class MetaWeblogHandler implements WikiRPCHandler { - Logger log = Logger.getLogger( MetaWeblogHandler.class ); + private static Logger log = Logger.getLogger( MetaWeblogHandler.class ); - private WikiEngine m_engine; private WikiContext m_context; + /** + * {@inheritDoc} + */ public void initialize( WikiContext context ) { m_context = context; - m_engine = context.getEngine(); } /** @@ -69,58 +76,52 @@ * * @throw XmlRpcException with the correct error message, if auth fails. */ - private void checkPermissions( WikiPage page, + private void checkPermissions( WikiPage page, String username, String password, String permission ) throws XmlRpcException { - return; - /* - AuthorizationManager mgr = m_engine.getAuthorizationManager(); - UserProfile currentUser = m_engine.getUserManager().getUserProfile( username ); - currentUser.setPassword( password ); - - WikiAuthenticator auth = m_engine.getUserManager().getAuthenticator(); - - if( auth != null ) + try { - boolean isValid = auth.authenticate( currentUser ); + AuthenticationManager amm = m_context.getEngine().getAuthenticationManager(); + AuthorizationManager mgr = m_context.getEngine().getAuthorizationManager(); - if( isValid ) + if( amm.login( m_context.getWikiSession(), username, password ) ) { - if( !mgr.checkPermission( page, - currentUser, - permission ) ) - { - return; - } - else + if( !mgr.checkPermission( m_context.getWikiSession(), PermissionFactory.getPagePermission( page, permission ) )) { - String msg = "Insufficient permissions to do "+permission+" on "+page.getName(); - log.error( msg ); - throw new XmlRpcException(0, msg ); - } + throw new XmlRpcException( 1, "No permission" ); + } } - else + else { - log.error( "Username '"+username+"' or password not valid." ); - throw new XmlRpcException(0, "Password or username not valid."); + throw new XmlRpcException( 1, "Unknown login" ); } } - */ + catch( WikiSecurityException e ) + { + throw new XmlRpcException( 1, e.getMessage(), e ); + } + return; } /** * JSPWiki does not support categories, therefore JSPWiki * always returns an empty list for categories. + * + * @param blogid The id of the blog. + * @param username The username to use + * @param password The password + * @throws XmlRpcException If something goes wrong + * @return An empty hashtable. */ public Hashtable getCategories( String blogid, String username, String password ) throws XmlRpcException { - WikiPage page = m_engine.getPage( blogid ); + WikiPage page = m_context.getEngine().getPage( blogid ); checkPermissions( page, username, password, "view" ); @@ -131,10 +132,10 @@ private String getURL( String page ) { - return m_context.getContext().getURL( ViewActionBean.class, - page, - null, - true ); // Force absolute urls + return m_context.getEngine().getURL( WikiContext.VIEW, + page, + null, + true ); // Force absolute urls } /** @@ -145,9 +146,9 @@ */ private Hashtable makeEntry( WikiPage page ) { - Hashtable ht = new Hashtable(); + Hashtable ht = new Hashtable(); - WikiPage firstVersion = m_engine.getPage( page.getName(), 1 ); + WikiPage firstVersion = m_context.getEngine().getPage( page.getName(), 1 ); ht.put("dateCreated", firstVersion.getLastModified()); ht.put("link", getURL(page.getName())); @@ -155,7 +156,7 @@ ht.put("postid", page.getName()); ht.put("userid", page.getAuthor()); - String pageText = m_engine.getText(page.getName()); + String pageText = m_context.getEngine().getText(page.getName()); String title = ""; int firstLine = pageText.indexOf('\n'); @@ -177,22 +178,30 @@ /** * Returns a list of the recent posts to this weblog. + * + * @param blogid The id of the blog. + * @param username The username to use + * @param password The password + * @param numberOfPosts How many posts to find + * @throws XmlRpcException If something goes wrong + * @return As per MetaweblogAPI specification */ // FIXME: The implementation is suboptimal, as it // goes through all of the blog entries. + @SuppressWarnings("unchecked") public Hashtable getRecentPosts( String blogid, String username, String password, int numberOfPosts) throws XmlRpcException { - Hashtable result = new Hashtable(); + Hashtable> result = new Hashtable>(); log.info( "metaWeblog.getRecentPosts() called"); - WikiPage page = m_engine.getPage( blogid ); + WikiPage page = m_context.getEngine().getPage( blogid ); checkPermissions( page, username, password, "view" ); @@ -200,10 +209,10 @@ { WeblogPlugin plugin = new WeblogPlugin(); - List changed = plugin.findBlogEntries(m_engine.getPageManager(), - blogid, - new Date(0L), - new Date()); + List changed = plugin.findBlogEntries(m_context.getEngine().getPageManager(), + blogid, + new Date(0L), + new Date()); Collections.sort( changed, new PageTimeComparator() ); @@ -228,7 +237,14 @@ /** * Adds a new post to the blog. + * + * @param blogid The id of the blog. + * @param username The username to use + * @param password The password + * @param content As per Metaweblogapi contract * @param publish This parameter is ignored for JSPWiki. + * @return Returns an empty string + * @throws XmlRpcException If something goes wrong */ public String newPost( String blogid, String username, @@ -238,20 +254,21 @@ throws XmlRpcException { log.info("metaWeblog.newPost() called"); + WikiEngine engine = m_context.getEngine(); - WikiPage page = m_engine.getPage( blogid ); - checkPermissions( page, username, password, "create" ); + WikiPage page = engine.getPage( blogid ); + checkPermissions( page, username, password, "createPages" ); try { WeblogEntryPlugin plugin = new WeblogEntryPlugin(); - String pageName = plugin.getNewEntryPage( m_engine, blogid ); + String pageName = plugin.getNewEntryPage( engine, blogid ); - WikiPage entryPage = new WikiPage( m_engine, pageName ); + WikiPage entryPage = new WikiPage( engine, pageName ); entryPage.setAuthor( username ); - WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( entryPage ); + WikiContext context = engine.getWikiActionBeanFactory().newViewActionBean( null, null, entryPage ); StringBuffer text = new StringBuffer(); text.append( "!"+content.get("title") ); @@ -260,7 +277,7 @@ log.debug("Writing entry: "+text); - m_engine.saveText( context, text.toString() ); + engine.saveText( context, text.toString() ); } catch( Exception e ) { @@ -275,6 +292,14 @@ * Creates an attachment and adds it to the blog. The attachment * is created into the main blog page, not the actual post page, * because we do not know it at this point. + * + * @param blogid The id of the blog. + * @param username The username to use + * @param password The password + * @param content As per the MetaweblogAPI contract + * @return As per the MetaweblogAPI contract + * @throws XmlRpcException If something goes wrong + * */ public Hashtable newMediaObject( String blogid, String username, @@ -282,25 +307,26 @@ Hashtable content ) throws XmlRpcException { + WikiEngine engine = m_context.getEngine(); String url = ""; log.info("metaWeblog.newMediaObject() called"); - WikiPage page = m_engine.getPage( blogid ); + WikiPage page = engine.getPage( blogid ); checkPermissions( page, username, password, "upload" ); String name = (String) content.get( "name" ); byte[] data = (byte[]) content.get( "bits" ); - AttachmentManager attmgr = m_engine.getAttachmentManager(); + AttachmentManager attmgr = engine.getAttachmentManager(); try { - Attachment att = new Attachment( m_engine, blogid, name ); + Attachment att = new Attachment( engine, blogid, name ); att.setAuthor( username ); attmgr.storeAttachment( att, new ByteArrayInputStream( data ) ); - url = m_context.getContext().getURL( AttachActionBean.class, att.getName(), null, true ); + url = engine.getURL( WikiContext.ATTACH, att.getName(), null, true ); } catch( Exception e ) { @@ -308,7 +334,7 @@ throw new XmlRpcException( 0, "Failed to upload media object: "+e.getMessage() ); } - Hashtable result = new Hashtable(); + Hashtable result = new Hashtable(); result.put("url", url); return result; @@ -327,10 +353,11 @@ boolean publish ) throws XmlRpcException { + WikiEngine engine = m_context.getEngine(); log.info("metaWeblog.editPost("+postid+") called"); // FIXME: Is postid correct? Should we determine it from the page name? - WikiPage page = m_engine.getPage( postid ); + WikiPage page = engine.getPage( postid ); checkPermissions( page, username, password, "edit" ); try @@ -338,7 +365,7 @@ WikiPage entryPage = (WikiPage)page.clone(); entryPage.setAuthor( username ); - WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( entryPage ); + WikiContext context = engine.getWikiActionBeanFactory().newViewActionBean( null, null, entryPage ); StringBuffer text = new StringBuffer(); text.append( "!"+content.get("title") ); @@ -347,7 +374,7 @@ log.debug("Updating entry: "+text); - m_engine.saveText( context, text.toString() ); + engine.saveText( context, text.toString() ); } catch( Exception e ) { @@ -369,7 +396,7 @@ { String wikiname = "FIXME"; - WikiPage page = m_engine.getPage( wikiname ); + WikiPage page = m_context.getEngine().getPage( wikiname ); checkPermissions( page, username, password, "view" ); Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandler.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandler.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandler.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandler.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.xmlrpc; @@ -26,9 +27,6 @@ import org.apache.xmlrpc.XmlRpcException; import com.ecyrd.jspwiki.*; -import com.ecyrd.jspwiki.action.AttachActionBean; -import com.ecyrd.jspwiki.action.EditActionBean; -import com.ecyrd.jspwiki.action.ViewActionBean; import com.ecyrd.jspwiki.attachment.Attachment; import com.ecyrd.jspwiki.auth.permissions.PagePermission; import com.ecyrd.jspwiki.auth.permissions.PermissionFactory; @@ -36,7 +34,6 @@ /** * Provides handlers for all RPC routines. * - * @author Janne Jalkanen * @since 1.6.6 */ // We could use WikiEngine directly, but because of introspection it would @@ -45,10 +42,11 @@ public class RPCHandler extends AbstractRPCHandler { - Logger log = Logger.getLogger( RPCHandler.class ); - - private static final Map NO_PARAMS = Collections.unmodifiableMap( new HashMap() ); + private static Logger log = Logger.getLogger( RPCHandler.class ); + /** + * {@inheritDoc} + */ public void initialize( WikiContext ctx ) { super.initialize( ctx ); @@ -100,11 +98,12 @@ public Vector getAllPages() { checkPermission( PagePermission.VIEW ); - Collection pages = m_engine.getRecentChanges(); + Collection pages = m_engine.getRecentChanges(); Vector result = new Vector(); - for( WikiPage p : pages ) + for( Iterator i = pages.iterator(); i.hasNext(); ) { + WikiPage p = (WikiPage) i.next(); if( !(p instanceof Attachment) ) { result.add( toRPCString(p.getName()) ); @@ -119,7 +118,7 @@ */ protected Hashtable encodeWikiPage( WikiPage page ) { - Hashtable ht = new Hashtable(); + Hashtable ht = new Hashtable(); ht.put( "name", toRPCString(page.getName()) ); @@ -139,7 +138,7 @@ (cal.getTimeZone().inDaylightTime( d ) ? cal.get( Calendar.DST_OFFSET ) : 0 )) ); ht.put( "lastModified", cal.getTime() ); - ht.put( "version", new Integer(page.getVersion()) ); + ht.put( "version", page.getVersion() ); if( page.getAuthor() != null ) { @@ -149,11 +148,11 @@ return ht; } - public Vector> getRecentChanges( Date since ) + public Vector getRecentChanges( Date since ) { checkPermission( PagePermission.VIEW ); - Collection pages = m_engine.getRecentChanges(); - Vector> result = new Vector>(); + Collection pages = m_engine.getRecentChanges(); + Vector> result = new Vector>(); Calendar cal = Calendar.getInstance(); cal.setTime( since ); @@ -166,8 +165,10 @@ (cal.getTimeZone().inDaylightTime(since) ? cal.get( Calendar.DST_OFFSET ) : 0 ) ) ); since = cal.getTime(); - for( WikiPage page : pages ) + for( Iterator i = pages.iterator(); i.hasNext(); ) { + WikiPage page = (WikiPage)i.next(); + if( page.getLastModified().after( since ) && !(page instanceof Attachment) ) { result.add( encodeWikiPage( page ) ); @@ -263,7 +264,7 @@ LinkCollector extCollector = new LinkCollector(); LinkCollector attCollector = new LinkCollector(); - WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( page ); + WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( null, null, page ); context.setVariable( WikiEngine.PROP_REFSTYLE, "absolute" ); m_engine.textToHTML( context, @@ -272,14 +273,15 @@ extCollector, attCollector ); - Vector> result = new Vector>(); + Vector> result = new Vector>(); // // Add local links. // - for( String link : localCollector.getLinks() ) + for( Iterator i = localCollector.getLinks().iterator(); i.hasNext(); ) { - Hashtable ht = new Hashtable(); + String link = (String) i.next(); + Hashtable ht = new Hashtable(); ht.put( "page", toRPCString( link ) ); ht.put( "type", LINK_LOCAL ); @@ -296,11 +298,11 @@ if( m_engine.pageExists(link) ) { - ht.put( "href", context.getContext().getURL( ViewActionBean.class, link, NO_PARAMS, true ) ); + ht.put( "href", context.getURL(WikiContext.VIEW,link) ); } else { - ht.put( "href", context.getContext().getURL( EditActionBean.class, link, NO_PARAMS, true ) ); + ht.put( "href", context.getURL(WikiContext.EDIT,link) ); } result.add( ht ); @@ -309,13 +311,15 @@ // // Add links to inline attachments // - for( String link : attCollector.getLinks() ) + for( Iterator i = attCollector.getLinks().iterator(); i.hasNext(); ) { - Hashtable ht = new Hashtable(); + String link = (String) i.next(); + + Hashtable ht = new Hashtable(); ht.put( "page", toRPCString( link ) ); ht.put( "type", LINK_LOCAL ); - ht.put( "href", context.getContext().getURL( AttachActionBean.class, link, NO_PARAMS, true ) ); + ht.put( "href", context.getURL(WikiContext.ATTACH,link) ); result.add( ht ); } @@ -325,9 +329,11 @@ // simply because URLs are by definition ASCII. // - for( String link : extCollector.getLinks() ) + for( Iterator i = extCollector.getLinks().iterator(); i.hasNext(); ) { - Hashtable ht = new Hashtable(); + String link = (String) i.next(); + + Hashtable ht = new Hashtable(); ht.put( "page", link ); ht.put( "type", LINK_EXTERNAL ); Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandlerUTF8.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandlerUTF8.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandlerUTF8.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCHandlerUTF8.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.xmlrpc; @@ -27,8 +28,6 @@ import com.ecyrd.jspwiki.WikiContext; import com.ecyrd.jspwiki.WikiEngine; import com.ecyrd.jspwiki.WikiPage; -import com.ecyrd.jspwiki.action.AttachActionBean; -import com.ecyrd.jspwiki.action.EditActionBean; import com.ecyrd.jspwiki.attachment.Attachment; import com.ecyrd.jspwiki.auth.permissions.PagePermission; import com.ecyrd.jspwiki.auth.permissions.PermissionFactory; @@ -37,7 +36,6 @@ * Provides handlers for all RPC routines. These routines are used by * the UTF-8 interface. * - * @author Janne Jalkanen * @since 1.6.13 */ @@ -55,11 +53,13 @@ { checkPermission( PagePermission.VIEW ); - Collection pages = m_engine.getRecentChanges(); + Collection pages = m_engine.getRecentChanges(); Vector result = new Vector(); - for( WikiPage p : pages ) + for( Iterator i = pages.iterator(); i.hasNext(); ) { + WikiPage p = (WikiPage) i.next(); + if( !(p instanceof Attachment) ) { result.add( p.getName() ); @@ -72,9 +72,9 @@ /** * Encodes a single wiki page info into a Hashtable. */ - protected Hashtable encodeWikiPage( WikiPage page ) + protected Hashtable encodeWikiPage( WikiPage page ) { - Hashtable ht = new Hashtable(); + Hashtable ht = new Hashtable(); ht.put( "name", page.getName() ); @@ -94,7 +94,7 @@ (cal.getTimeZone().inDaylightTime( d ) ? cal.get( Calendar.DST_OFFSET ) : 0 )) ); ht.put( "lastModified", cal.getTime() ); - ht.put( "version", new Integer(page.getVersion()) ); + ht.put( "version", page.getVersion() ); if( page.getAuthor() != null ) { @@ -104,12 +104,12 @@ return ht; } - public Vector> getRecentChanges( Date since ) + public Vector getRecentChanges( Date since ) { checkPermission( PagePermission.VIEW ); - Collection pages = m_engine.getRecentChanges(); - Vector> result = new Vector>(); + Collection pages = m_engine.getRecentChanges(); + Vector> result = new Vector>(); Calendar cal = Calendar.getInstance(); cal.setTime( since ); @@ -122,8 +122,10 @@ (cal.getTimeZone().inDaylightTime(since) ? cal.get( Calendar.DST_OFFSET ) : 0 ) ) ); since = cal.getTime(); - for( WikiPage page : pages ) + for( Iterator i = pages.iterator(); i.hasNext(); ) { + WikiPage page = (WikiPage)i.next(); + if( page.getLastModified().after( since ) && !(page instanceof Attachment) ) { result.add( encodeWikiPage( page ) ); @@ -217,7 +219,7 @@ LinkCollector extCollector = new LinkCollector(); LinkCollector attCollector = new LinkCollector(); - WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( page ); + WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( null, null, page ); context.setVariable( WikiEngine.PROP_REFSTYLE, "absolute" ); m_engine.textToHTML( context, @@ -226,16 +228,17 @@ extCollector, attCollector ); - Vector> result = new Vector>(); + Vector> result = new Vector>(); // FIXME: Contains far too much common with RPCHandler. Refactor! // // Add local links. // - for( String link : localCollector.getLinks() ) + for( Iterator i = localCollector.getLinks().iterator(); i.hasNext(); ) { - Hashtable ht = new Hashtable(); + String link = (String) i.next(); + Hashtable ht = new Hashtable(); ht.put( "page", link ); ht.put( "type", LINK_LOCAL ); @@ -245,7 +248,7 @@ } else { - ht.put( "href", context.getContext().getURL(EditActionBean.class,link) ); + ht.put( "href", context.getURL(WikiContext.EDIT,link) ); } result.add( ht ); @@ -254,13 +257,15 @@ // // Add links to inline attachments // - for( String link : attCollector.getLinks() ) + for( Iterator i = attCollector.getLinks().iterator(); i.hasNext(); ) { - Hashtable ht = new Hashtable(); + String link = (String) i.next(); + + Hashtable ht = new Hashtable(); ht.put( "page", link ); ht.put( "type", LINK_LOCAL ); - ht.put( "href", context.getContext().getURL(AttachActionBean.class,link) ); + ht.put( "href", context.getURL(WikiContext.ATTACH,link) ); result.add( ht ); } @@ -270,9 +275,11 @@ // simply because URLs are by definition ASCII. // - for( String link : extCollector.getLinks() ) + for( Iterator i = extCollector.getLinks().iterator(); i.hasNext(); ) { - Hashtable ht = new Hashtable(); + String link = (String) i.next(); + + Hashtable ht = new Hashtable(); ht.put( "page", link ); ht.put( "type", LINK_EXTERNAL ); Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/RPCServlet.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.xmlrpc; @@ -36,8 +37,6 @@ import com.ecyrd.jspwiki.WikiContext; import com.ecyrd.jspwiki.WikiEngine; -import com.ecyrd.jspwiki.WikiException; -import com.ecyrd.jspwiki.action.ViewActionBean; /** * Handles all incoming servlet requests for XML-RPC calls. @@ -48,7 +47,6 @@ *
  • prefix : The command prefix for that particular handler. * * - * @author Janne Jalkanen * @since 1.6.6 */ public class RPCServlet extends HttpServlet @@ -76,7 +74,7 @@ rpchandler.initialize( m_engine ); m_xmlrpcServer.addHandler( prefix, rpchandler ); */ - Class handlerClass = Class.forName( handlerName ); + Class handlerClass = Class.forName( handlerName ); m_xmlrpcServer.addHandler( prefix, new LocalHandler(handlerClass) ); } @@ -122,16 +120,8 @@ try { - WikiContext ctx; - try - { - ctx = (WikiContext)m_engine.getWikiActionBeanFactory().newActionBean( request, response, ViewActionBean.class ); - } - catch ( WikiException e ) - { - throw new ServletException( e.getMessage() ); - } - + WikiContext ctx = m_engine.createContext( request, WikiContext.NONE ); + XmlRpcContext xmlrpcContext = new WikiXmlRpcContext( m_xmlrpcServer.getHandlerMapping(), ctx ); @@ -185,12 +175,12 @@ } } - private class LocalHandler + private static class LocalHandler implements ContextXmlRpcHandler { - private Class m_clazz; + private Class m_clazz; - public LocalHandler( Class clazz ) + public LocalHandler( Class clazz ) { m_clazz = clazz; } Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/WikiRPCHandler.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/WikiRPCHandler.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/WikiRPCHandler.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/WikiRPCHandler.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2003 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.jspwiki.xmlrpc; @@ -25,11 +26,10 @@ * Any wiki RPC handler should implement this so that they can be properly * initialized and recognized by JSPWiki. * - * @author Janne Jalkanen * @since 2.1.7 */ -// FIXME: This class is fast becoming obsolete. It should be moved to the "rpc" package -// in 3.0 +// FIXME3.0: This class is fast becoming obsolete. It should be moved to the "rpc" package +// in 3.0 public interface WikiRPCHandler { public void initialize( WikiContext context ); Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/management/SimpleMBean.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/management/SimpleMBean.java?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/management/SimpleMBean.java (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/management/SimpleMBean.java Sun Aug 3 05:25:25 2008 @@ -1,21 +1,22 @@ /* JSPWiki - a JSP-based WikiWiki clone. - Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. */ package com.ecyrd.management; @@ -37,21 +38,21 @@ * powerful, but it does not require you to declare two classes (and keep * them in sync). * - * @author Janne Jalkanen * @since 2.6 */ +// FIXME: This class should really use Annotations instead of a method call. // FIXME: Exception handling is not probably according to spec... public abstract class SimpleMBean implements DynamicMBean { protected MBeanInfo m_beanInfo; - private static Method findGetterSetter( Class clazz, String name, Class parm ) + private static Method findGetterSetter( Class clazz, String name, Class parm ) { try { - Class[] params = { parm }; - Class[] emptyparms = {}; + Class[] params = { parm }; + Class[] emptyparms = {}; Method m = clazz.getDeclaredMethod( name, parm != null ? params : emptyparms ); @@ -65,6 +66,11 @@ return null; } + /** + * Create a new SimpleMBean + * + * @throws NotCompliantMBeanException {@inheritDoc} + */ protected SimpleMBean() throws NotCompliantMBeanException { // @@ -179,7 +185,17 @@ return ""; } - public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException + /** + * Gets an attribute using reflection from the MBean. + * + * @param name Name of the attribute to find. + * @return The value returned by the corresponding getXXX() call + * @throws AttributeNotFoundException If there is not such attribute + * @throws MBeanException + * @throws ReflectionException + */ + public Object getAttribute(String name) + throws AttributeNotFoundException, MBeanException, ReflectionException { Method m; Object res = null; @@ -215,6 +231,12 @@ return res; } + /** + * Gets multiple attributes at the same time. + * + * @param arg0 The attribute names to get + * @return A list of attributes + */ public AttributeList getAttributes(String[] arg0) { AttributeList list = new AttributeList(); @@ -245,11 +267,22 @@ return list; } + /** + * Return the MBeanInfo structure. + * + * @return the MBeanInfo + */ public MBeanInfo getMBeanInfo() { return m_beanInfo; } + /** + * Invokes a particular method. + * + * @param arg0 Method name + * @param arg1 A list of arguments for the invocation + */ public Object invoke(String arg0, Object[] arg1, String[] arg2) throws MBeanException, ReflectionException { Modified: incubator/jspwiki/trunk/src/webdocs/Wiki.jsp URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Wiki.jsp?rev=682149&r1=682148&r2=682149&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/webdocs/Wiki.jsp (original) +++ incubator/jspwiki/trunk/src/webdocs/Wiki.jsp Sun Aug 3 05:25:25 2008 @@ -16,10 +16,10 @@ String pagereq = wikiContext.getName(); // Redirect if the request was for a 'special page' - String redirect = wiki.getRedirectURL( wikiContext ); + String redirect = wiki.getWikiActionBeanFactory().getSpecialPageReference( pagereq ); if( redirect != null ) { - response.sendRedirect( redirect ); + response.sendRedirect( wikiContext.getViewURL( redirect ) ); return; }