Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

svn commit: r234485 [1/2] - in /lenya/trunk/src: java/org/apache/lenya/ jav: msg#00059

cms.lenya.cvs

Subject: svn commit: r234485 [1/2] - in /lenya/trunk/src: java/org/apache/lenya/ java/org/apache/lenya/cms/ac/usecases/ java/org/apache/lenya/cms/usecase/ java/org/apache/lenya/cms/usecase/gui/ targets/ webapp/WEB-INF/ webapp/lenya/usecases/ webapp/lenya/usecas...

Author: andreas
Date: Mon Aug 22 06:06:26 2005
New Revision: 234485

URL: http://svn.apache.org/viewcvs?rev=234485&view=rev
Log:
Added usecase GUI manager to allow dynamic assembly of tabs in admin and site
environments. This will allow to register new tabs by modules using XPatch
files. Furthermore, tabs are now displayed / hidden based on access rights and
executability, similar to the menubar.

Added:
lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/
lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManager.java
lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManagerImpl.java
lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/Tab.java
lenya/trunk/src/webapp/lenya/usecases/templates/tabs.jx
Removed:
lenya/trunk/src/webapp/lenya/usecases/admin/tabs.jx
lenya/trunk/src/webapp/lenya/usecases/tab/tabs.jx
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/AccessControl.java
lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
lenya/trunk/src/java/org/apache/lenya/cms/usecase/UsecaseView.java
lenya/trunk/src/java/org/apache/lenya/lenya.roles
lenya/trunk/src/targets/publets-build.xml
lenya/trunk/src/targets/webapp-build.xml
lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl (contents, props changed)
lenya/trunk/src/webapp/lenya/usecases/admin/addGroup.jx
lenya/trunk/src/webapp/lenya/usecases/admin/addIPRange.jx
lenya/trunk/src/webapp/lenya/usecases/admin/addUser.jx
lenya/trunk/src/webapp/lenya/usecases/admin/changePassword.jx
lenya/trunk/src/webapp/lenya/usecases/admin/deleteGroup.jx
lenya/trunk/src/webapp/lenya/usecases/admin/deleteUser.jx
lenya/trunk/src/webapp/lenya/usecases/admin/emptyTrash.jx
lenya/trunk/src/webapp/lenya/usecases/admin/group.jx
lenya/trunk/src/webapp/lenya/usecases/admin/groupMembers.jx
lenya/trunk/src/webapp/lenya/usecases/admin/groupProfile.jx
lenya/trunk/src/webapp/lenya/usecases/admin/groups.jx
lenya/trunk/src/webapp/lenya/usecases/admin/ipRange.jx
lenya/trunk/src/webapp/lenya/usecases/admin/ipRangeGroups.jx
lenya/trunk/src/webapp/lenya/usecases/admin/ipRangeProfile.jx
lenya/trunk/src/webapp/lenya/usecases/admin/ipRanges.jx
lenya/trunk/src/webapp/lenya/usecases/admin/search.jx
lenya/trunk/src/webapp/lenya/usecases/admin/serverStatus.jx
lenya/trunk/src/webapp/lenya/usecases/admin/sessions.jx
lenya/trunk/src/webapp/lenya/usecases/admin/siteOverview.jx
lenya/trunk/src/webapp/lenya/usecases/admin/user.jx
lenya/trunk/src/webapp/lenya/usecases/admin/userGroups.jx
lenya/trunk/src/webapp/lenya/usecases/admin/userProfile.jx
lenya/trunk/src/webapp/lenya/usecases/admin/users.jx
lenya/trunk/src/webapp/lenya/usecases/edit-document.js
lenya/trunk/src/webapp/lenya/usecases/kupu/usecase-kupu.xmap
lenya/trunk/src/webapp/lenya/usecases/tab/ac/ac.jx
lenya/trunk/src/webapp/lenya/usecases/tab/assets.jx
lenya/trunk/src/webapp/lenya/usecases/tab/meta.jx
lenya/trunk/src/webapp/lenya/usecases/tab/overview.jx
lenya/trunk/src/webapp/lenya/usecases/tab/revisions.jx
lenya/trunk/src/webapp/lenya/usecases/tab/scheduler.jx
lenya/trunk/src/webapp/lenya/usecases/tab/workflow.jx

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/AccessControl.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/AccessControl.java?rev=234485&r1=234484&r2=234485&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/AccessControl.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/AccessControl.java
Mon Aug 22 06:06:26 2005
@@ -24,6 +24,7 @@
import org.apache.cocoon.ProcessingException;
import org.apache.lenya.cms.publication.Document;
import org.apache.lenya.cms.publication.DocumentIdentityMap;
+import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.URLInformation;
import org.apache.lenya.cms.usecase.UsecaseException;

