You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ge...@apache.org on 2005/08/25 16:44:19 UTC
svn commit: r240081 - in /geronimo/trunk/sandbox/eclipse-plugin:
org.apache.geronimo.core/src/org/apache/geronimo/core/operations/
org.apache.geronimo.ui/META-INF/
org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/
org.apache.geronimo.ui/src/o...
Author: geirm
Date: Thu Aug 25 07:44:13 2005
New Revision: 240081
URL: http://svn.apache.org/viewcvs?rev=240081&view=rev
Log:
GERONIMO-909 : geronimo.core.patch.txt and geronimo.ui.patch.txt
Modified:
geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java
geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF
geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java
geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java
geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java
Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java?rev=240081&r1=240080&r2=240081&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java Thu Aug 25 07:44:13 2005
@@ -83,7 +83,7 @@
for (int i = 0; i < refs.length; i++) {
IVirtualComponent refComp = refs[i].getReferencedComponent();
EObject plan = getDeploymentPlanForComponent(refComp);
- if(plan != null) {
+ if (plan != null) {
addToGeronimoApplicationPlan(plan, refComp);
}
}
@@ -91,10 +91,11 @@
return null;
}
-
- //TODO
- private void addToGeronimoApplicationPlan(EObject eObject, IVirtualComponent component) {
-
+
+ // TODO
+ private void addToGeronimoApplicationPlan(EObject eObject,
+ IVirtualComponent component) {
+
}
private EObject getDeploymentPlanForComponent(IVirtualComponent comp) {
@@ -111,19 +112,8 @@
private EObject getWebDeploymentPlan(IVirtualComponent comp) {
IPath deployPlanPath = comp.getRootFolder().getUnderlyingFolder()
.getProjectRelativePath().append("WEB-INF").append(
- WEB_PLAN_NAME);
-
- IFile planFile = comp.getProject().getFile(deployPlanPath);
-
- if (planFile.exists()) {
- Resource resource = load(planFile);
- if (resource != null) {
- return (EObject) resource.getContents().get(0);
- }
- }
-
- return null;
-
+ WEB_PLAN_NAME);
+ return load(comp.getProject().getFile(deployPlanPath));
}
private EObject getOpenEjbDeploymentPlan(IVirtualComponent comp) {
@@ -153,23 +143,25 @@
return null;
}
- public Resource load(IFile file) {
- try {
- ResourceSet resourceSet = new ResourceSetImpl();
- DeploymentPlanCreationOperation.registerForWeb(resourceSet);
-
- URI uri = URI.createPlatformResourceURI(file.getFullPath()
- .toString());
-
- Resource resource = resourceSet.createResource(uri);
- if (!resource.isLoaded()) {
- resource.load(null);
+ public EObject load(IFile file) {
+ if (file.exists()) {
+ try {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ DeploymentPlanCreationOperation.registerForWeb(resourceSet);
+
+ URI uri = URI.createPlatformResourceURI(file.getFullPath()
+ .toString());
+
+ Resource resource = resourceSet.createResource(uri);
+ if (!resource.isLoaded()) {
+ resource.load(null);
+ }
+ return (EObject) resource.getContents().get(0);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
}
- return resource;
- } catch (MalformedURLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
}
return null;
}
Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF?rev=240081&r1=240080&r2=240081&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/META-INF/MANIFEST.MF Thu Aug 25 07:44:13 2005
@@ -25,5 +25,6 @@
org.eclipse.ui.workbench,
org.eclipse.ui.workbench.texteditor,
org.eclipse.ui.browser,
- org.eclipse.wst.server.ui
+ org.eclipse.wst.server.ui,
+ org.eclipse.jst.server.generic.core
Eclipse-AutoStart: true
Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java?rev=240081&r1=240080&r2=240081&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java Thu Aug 25 07:44:13 2005
@@ -57,10 +57,6 @@
public static String editorSectionSecurityRolesTitle;
public static String editorSectionSecurityRolesDescription;
-
- public static String name;
-
- public static String description;
public static String name;
@@ -151,16 +147,6 @@
public static String wizardPageTitle_EjbLocalRef;
public static String wizardPageDescription_EjbLocalRef;
-
- //
-
- public static String wizardNewTitle_SecurityRole;
-
- public static String wizardEditTitle_SecurityRole;
-
- public static String wizardPageTitle_SecurityRole;
-
- public static String wizardPageDescription_SecurityRole;
//
Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java?rev=240081&r1=240080&r2=240081&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/SecuritySection.java Thu Aug 25 07:44:13 2005
@@ -161,7 +161,8 @@
.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
roleNameText.setEnabled(true);
- Label roleDescriptionLabel = toolkit.createLabel(detail, Messages.description + ":");
+ Label roleDescriptionLabel = toolkit.createLabel(detail,
+ Messages.description + ":");
roleDescriptionLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
false, false));
roleDescriptionLabel.setEnabled(true);
@@ -187,14 +188,17 @@
SecurityType secType = (SecurityType) getPlan().eGet(securityERef);
- EList list = (EList) (secType.getRoleMappings().getRole());
+ if (secType != null) {
- for (int j = 0; j < list.size(); j++) {
- TableItem item = new TableItem(table, SWT.NONE);
- String[] tableTextData = getTableText((EObject) list.get(j));
- item.setImage(getImage());
- item.setText(tableTextData);
- item.setData((EObject) list.get(j));
+ EList list = (EList) (secType.getRoleMappings().getRole());
+
+ for (int j = 0; j < list.size(); j++) {
+ TableItem item = new TableItem(table, SWT.NONE);
+ String[] tableTextData = getTableText((EObject) list.get(j));
+ item.setImage(getImage());
+ item.setText(tableTextData);
+ item.setData((EObject) list.get(j));
+ }
}
}
@@ -213,9 +217,10 @@
TableItem item = (TableItem) e.item;
RoleType roleType = (RoleType) item.getData();
roleName.setText(roleType.getRoleName());
-
- if(!roleType.getDescription().isEmpty()) {
- description.setText(((DescriptionType)roleType.getDescription().get(0)).getLang());
+
+ if (!roleType.getDescription().isEmpty()) {
+ description.setText(((DescriptionType) roleType
+ .getDescription().get(0)).getLang());
} else {
description.setText("");
}
Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java?rev=240081&r1=240080&r2=240081&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ServerSecurityEditorSection.java Thu Aug 25 07:44:13 2005
@@ -107,113 +107,3 @@
}
}
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- * 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.geronimo.ui.sections;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.wst.server.ui.editor.ServerEditorSection;
-
-/**
- *
- *
- */
-public class ServerSecurityEditorSection extends ServerEditorSection {
-
- /**
- *
- */
- public ServerSecurityEditorSection() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#createSection(org.eclipse.swt.widgets.Composite)
- */
- public void createSection(Composite parent) {
- super.createSection(parent);
-
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- Section section = toolkit.createSection(parent,
- ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
- | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
- | ExpandableComposite.FOCUS_TITLE);
-
- section.setText("Security Settings");
- section.setDescription("Provide security settings for the server.");
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- section.setClient(composite);
-
- // ------- Label and text field for the username -------
- createLabel(composite, "Username:", toolkit);
-
- Text username = toolkit.createText(composite, "system", SWT.BORDER);
- username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- username.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
-
- }
- });
-
- // ------- Label and text field for the password -------
- createLabel(composite, "Password:", toolkit);
-
- Text password = toolkit
- .createText(composite, "password", SWT.BORDER);
- password
- .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
- password.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
-
- }
- });
-
- }
-
- protected Label createLabel(Composite parent, String text,
- FormToolkit toolkit) {
- Label label = toolkit.createLabel(parent, text);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- return label;
- }
-
-}
Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java?rev=240081&r1=240080&r2=240081&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.ui/src/org/apache/geronimo/ui/wizards/SecurityRoleWizard.java Thu Aug 25 07:44:13 2005
@@ -123,128 +123,3 @@
return true;
}
}
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- * 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.geronimo.ui.wizards;
-
-import org.apache.geronimo.ui.internal.Messages;
-import org.apache.geronimo.ui.sections.DynamicTableSection;
-import org.apache.geronimo.ui.sections.SecuritySection;
-import org.apache.geronimo.xml.ns.security.DescriptionType;
-import org.apache.geronimo.xml.ns.security.RoleMappingsType;
-import org.apache.geronimo.xml.ns.security.RoleType;
-import org.apache.geronimo.xml.ns.security.SecurityFactory;
-import org.apache.geronimo.xml.ns.security.SecurityPackage;
-import org.apache.geronimo.xml.ns.security.SecurityType;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.TableItem;
-
-public class SecurityRoleWizard extends DynamicAddEditWizard {
-
- public SecurityRoleWizard(DynamicTableSection section) {
- super(section);
- }
-
- public String getAddWizardWindowTitle() {
- return Messages.wizardNewTitle_SecurityRole;
- }
-
- public String getEditWizardWindowTitle() {
- return Messages.wizardEditTitle_SecurityRole;
- }
-
- public String getWizardFirstPageTitle() {
- return Messages.wizardPageTitle_SecurityRole;
- }
-
- public String getWizardFirstPageDescription() {
- return Messages.wizardPageDescription_SecurityRole;
- }
-
- public boolean performFinish() {
- DynamicWizardPage page = (DynamicWizardPage) getPages()[0];
-
- boolean isNew = false;
-
- if (eObject == null) {
- eObject = section.getEFactory().create(
- section.getTableColumnEAttributes()[0]
- .getEContainingClass());
- EObject plan = section.getPlan();
-
- SecurityType securityType = (SecurityType) plan
- .eGet(SecuritySection.securityERef);
- if (securityType == null) {
- securityType = SecurityFactory.eINSTANCE.createSecurityType();
- plan.eSet(SecuritySection.securityERef, securityType);
- }
-
- RoleMappingsType roleMappingsType = securityType.getRoleMappings();
- if (roleMappingsType == null) {
- roleMappingsType = SecurityFactory.eINSTANCE
- .createRoleMappingsType();
- securityType.setRoleMappings(roleMappingsType);
- }
-
- roleMappingsType.getRole().add(eObject);
- isNew = true;
- }
-
- for (int i = 0; i < section.getTableColumnEAttributes().length; i++) {
- String value = page.textEntries[i].getText();
- EAttribute attribute = section.getTableColumnEAttributes()[i];
- if (attribute.getEContainingClass().equals(eObject.eClass())) {
- eObject.eSet(attribute, value);
- } else {
- if (attribute.getFeatureID() == SecurityPackage.DESCRIPTION_TYPE__LANG) {
- DescriptionType type = null;
- RoleType roleType = ((RoleType) eObject);
- if (roleType.getDescription().isEmpty()) {
- type = SecurityFactory.eINSTANCE
- .createDescriptionType();
- roleType.getDescription().add(type);
- } else {
- type = (DescriptionType) roleType.getDescription().get(
- 0);
- }
- type.setLang(value);
- }
- }
- }
-
- String[] tableText = section.getTableText(eObject);
-
- if (isNew) {
- TableItem item = new TableItem(section.getTableViewer().getTable(),
- SWT.NONE);
- item.setImage(section.getImage());
- item.setData(eObject);
- item.setText((String) eObject.eGet(SecurityPackage.eINSTANCE
- .getRoleType_RoleName()));
- } else {
- int index = section.getTableViewer().getTable().getSelectionIndex();
- if (index != -1) {
- TableItem item = section.getTableViewer().getTable().getItem(
- index);
- item.setText(tableText);
- }
- }
-
- return true;
- }
-}