You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by dl...@apache.org on 2005/08/31 05:22:20 UTC

cvs commit: ws-wsrp4j/sandbox/wsrp4j/consumer-swingconsumer/src/java/org/apache/wsrp4j/consumer/swingconsumer/interfaces Aggregation.java Page.java PageRegistry.java Request.java SimplePortletWindowSession.java

dlouzan     2005/08/30 20:22:20

  Added:       sandbox/wsrp4j/consumer-swingconsumer/src/java/org/apache/wsrp4j/consumer/swingconsumer/interfaces
                        Aggregation.java Page.java PageRegistry.java
                        Request.java SimplePortletWindowSession.java
  Log:
  Initial commit.
  
  Revision  Changes    Path
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer-swingconsumer/src/java/org/apache/wsrp4j/consumer/swingconsumer/interfaces/Aggregation.java
  
  Index: Aggregation.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   *
   * Licensed 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 org.apache.wsrp4j.consumer.swingconsumer.interfaces;
  
  
  /**
   * Defines a simple aggregation which can render a page.
   *
   * @author Stephan Laertz
   * @version $Id: Aggregation.java,v 1.1 2005/08/31 03:22:20 dlouzan Exp $
   **/
  public interface Aggregation {
      
      /**
       * Render a page and return the generated markup.
       *
       * @param page The page object which should be rendered
       * @param request Request object
       *
       * @return The markup of the page.
       **/
      String renderPage(Page page, Request request);
      
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer-swingconsumer/src/java/org/apache/wsrp4j/consumer/swingconsumer/interfaces/Page.java
  
  Index: Page.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed 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 org.apache.wsrp4j.consumer.swingconsumer.interfaces;
  
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.wsrp4j.commons.consumer.interfaces.portlet.PortletKey;
  
  
  /**
   * Interface defines a page with portlets.
   *
   * @author Stephan Laertz
   * @version $Id: Page.java,v 1.1 2005/08/31 03:22:20 dlouzan Exp $
   **/
  public interface Page {
      
      /**
       * Get the keys of all portlet instances on the page.
       *
       * @return Iterator with the instance keys of all portlets on the page
       **/
      Iterator getPortletInstanceKeys();
      
      /**
       * Get the portlet key to the given portlet instance key.
       *
       * @param portletInstanceKey Key of a portlet instance on the page
       * @return The portlet key
       **/
      PortletKey getPortletKey(String portletInstanceKey);
      
      /**
       * Get the ID of this page
       *
       * @return The page ID
       **/
      String getPageID();
      
      /**
       * Add an portlet to the page. The ID of this portlet on the page
       * is generated.
       *
       * @param portletKey The portlet key
       **/
      void addPortlet(PortletKey portletKey);
      
      /**
       * Add an portlet to the page and set the ID of this portlet on
       * the page to the given value. If any other portlet exists on the page
       * with the same ID the old portlet is removed.
       *
       * @param portletKey The portlet key
       * @param instanceKey ID of the portlet on the page
       **/
      void addPortlet(PortletKey portletKey, String instanceKey);
      
      /**
       * Remove an portlet instance from the page
       *
       * @param portletInstanceKey The instance key of the portlet instance to be 
       * removed
       **/
      void removePortlet(String portletInstanceKey);
      
      /**
       * Set the page ID
       *
       * @param pageID ID of this page
       **/
      void setPageID(String pageID);
      
      /**
       * Get the title of the page
       *
       * @return Title of this page
       **/
      String getTitle();
      
      /**
       * Set the title of the page
       *
       * @param title Page title
       **/
      void setTitle(String title);
      
      /**
       * Get the instance key of the portlet on this page which is in maximized 
       * window state or null if no portlet is in that state.
       *
       * @return portlet instance key of the portlet or null if no portlet is in 
       * max window state
       **/
      String getMaximizedPortletInstanceKey();
      
      /**
       * Set the portlet which is currently in maximized window state
       *
       * @param portletInstanceKey instance ID
       **/
      void setMaximizedPortletInstanceKey(String portletInstanceKey);
      
      /**
       * Set the portlets which should appear on the page. The map must contain
       * mappings of portlet instance keys to portlet keys.
       **/
      void setPortlets(Map map);
      
      /**
       * Get map with portlet instance keys map to portlet keys with all portlet 
       * instances on this page.
       **/
      Map getPortlets();
      
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer-swingconsumer/src/java/org/apache/wsrp4j/consumer/swingconsumer/interfaces/PageRegistry.java
  
  Index: PageRegistry.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   *
   * Licensed 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 org.apache.wsrp4j.consumer.swingconsumer.interfaces;
  
  import java.util.Iterator;
  
  
  /**
   * Defines a registry which can be used
   * to administer page objects.
   *
   * @author Stephan Laertz
   * @version $Id: PageRegistry.java,v 1.1 2005/08/31 03:22:20 dlouzan Exp $
   **/
  public interface PageRegistry {
      
      /**
       * Add a page to the registry
       *
       * @param page The page to add
       */
      void addPage(Page page);
      
      /**
       * Get the page with the given ID
       *
       * @param pageID ID of the page
       *
       * @return The page with the given ID
       **/
      Page getPage(String pageID);
      
      /**
       * Get all pages in the registry
       *
       * @return Iterator with all pages
       **/
      Iterator getAllPages();
      
      /**
       * Remove the page with the given ID from the registry
       *
       * @param pageID ID of the page
       *
       * @return The page which had been mapped to this id or
       *         null if no page was found with the given id
       **/
      Page removePage(String pageID);
      
      /**
       * Tests if page with the given ID exists
       *
       * @param pageID ID of the page
       *
       * @return True if a page exists with this ID
       **/
      boolean existsPage(String pageID);
      
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer-swingconsumer/src/java/org/apache/wsrp4j/consumer/swingconsumer/interfaces/Request.java
  
  Index: Request.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed 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 org.apache.wsrp4j.consumer.swingconsumer.interfaces;
  
  import oasis.names.tc.wsrp.v1.types.NamedString;
  
  
  /**
   * Defines a request from the end-user to the swing consumer as result
   * of an interaction (e.g. click on hyperlink) of the end-user with the
   * representation of a remote portlet.
   *
   * Due to the two phase protocol of WSRP this request carries information
   * which need to be passed back to the producer in order to process the
   * interaction at the producer-side.
   *
   * @author Stephan Laertz
   * @version $Id: Request.java,v 1.1 2005/08/31 03:22:20 dlouzan Exp $
   **/
  public interface Request {
      
      /**
       * Set the interaction state of a portlet which should be passed
       * to the producer.
       *
       * @param state the interaction state of a portlet
       **/
      void setInteractionState(String state);
      
      /**
       * Get the interaction state of the portlet.
       *
       * @return interaction state of a portlet carried in a request
       **/
      String getInteractionState();
      
      /**
       * Add any parameters to the request. These parameters should
       * be carried in the form parameters field of WSRP.
       *
       * @param name The key which identifies the parameter
       * @param value The value of the parameter
       **/
      void addFormParameter(String name, String value);
      
      /**
       * Get all form parameters from the request. The returned
       * <code>NamedString</code> array contains all parameter key/value pairs
       * and can directly be passed to the form parameter field in WSRP.
       *
       * @return Array with all set parameters
       **/
      NamedString[] getFormParameters();
      
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer-swingconsumer/src/java/org/apache/wsrp4j/consumer/swingconsumer/interfaces/SimplePortletWindowSession.java
  
  Index: SimplePortletWindowSession.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   *
   * Licensed 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 org.apache.wsrp4j.consumer.swingconsumer.interfaces;
  
  import org.apache.wsrp4j.commons.consumer.interfaces.session.
          PortletWindowSession;
  
  
  /**
   * Defines a portlet window session used by the swing consumer
   * In additional to <code>SimplePortletWindowSession</code>
   * it contains information about the current window state and mode of a portlet
   * window
   *
   * @version $Id: SimplePortletWindowSession.java,v 1.1 2005/08/31 03:22:20 dlouzan Exp $
   **/
  public interface SimplePortletWindowSession extends PortletWindowSession {
      
      /**
       * Get the window state of the portlet window
       * this session belongs to.
       *
       * @return the window state
       **/
      String getWindowState();
      
      /**
       * Set the window state of the portlet window
       * this session belongs to.
       *
       * @param windowState The window state
       **/
      void setWindowState(String windowState);
      
      /**
       * Get the portlet mode of the portlet window.
       *
       * @return The portlet mode
       **/
      String getMode();
      
      /**
       * Set the portlet mode of the portlet window.
       *
       * @param mode The portlet mode
       **/
      void setMode(String mode);
      
      /**
       * Get the navigational state for the portlet window the session belongs to
       * @return the navigational state
       **/
      String getNavigationalState();
      
      /**
       * Set the navigational state for the portlet window the session belongs to
       * @param navState the navigational state
       **/
      void setNavigationalState(String navState);
      
  }