@@ -51,6 +52,8 @@

public class AccessControl extends AccessControlUsecase {

+ protected static final String AC_AREA = "acArea";
+
private Item[] items = null;

protected static final String ADD = "add";
@@ -142,6 +145,18 @@
}

/**
+ * @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckPreconditions()
+ */
+ protected void doCheckPreconditions() throws Exception {
+ super.doCheckPreconditions();
+ URLInformation info = new URLInformation(getSourceURL());
+ String acArea = getParameterAsString(AC_AREA);
+ if (!acArea.equals(Publication.LIVE_AREA) &&
!info.getArea().equals(acArea)) {
+ addErrorMessage("This usecase can only be invoked in the
configured area.");
+ }
+ }
+
+ /**
* Validates the request parameters.
* @throws UsecaseException if an error occurs.
*/
@@ -409,7 +424,7 @@
String infoUrl = getSourceURL();
URLInformation info = new URLInformation(infoUrl);

- String area = getParameterAsString("acArea");
+ String area = getParameterAsString(AC_AREA);
String url = "/" + info.getPublicationId() + "/" + area +
info.getDocumentUrl();
return url;
}

Modified: lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java?rev=234485&r1=234484&r2=234485&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java Mon
Aug 22 06:06:26 2005
@@ -585,6 +585,11 @@
Configuration viewConfig = config.getChild(ELEMENT_VIEW, false);
if (viewConfig != null) {
this.view = new UsecaseView();
+ try {
+ view.service(this.manager);
+ } catch (ServiceException e) {
+ throw new ConfigurationException("Couldn't service view: ", e);
+ }
view.configure(viewConfig);
}


Modified: lenya/trunk/src/java/org/apache/lenya/cms/usecase/UsecaseView.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/usecase/UsecaseView.java?rev=234485&r1=234484&r2=234485&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/usecase/UsecaseView.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/usecase/UsecaseView.java Mon Aug
22 06:06:26 2005
@@ -22,21 +22,28 @@
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.lenya.cms.usecase.gui.GUIManager;
+import org.apache.lenya.cms.usecase.gui.Tab;

