001: /*
002: * (C) Copyright 2006 Nabh Information Systems, Inc.
003: *
004: * This program is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU General Public License
006: * as published by the Free Software Foundation; either version 2
007: * of the License, or (at your option) any later version.
008: *
009: * This program is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: *
014: * You should have received a copy of the GNU General Public License
015: * along with this program; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: *
018: */
019: package com.nabhinc.portal.api;
020:
021: import java.rmi.RemoteException;
022: import java.util.List;
023:
024: import com.nabhinc.portal.model.PortalApplication;
025: import com.nabhinc.portal.model.PortalConfiguration;
026: import com.nabhinc.portal.model.UserPreferences;
027: import com.nabhinc.spi.EntityExistsException;
028: import com.nabhinc.ws.core.WebServiceSecurityException;
029:
030: /**
031: * Stores Portal related information.
032: *
033: * @author Padmanabh Dabke
034: * (c) 2006 Nabh Information Systems, Inc. All Rights Reserved.
035: */
036: public interface PortalInformationStore {
037: /**
038: * Retrieves portal application based on the provided path.
039: * @param appPath The portal application's path.
040: * @return
041: * @throws RemoteException
042: */
043: PortalApplication getPortalApplication(String appPath)
044: throws WebServiceSecurityException, RemoteException;
045:
046: /**
047: * Stores portal application.
048: * @param app The portal application to store.
049: * @throws RemoteException
050: */
051: void savePortalApplication(PortalApplication app,
052: boolean isCreateVersionFile) throws EntityLockedException,
053: WebServiceSecurityException, RemoteException;
054:
055: /**
056: * Create portal application (template) at the location specified by the provided path.
057: * @param appPath The path where the portal application will be created.
058: * @param owner App owner
059: * @return
060: * @throws EntityExistsException
061: * @throws OrphanException Thrown when the parent psite is missing.
062: * @throws RemoteException
063: */
064: PortalApplication createPortalApplication(String appPath,
065: String preferredTemplatePath) throws EntityExistsException,
066: WebServiceSecurityException, OrphanException,
067: RemoteException;
068:
069: /**
070: * Verify if the application's template has already existed.
071: * @param appPath The path to verify.
072: * @return true if the portal application exists.
073: * @throws RemoteException
074: */
075: boolean portalApplicationExists(String path)
076: throws WebServiceSecurityException, RemoteException;
077:
078: /**
079: * Remove portal application
080: * @param appPath
081: */
082: void deletePortalApplication(String appPath)
083: throws WebServiceSecurityException, RemoteException;
084:
085: /**
086: * Deletes specified app versions
087: * @param appPath
088: * @param versions
089: * @throws WebServiceSecurityException
090: * @throws RemoteException
091: */
092: void deletePortalApplicationVersions(String appPath, int[] versions)
093: throws WebServiceSecurityException, RemoteException;
094:
095: /**
096: * Lock this portal application so that other users will not be able to
097: * modify it.
098: * @param appPath
099: */
100: void lockPortalApplication(String appPath)
101: throws EntityLockedException, WebServiceSecurityException,
102: RemoteException;
103:
104: /**
105: * Unlock psite at given path
106: * @param appPath
107: * @return true if the lock belonged to the current user.
108: */
109: void unlockPortalApplication(String appPath)
110: throws EntityLockedException, WebServiceSecurityException,
111: RemoteException;
112:
113: /**
114: * Assign members to this site
115: * @param appPath
116: * @return true if the lock belonged to the current user.
117: */
118: void setPortalApplicationMembers(String appPath, String[] members)
119: throws WebServiceSecurityException, RemoteException;
120:
121: /**
122: * Returns psite members.
123: * @param appPath
124: * @return String array containing psite members, null if there are no members.
125: * @throws RemoteException
126: */
127: String[] getPortalApplicationMembers(String appPath)
128: throws WebServiceSecurityException, RemoteException;
129:
130: /**
131: * Check if a user is member of specified site.
132: * @param userName User name
133: * @param appPath Psite path
134: * @return true if the user is member of the psite.
135: */
136: boolean isMemberOf(String userName, String appPath)
137: throws RemoteException;
138:
139: PortalApplication[] getUserPortalApplications()
140: throws WebServiceSecurityException, RemoteException;
141:
142: /**
143: * Restores portal configuration.
144: * @return
145: * @throws RemoteException
146: */
147: PortalConfiguration restorePortalConfiguration()
148: throws RemoteException;
149:
150: /**
151: * Replaces current psite with a version indicated in the request.
152: * @param appPath
153: * @param versionNum
154: * @throws WebServiceSecurityException
155: * @throws RemoteException
156: */
157: void replacePortalApplicationWithVersion(String appPath,
158: int versionNum) throws WebServiceSecurityException,
159: RemoteException;
160:
161: /**
162: * Stores the portal configuration.
163: * @param pConfig
164: * @throws RemoteException
165: */
166: void savePortalConfiguration(PortalConfiguration pConfig)
167: throws RemoteException;
168:
169: /**
170: * Restores portlet configuration.
171: * @return
172: * @throws RemoteException
173: */
174: String restorePortletConfiguration() throws RemoteException;
175:
176: /**
177: * Save the portlet configuration.
178: * @param configXML
179: * @throws RemoteException
180: */
181: void savePortletConfiguration(String configXML)
182: throws RemoteException;
183:
184: /**
185: *
186: * @param userName
187: * @return
188: * @throws RemoteException
189: */
190: UserPreferences getUserPreferences(String userName)
191: throws RemoteException;
192:
193: /**
194: *
195: * @param prefs
196: * @throws RemoteException
197: */
198: void saveUserPreferences(UserPreferences prefs)
199: throws RemoteException;
200:
201: void deleteUserPreferences(String userName) throws RemoteException;
202:
203: void setUserIcon(String userName, byte[] icon)
204: throws RemoteException;
205:
206: byte[] getUserIcon(String userName) throws RemoteException;
207:
208: String[] getChildPsites(String appPath) throws RemoteException;
209:
210: List<VersionInfo> getVersionHistory(String portalPath,
211: int maxHistFiles) throws RemoteException;
212:
213: String getPortalApplicationOwner(String appPath);
214:
215: PortalApplication getPortalApplicationHelper(String appPath,
216: boolean getFromCache) throws WebServiceSecurityException,
217: RemoteException;
218:
219: }
|