001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.container.window;
018:
019: import java.util.Set;
020:
021: import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
022: import org.apache.jetspeed.om.page.ContentFragment;
023: import org.apache.pluto.om.entity.PortletEntity;
024: import org.apache.pluto.om.window.PortletWindow;
025:
026: /**
027: * Portlet Window Accessor
028: *
029: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
030: * @version $Id: PortletWindowAccessor.java,v 1.7 2005/04/29 13:59:46 weaver Exp $
031: */
032: public interface PortletWindowAccessor {
033: /**
034: * Get a portlet window for the given fragment
035: *
036: * @param fragment
037: * @return
038: * @throws FailedToRetrievePortletWindow
039: * @throws PortletEntityNotStoredException
040: * @throws InconsistentWindowStateException If the window references a non-existsent PortletEntity
041: */
042: PortletWindow getPortletWindow(ContentFragment fragment)
043: throws FailedToRetrievePortletWindow,
044: PortletEntityNotStoredException;
045:
046: /**
047: * Get the portlet window for a fragment and given principal
048: * @param fragment
049: * @param principal
050: * @return
051: * @throws FailedToCreateWindowException
052: * @throws FailedToRetrievePortletWindow
053: * @throws PortletEntityNotStoredException
054: * @throws InconsistentWindowStateException If the window references a non-existsent PortletEntity
055: */
056: PortletWindow getPortletWindow(ContentFragment fragment,
057: String principal) throws FailedToCreateWindowException,
058: FailedToRetrievePortletWindow,
059: PortletEntityNotStoredException;
060:
061: /**
062: * Lookup a portlet window in the cache
063: * If not found, return null
064: *
065: * @param windowId
066: * @return the window from the cache or null
067: */
068: PortletWindow getPortletWindow(String windowId);
069:
070: /**
071: * Given a portlet entity, create a portlet window for that entity.
072: *
073: * @param entity
074: * @param windowId
075: * @return new window
076: */
077: PortletWindow createPortletWindow(PortletEntity entity,
078: String windowId);
079:
080: /**
081: * Create a temporary portlet window
082: * This window does not have an entity associated with it.
083: *
084: * @param windowId
085: * @return
086: */
087: PortletWindow createPortletWindow(String windowId);
088:
089: /**
090: *
091: * <p>
092: * removeWindows
093: * </p>
094: *
095: * Removes all <code>PortletWindow</code>s associated with this
096: * <code>PortletEntity</code>
097: *
098: * @param portletEntity
099: */
100: void removeWindows(PortletEntity portletEntity);
101:
102: /**
103: *
104: * <p>
105: * removeWindow
106: * </p>
107: *
108: * Removes a <code>PortletWindow</code> from the window cache.
109: *
110: * @param window
111: */
112: void removeWindow(PortletWindow window);
113:
114: /**
115: * Gets a {@link Set} of currently available {@link PortletWindow}s within
116: * the current engine instance.
117: *
118: * @return {@link Set} of {@link PortletWindow}s, never returns <code>null</code>
119: */
120: Set getPortletWindows();
121: }
|