/**
* Information about a usecase view.
*
* @version $Id$
*/
-public class UsecaseView implements Configurable {
-
+public class UsecaseView implements Configurable, Serviceable {
+
protected static final String ATTRIBUTE_TEMPLATE_URI = "template";
protected static final String ATTRIBUTE_SHOW_MENU = "menu";
protected static final String ELEMENT_PARAMETER = "parameter";
protected static final String ATTRIBUTE_NAME = "name";
protected static final String ATTRIBUTE_VALUE = "value";
protected static final String ATTRIBUTE_URI = "uri";
-
+ protected static final String ATTRIBUTE_GROUP = "group";
+ protected static final String ELEMENT_TAB = "tab";
+
private Map parameters = new HashMap();

/**
@@ -46,12 +53,29 @@
this.templateUri = config.getAttribute(ATTRIBUTE_TEMPLATE_URI, null);
this.viewUri = config.getAttribute(ATTRIBUTE_URI, null);

+ Configuration tabConfig = config.getChild(ELEMENT_TAB, false);
+ if (tabConfig != null) {
+ String tabName = tabConfig.getAttribute(ATTRIBUTE_NAME);
+ String tabGroup = tabConfig.getAttribute(ATTRIBUTE_GROUP);
+ GUIManager guiMgr = null;
+ try {
+ guiMgr = (GUIManager) this.manager.lookup(GUIManager.ROLE);
+ this.tab = guiMgr.getTab(tabGroup, tabName);
+ } catch (ServiceException e) {
+ throw new RuntimeException(e);
+ } finally {
+ if (guiMgr != null) {
+ this.manager.release(guiMgr);
+ }
+ }
+ }
+
if (this.viewUri == null && this.templateUri == null) {
throw new ConfigurationException("Either uri or template attribute
must be declared!");
}
-
+
this.showMenu = config.getAttributeAsBoolean(ATTRIBUTE_SHOW_MENU,
false);
-
+
Configuration[] parameterConfigs =
config.getChildren(ELEMENT_PARAMETER);
for (int i = 0; i < parameterConfigs.length; i++) {
String name = parameterConfigs[i].getAttribute(ATTRIBUTE_NAME);
@@ -61,32 +85,32 @@
}

private String templateUri;
-
+
/**
* @return The URI of the JX template;
*/
public String getTemplateURI() {
return this.templateUri;
}
-
+
private String viewUri;
-
+
/**
* @return The URI of the JX template;
*/
public String getViewURI() {
return this.viewUri;
}
-
+
private boolean showMenu;
-
+
/**
* @return If the menubar should be visible on usecase screens.
*/
public boolean showMenu() {
return this.showMenu;
}
-
+
/**
* @param name The parameter name.
* @return The parameter value.
@@ -94,5 +118,44 @@
public String getParameter(String name) {
return (String) this.parameters.get(name);
}
-
+
+ private Tab tab;
+
+ /**
+ * @return The tab the usecase belongs to or <code>null</code>.
+ */
+ public Tab getTab() {
+ return this.tab;
+ }
+
+ /**
+ * @return All tabs in the same group.
+ */
+ public Tab[] getTabsInGroup() {
+ if (getTab() == null) {
+ return null;
+ } else {
+ GUIManager guiMgr = null;
+ try {
+ guiMgr = (GUIManager) this.manager.lookup(GUIManager.ROLE);
+ return guiMgr.getActiveTabs(getTab().getGroup());
+ } catch (ServiceException e) {
+ throw new RuntimeException(e);
+ } finally {
+ if (guiMgr != null) {
+ this.manager.release(guiMgr);
+ }
+ }
+ }
+ }
+
+ private ServiceManager manager;
+
+ /**
+ * @see
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+ */
+ public void service(ServiceManager manager) throws ServiceException {
+ this.manager = manager;
+ }
+
}

Added: lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManager.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManager.java?rev=234485&view=auto
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManager.java
(added)
+++ lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManager.java Mon
Aug 22 06:06:26 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 1999-2004 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.lenya.cms.usecase.gui;
+
+import org.apache.lenya.cms.usecase.UsecaseMessage;
+
+/**
+ * Usecase GUI manager.
+ */
+public interface GUIManager {
+
+ /**
+ * The service role.
+ */
+ String ROLE = GUIManager.class.getName();
+
+ /**
+ * @param group A tab group.
+ * @return All tabs of this group.
+ */
+ Tab[] getActiveTabs(String group);
+
+ /**
+ * @param group The group.
+ * @param name The tab name.
+ * @return The tab of this name within this group.
+ */
+ Tab getTab(String group, String name);
+
+}

Added: lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManagerImpl.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManagerImpl.java?rev=234485&view=auto
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManagerImpl.java
(added)
+++ lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/GUIManagerImpl.java
Mon Aug 22 06:06:26 2005
@@ -0,0 +1,257 @@
+/*
+ * Copyright 1999-2004 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.lenya.cms.usecase.gui;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.ServiceSelector;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.components.ContextHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.lenya.ac.AccessControlException;
+import org.apache.lenya.ac.AccessController;
+import org.apache.lenya.ac.AccessControllerResolver;
+import org.apache.lenya.ac.Authorizer;
+import org.apache.lenya.ac.Role;
+import org.apache.lenya.ac.impl.DefaultAccessController;
+import org.apache.lenya.ac.impl.PolicyAuthorizer;
+import org.apache.lenya.cms.ac.usecase.UsecaseAuthorizer;
+import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.publication.PublicationFactory;
+import org.apache.lenya.cms.usecase.Usecase;
+import org.apache.lenya.cms.usecase.UsecaseMessage;
+import org.apache.lenya.cms.usecase.UsecaseResolver;
+import org.apache.lenya.util.ServletHelper;
+import org.xml.sax.SAXException;
+
+/**
+ * GUI manager implementation.
+ */
+public class GUIManagerImpl extends AbstractLogEnabled implements GUIManager,
Configurable,
+ Serviceable, Contextualizable {
+
+ protected static final String ELEMENT_PARAMETER = "parameter";
+ protected static final String ELEMENT_TAB_GROUP = "tab-group";
+ protected static final String ELEMENT_TAB = "tab";
+ protected static final String ATTRIBUTE_NAME = "name";
+ protected static final String ATTRIBUTE_VALUE = "value";
+ protected static final String ATTRIBUTE_LABEL = "label";
+ protected static final String ATTRIBUTE_USECASE = "usecase";
+
+ private Map name2group = new HashMap();
+
+ /**
+ * @see
org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
+ */
+ public void configure(Configuration config) throws ConfigurationException {
+ Configuration[] tabGroupConfigs =
config.getChildren(ELEMENT_TAB_GROUP);
+ for (int i = 0; i < tabGroupConfigs.length; i++) {
+ String groupName = tabGroupConfigs[i].getAttribute(ATTRIBUTE_NAME);
+ List group = new ArrayList();
+ Configuration[] tabConfigs =
tabGroupConfigs[i].getChildren(ELEMENT_TAB);
+ for (int j = 0; j < tabConfigs.length; j++) {
+ String name = tabConfigs[j].getAttribute(ATTRIBUTE_NAME);
+ String label = tabConfigs[j].getAttribute(ATTRIBUTE_LABEL);
+ String usecase = tabConfigs[j].getAttribute(ATTRIBUTE_USECASE);
+ Tab tab = new Tab(groupName, name, usecase, label);
+ group.add(tab);
+
+ Configuration[] paramConfigs =
tabConfigs[j].getChildren(ELEMENT_PARAMETER);
+ for (int p = 0; p < paramConfigs.length; p++) {
+ String paramName =
paramConfigs[p].getAttribute(ATTRIBUTE_NAME);
+ String paramValue =
paramConfigs[p].getAttribute(ATTRIBUTE_VALUE);
+ tab.setParameter(paramName, paramValue);
+ }
+ }
+ name2group.put(groupName, group.toArray(new Tab[group.size()]));
+ }
+ }
+
+ /**
+ * @see
org.apache.lenya.cms.usecase.gui.GUIManager#getActiveTabs(java.lang.String)
+ */
+ public Tab[] getActiveTabs(String group) {
+ Tab[] tabs = getTabs(group);
+ List activeTabs = new ArrayList();
+ for (int i = 0; i < tabs.length; i++) {
+ if (getErrorMessages(tabs[i]).length == 0) {
+ activeTabs.add(tabs[i]);
+ }
+ }
+ return (Tab[]) activeTabs.toArray(new Tab[activeTabs.size()]);
+ }
+
+ protected Tab[] getTabs(String group) {
+ Tab[] tabs = (Tab[]) name2group.get(group);
+ return tabs;
+ }
+
+ /**
+ * @see
org.apache.lenya.cms.usecase.gui.GUIManager#getTab(java.lang.String,
java.lang.String)
+ */
+ public Tab getTab(String group, String name) {
+ Tab[] tabs = getTabs(group);
+ for (int i = 0; i < tabs.length; i++) {
+ if (name.equals(tabs[i].getName())) {
+ return tabs[i];
+ }
+ }
+ throw new IllegalArgumentException("No tab [" + name + "] in group ["
+ group + "]");
+ }
+
+ /**
+ * Checks if a tab's usecase can be executed.
+ * @param tab The tab.
+ * @return An array of error messages.
+ */
+ protected UsecaseMessage[] getErrorMessages(Tab tab) {
+
+ UsecaseMessage[] messages;
+
+ ServiceSelector selector = null;
+ AccessControllerResolver acResolver = null;
+ AccessController accessController = null;
+ UsecaseResolver usecaseResolver = null;
+ UsecaseAuthorizer authorizer = null;
+ try {
+
+ selector = (ServiceSelector)
this.manager.lookup(AccessControllerResolver.ROLE
+ + "Selector");
+ acResolver = (AccessControllerResolver) selector
+ .select(AccessControllerResolver.DEFAULT_RESOLVER);
+ accessController =
acResolver.resolveAccessController(this.webappUrl);
+
+ if (accessController instanceof DefaultAccessController) {
+ DefaultAccessController defaultAccessController =
(DefaultAccessController) accessController;
+ Authorizer[] authorizers =
defaultAccessController.getAuthorizers();
+ for (int i = 0; i < authorizers.length; i++) {
+ if (authorizers[i] instanceof UsecaseAuthorizer) {
+ authorizer = (UsecaseAuthorizer) authorizers[i];
+ }
+ }
+ }
+
+ usecaseResolver = (UsecaseResolver)
this.manager.lookup(UsecaseResolver.ROLE);
+
+ // filter item if usecase not allowed
+ if (tab.getUsecase() != null) {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Found usecase [" + tab.getUsecase() +
"]");
+ }
+ PublicationFactory factory =
PublicationFactory.getInstance(getLogger());
+ Publication pub = factory.getPublication(this.manager,
this.webappUrl);
+ if (!authorizer.authorizeUsecase(tab.getUsecase(), this.roles,
pub)) {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Usecase not authorized");
+ }
+ messages = new UsecaseMessage[1];
+ messages[0] = new UsecaseMessage("Access denied", null);
+ }
+ }
+
+ if (usecaseResolver.isRegistered(tab.getUsecase())) {
+ Usecase usecase = null;
+ try {
+ usecase = usecaseResolver.resolve(tab.getUsecase());
+ usecase.setSourceURL(this.webappUrl);
+ usecase.setName(tab.getUsecase());
+ String[] keys = tab.getParameterNames();
+ for (int i = 0; i < keys.length; i++) {
+ usecase.setParameter(keys[i],
tab.getParameter(keys[i]));
+ }
+ usecase.checkPreconditions();
+ if (usecase.hasErrors()) {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Usecase preconditions not
complied");
+ }
+
+ List msgs = usecase.getErrorMessages();
+ messages = (UsecaseMessage[]) msgs.toArray(new
UsecaseMessage[msgs.size()]);
+ } else {
+ messages = new UsecaseMessage[0];
+ }
+ } finally {
+ if (usecase != null) {
+ usecaseResolver.release(usecase);
+ }
+ }
+ } else {
+ messages = new UsecaseMessage[1];
+ messages[0] = new UsecaseMessage(
+ "Usecase [" + tab.getUsecase() + "] is not
registered!", null);
+ }
+ } catch (final Exception e) {
+ throw new RuntimeException(e);
+ } finally {
+ if (usecaseResolver != null) {
+ this.manager.release(usecaseResolver);
+ }
+ if (selector != null) {
+ if (acResolver != null) {
+ if (accessController != null) {
+ acResolver.release(accessController);
+ }
+ selector.release(acResolver);
+ }
+ this.manager.release(selector);
+ }
+ }
+
+ return messages;
+ }
+
+ private ServiceManager manager;
+
+ /**
+ * @see
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+ */
+ public void service(ServiceManager manager) throws ServiceException {
+ this.manager = manager;
+ }
+
+ private String webappUrl;
+ private Role[] roles;
+
+ /**
+ * @see
org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
+ */
+ public void contextualize(Context context) throws ContextException {
+ Request request = ContextHelper.getRequest(context);
+ try {
+ this.roles = PolicyAuthorizer.getRoles(request);
+ } catch (AccessControlException e) {
+ throw new ContextException("Obtaining roles failed: ", e);
+ }
+ this.webappUrl = ServletHelper.getWebappURI(request);
+ }
+
+}

Added: lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/Tab.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/Tab.java?rev=234485&view=auto
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/Tab.java (added)
+++ lenya/trunk/src/java/org/apache/lenya/cms/usecase/gui/Tab.java Mon Aug 22
06:06:26 2005
@@ -0,0 +1,71 @@
+/*
+ * Copyright 1999-2004 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.lenya.cms.usecase.gui;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+public class Tab {
+
+ public Tab(String group, String name, String usecase, String label) {
+ this.name = name;
+ this.group = group;
+ this.usecase = usecase;
+ this.label = label;
+ }
+
+ private Map parameters = new HashMap();
+
+ private String name;
+
+ public String getName() {
+ return this.name;
+ }
+
+ private String usecase;
+
+ private String label;
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getUsecase() {
+ return usecase;
+ }
+
+ private String group;
+
+ public String getGroup() {
+ return this.group;
+ }
+
+ void setParameter(String name, String value) {
+ this.parameters.put(name, value);
+ }
+
+ String[] getParameterNames() {
+ Set keys = this.parameters.keySet();
+ return (String[]) keys.toArray(new String[keys.size()]);
+ }
+
+ String getParameter(String key) {
+ return (String) this.parameters.get(key);
+ }
+
+}

Modified: lenya/trunk/src/java/org/apache/lenya/lenya.roles
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/lenya.roles?rev=234485&r1=234484&r2=234485&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/lenya.roles (original)
+++ lenya/trunk/src/java/org/apache/lenya/lenya.roles Mon Aug 22 06:06:26 2005
@@ -157,6 +157,10 @@
<role name="org.apache.lenya.cms.usecase.scheduling.UsecaseScheduler"
shorthand="usecase-scheduler"

default-class="org.apache.lenya.cms.usecase.scheduling.UsecaseSchedulerImpl"/>
+
+ <role name="org.apache.lenya.cms.usecase.gui.GUIManager"
+ shorthand="gui-manager"
+ default-class="org.apache.lenya.cms.usecase.gui.GUIManagerImpl"/>

<role name="org.apache.lenya.cms.publication.ResourceTypeSelector"
shorthand="resource-types"

Modified: lenya/trunk/src/targets/publets-build.xml
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/targets/publets-build.xml?rev=234485&r1=234484&r2=234485&view=diff
==============================================================================
--- lenya/trunk/src/targets/publets-build.xml (original)
+++ lenya/trunk/src/targets/publets-build.xml Mon Aug 22 06:06:26 2005
@@ -1,60 +1,62 @@
-<?xml version="1.0"?>
-<!--
- Copyright 1999-2004 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.
--->
-
-<!-- $Id: webapp-build.xml 177920 2005-05-23 04:59:37Z gregor $ -->
-
-<project name="publets">
-
- <description>
- Publets Targets
- </description>
-
- <property name="publets.root.dirs" value=""/>
- <property name="build.publets" value="${build.webapp}/lenya/publets"/>
-
- <target name="copy-publets">
- <copyPubs todir="${build.webapp}/lenya/publets"
- pubsrootdirs="${publets.root.dirs}"
- excludes="CVS,.svn"/>
- </target>
-
- <target name="publets-patch-cocoon-xconf">
- <copy file="${build.webapp}/WEB-INF/cocoon.xconf"
- toFile="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"/>
- <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
- srcdir="${build.publets}"
- includes="*/config/*.xconf"
- addComments="true"/>
- <checksum
- file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
- property="cocoon.xconf.md5"/>
- <checksum
- file="${build.webapp}/WEB-INF/cocoon.xconf"
- property="${cocoon.xconf.md5}"
- verifyProperty="cocoon.xconf.isEqual"/>
- <condition property="cocoon.xconf.copy">
- <isfalse value="${cocoon.xconf.isEqual}"/>
- </condition>
- <antcall target="copy-cocoon.xconf"/>
- <delete file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"/>
- </target>
-
- <target name="deploy-publets"
- depends="copy-publets, publets-patch-cocoon-xconf">
- </target>
-
-</project>
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<!-- $Id: webapp-build.xml 177920 2005-05-23 04:59:37Z gregor $ -->
+
+<project name="publets">
+
+ <description>
+ Publets Targets
+ </description>
+
+ <property name="publets.root.dirs" value=""/>
+ <property name="build.publets" value="${build.webapp}/lenya/publets"/>
+
+ <target name="copy-publets">
+ <copyPubs todir="${build.webapp}/lenya/publets"
+ pubsrootdirs="${publets.root.dirs}"
+ excludes="CVS,.svn"/>
+ </target>
+
+ <target name="publets-patch-cocoon-xconf">
+ <copy file="${build.webapp}/WEB-INF/cocoon.xconf"
+ toFile="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"/>
+ <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
+ srcdir="${build.publets}"
+ includes="*/config/*.xconf"
+ addComments="true"/>
+ <checksum
+ file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
+ property="cocoon.xconf.md5"/>
+ <checksum
+ file="${build.webapp}/WEB-INF/cocoon.xconf"
+ property="${cocoon.xconf.md5}"
+ verifyProperty="cocoon.xconf.isEqual"/>
+ <condition property="cocoon.xconf.copy">
+ <isfalse value="${cocoon.xconf.isEqual}"/>
+ </condition>
+ <antcall target="copy-cocoon.xconf"/>
+<!--
+ <delete file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"/>
+-->
+ </target>
+
+ <target name="deploy-publets"
+ depends="copy-publets, publets-patch-cocoon-xconf">
+ </target>
+
+</project>

Modified: lenya/trunk/src/targets/webapp-build.xml
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/targets/webapp-build.xml?rev=234485&r1=234484&r2=234485&view=diff
==============================================================================
--- lenya/trunk/src/targets/webapp-build.xml (original)
+++ lenya/trunk/src/targets/webapp-build.xml Mon Aug 22 06:06:26 2005
@@ -66,7 +66,7 @@
<isfalse value="${cocoon.xconf.isEqual}"/>
</condition>
<antcall target="copy-cocoon.xconf"/>
- <delete file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"/>
+ <delete file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
failonerror="false"/>

<!-- Patch web.xml -->
<!--


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation