Package org.apache.geronimo.xml.ns.j2ee.application_1

Examples of org.apache.geronimo.xml.ns.j2ee.application_1.ModuleType


  public JAXBElement createGeronimoApplicationDeploymentPlan(IFile dpFile) throws Exception {
    Trace.tracePoint("Entry",
        "V11DeploymentPlanCreationOperation.createGeronimoApplicationDeploymentPlan", dpFile);

    ObjectFactory applicationFactory = new ObjectFactory();
    ApplicationType application = applicationFactory.createApplicationType();

    application.setApplicationName(getProject().getName());
    application.setEnvironment(getConfigEnvironment());

    JAXBElement jaxbElement = applicationFactory.createApplication(application);
    JAXBUtils.marshalDeploymentPlan(jaxbElement, dpFile);

    Trace.tracePoint("Exit ", "V11DeploymentPlanCreationOperation.createGeronimoApplicationDeploymentPlan",
View Full Code Here


                    environment = plan.getEnvironment();
            }
        }
        else if (GeronimoUtils.isEarModule(module)) {
            if (getApplicationDeploymentPlan(module) != null) {
                ApplicationType plan = getApplicationDeploymentPlan(module).getValue();
                if (plan != null)
                    environment = plan.getEnvironment();
            }
        }
        else if (GeronimoUtils.isRARModule(module)) {
            if (getConnectorDeploymentPlan(module) != null) {
                ConnectorType plan = getConnectorDeploymentPlan(module).getValue();
                if (plan != null)
                    environment = plan.getEnvironment();
            }
        }else if (GeronimoUtils.isAppClientModule(module)) {
            if (getAppClientDeploymentPlan(module) != null) {
                ApplicationClientType plan = getAppClientDeploymentPlan(module).getValue();
                if (plan != null)
                    environment = plan.getServerEnvironment();
            }
        }

        Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
        return environment;
View Full Code Here

    } else if (isEjbJarModule(module)) {
      OpenejbJarType plan = getOpenEjbDeploymentPlan(module).getValue();
      // if (plan != null)
      // environment = plan.getEnvironment();
    } else if (isEarModule(module)) {
      ApplicationType plan = getApplicationDeploymentPlan(module).getValue();
      if (plan != null)
        environment = plan.getEnvironment();
    } else if (isRARModule(module)) {
      ConnectorType plan = getConnectorDeploymentPlan(module).getValue();
      if (plan != null)
        environment = plan.getEnvironment();
    }
    if (environment != null
              && environment.getModuleId() != null) {
              Trace.tracePoint("EXIT", "GeronimoV11Utils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
              return getQualifiedConfigID(environment.getModuleId());
View Full Code Here

        managedForm.addPart(new GBeanSection(getDeploymentPlan(), JAXBModelUtils.getGbeans(getDeploymentPlan()), body, toolkit, getStyle()));
        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan()), body, toolkit, getStyle(), true, true));
        managedForm.addPart(new ClassFilterSection(getDeploymentPlan(), JAXBModelUtils.getEnvironment(getDeploymentPlan()), body, toolkit, getStyle(), true, false));

        if (ApplicationType.class.isInstance(getDeploymentPlan().getValue())) {
          ApplicationType application = (ApplicationType)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
            managedForm.addPart(new ModuleSection(getDeploymentPlan(), body, toolkit, getStyle(), application.getModule()));
            managedForm.addPart(new ExtModuleSection(getDeploymentPlan(), body, toolkit, getStyle(), application.getExtModule()));
        }
        if (ConnectorType.class.isInstance(getDeploymentPlan().getValue())) {
          ConnectorType connector = (ConnectorType)((AbstractGeronimoDeploymentPlanEditor) getEditor()).getDeploymentPlan().getValue();
            managedForm.addPart(new AdminObjectSection(getDeploymentPlan(), body, toolkit, getStyle(), connector.getAdminobject()));
        }
View Full Code Here

    }
   
    public boolean performFinish() {
        ModuleWizardPage page = (ModuleWizardPage) getPages()[0];
        PathType path;
        ExtModuleType extModule;

        if (eObject == null) {
            eObject = getEFactory().create(ExtModuleType.class);
            JAXBElement plan = section.getPlan();

            extModule = (ExtModuleType)eObject;

            List extModuleList = ((ApplicationType)plan.getValue()).getExtModule();
            if (extModuleList == null) {
                extModuleList = (List)getEFactory().create(ExtModuleType.class);
            }
            extModuleList.add(eObject);
        }
        else {
            extModule = (ExtModuleType)eObject;
            extModule.setConnector(null);
            extModule.setEjb(null);
            extModule.setJava(null);
            extModule.setWeb(null);
            extModule.setExternalPath(null);
        }

        // NOTE!! this replaces the call to processEAttributes (page);
        path = (PathType)getEFactory().create(PathType.class);
        path.setValue(page.getTextEntry(0).getText());

        if (((ModuleWizardPage)page).buttonList[0].getSelection())
            extModule.setConnector(path);
        else if (((ModuleWizardPage)page).buttonList[1].getSelection())
            extModule.setEjb(path);
        else if (((ModuleWizardPage)page).buttonList[2].getSelection())
            extModule.setJava(path);
        else if (((ModuleWizardPage)page).buttonList[3].getSelection())
            extModule.setWeb(path);

        if (page.buttonList[4].getSelection()) {
            extModule.setInternalPath (page.getTextEntry(1).getText());
            extModule.setExternalPath(null);
        }
        else if (page.buttonList[5].getSelection()) {
         
          StringBuilder sb = new StringBuilder();
            for (int i = 2; i < 6; i++) {
                String value = page.getTextEntry(i).getText();
                 sb.append(value).append("/");
            }
            //remove last "/"
            sb.deleteCharAt(sb.length()-1);
           
            //for 1.1 external path is in this format: groupid/artifactid/version/type
            extModule.setExternalPath(sb.toString());

            extModule.setInternalPath(null);
        }

        if (section.getViewer().getInput() == section.getPlan()) {
            section.getViewer().setInput(section.getInput());
        }
View Full Code Here

        }

        public void createControl(Composite parent) {
            Composite composite = createComposite(parent);
            GridData data;
            ExtModuleType extModule = (ExtModuleType)eObject;
           
            // First we need a set of radio buttons to determine what kind of module we are
            // dealing with.
            Group group = new Group (composite, SWT.NONE);
            Button button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.connector);
            buttonList[0] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.ejb);
            buttonList[1] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.java);
            buttonList[2] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.web);
            buttonList[3] = button;
            GridLayout gridLayout = new GridLayout();
            gridLayout.numColumns = 4;
            group.setLayout(gridLayout);
            data = new GridData();
            data.horizontalAlignment = GridData.FILL;
            data.grabExcessHorizontalSpace = true;
            data.horizontalSpan = 2;
            group.setLayoutData(data);
           
            Group group2 = new Group (composite, SWT.NONE);
            for (int i = 1; i < section.getTableColumnNames().length; i++) {
                if (i == 2) {
                    button = new Button (group2, SWT.RADIO);
                    button.setText(CommonMessages.internalPath);
                    buttonList[4] = button;
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    data.horizontalSpan = 2;
                    button.setLayoutData(data);
                }
                if (i == 3) {
                    button = new Button (group2, SWT.RADIO);
                    button.setText(CommonMessages.externalPath);
                    buttonList[5] = button;
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    data.horizontalSpan = 2;
                    button.setLayoutData(data);
                }
                Text text;

                if (i == 1) {
                    Label label = new Label(group, SWT.LEFT);
                    String columnName = section.getTableColumnNames()[i];
                    if (!columnName.endsWith(":"))
                        columnName = columnName.concat(":");
                    label.setText(columnName);
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    label.setLayoutData(data);

                    text = new Text(group, SWT.SINGLE | SWT.BORDER);
                    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
                            | GridData.VERTICAL_ALIGN_FILL);
                    data.grabExcessHorizontalSpace = true;
                    data.widthHint = 100;
                    data.horizontalSpan = 3;
                    text.setLayoutData(data);
                }
                else {
                    Label label = new Label(group2, SWT.LEFT);
                    String columnName = section.getTableColumnNames()[i];
                    if (!columnName.endsWith(":"))
                        columnName = columnName.concat(":");
                    label.setText(columnName);
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    label.setLayoutData(data);

                    text = new Text(group2, SWT.SINGLE | SWT.BORDER);
                    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
                            | GridData.VERTICAL_ALIGN_FILL);
                    data.grabExcessHorizontalSpace = true;
                    data.widthHint = 100;
                    text.setLayoutData(data);
                }

                if (extModule != null) {
                    if (i == 1) {
                        if (extModule.getConnector() != null) {
                            text.setText(extModule.getConnector().getValue());
                            buttonList[0].setSelection(true);
                        }
                        else if (extModule.getEjb() != null) {
                            text.setText(extModule.getEjb().getValue());
                            buttonList[1].setSelection(true);
                        }
                        else if (extModule.getJava() != null) {
                            text.setText(extModule.getJava().getValue());
                            buttonList[2].setSelection(true);
                        }
                        else if (extModule.getWeb() != null) {
                            text.setText(extModule.getWeb().getValue());
                            buttonList[3].setSelection(true);
                        }                       
                    }
                    else if (i == 2 && extModule.getInternalPath() != null) {
                        text.setText(extModule.getInternalPath());
                    }
                    else if (i > 2 && extModule.getExternalPath() != null) {
                        String value= extModule.getExternalPath();
                        text.setText(value);
//            try {
//              value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
//            } catch (Exception e1) {
//              value = e1.getMessage();
//            }
//                        if (value != null) {
//                            text.setText(value);
//                        }
                    }
                }
                textEntries[i - 1] = text;
            }
            gridLayout = new GridLayout();
            gridLayout.numColumns = 2;
            group2.setLayout(gridLayout);
            data = new GridData();
            data.horizontalAlignment = GridData.FILL;
            data.grabExcessHorizontalSpace = true;
            data.horizontalSpan = 2;
            group2.setLayoutData(data);

            buttonList[4].addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                    if (buttonList[4].getSelection()) {
                       toggle();
                    }
                }
            });
            buttonList[5].addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                    if (buttonList[5].getSelection()) {
                        toggle();
                    }
                }
            });

            if (extModule == null) {
                buttonList[0].setSelection(true);
                buttonList[4].setSelection(true);
            }
            else if (extModule.getInternalPath() != null) {
                buttonList[4].setSelection(true);
            }
            else {
                buttonList[5].setSelection(true);
            }
View Full Code Here

    public ITableLabelProvider getLabelProvider() {
        return new LabelProvider() {
            @Override
            public String getColumnText(Object element, int columnIndex) {
                if (ExtModuleType.class.isInstance(element)) {
                  ExtModuleType extModule = (ExtModuleType) element;
                    switch (columnIndex) {
                    case 0:
                        if (extModule.getConnector() != null) {
                            return "connector";
                        } else if (extModule.getEjb() != null) {
                            return "ejb";
                        } else if (extModule.getJava() != null) {
                            return "java";
                        } else if (extModule.getWeb() != null) {
                            return "web";
                        }
                        return "";
                    case 1:
                        if (extModule.getConnector() != null) {
                            return extModule.getConnector().getValue();
                        } else if (extModule.getEjb() != null) {
                            return extModule.getEjb().getValue();
                        } else if (extModule.getJava() != null) {
                            return extModule.getJava().getValue();
                        } else if (extModule.getWeb() != null) {
                            return extModule.getWeb().getValue();
                        }
                        return "";
                    case 2:
                        if (extModule.getInternalPath() != null) {
                            return extModule.getInternalPath();
                        }
                        return "";
                    case 3:
                        if (extModule.getExternalPath() != null) {
                          String externalPath = extModule.getExternalPath();
                          //suppose external path is in format of "groupId/artifactId/version/type"
                          String[] segments = externalPath.split("/");
                            return segments[0];
                        }
                        return "";
                    case 4:
                        if (extModule.getExternalPath() != null) {
                          String externalPath = extModule.getExternalPath();
                          //suppose external path is in format of "groupId/artifactId/version/type"
                          String[] segments = externalPath.split("/");
                            return segments[1];
                        }
                        return "";
                    case 5:
                        if (extModule.getExternalPath() != null) {
                          String externalPath = extModule.getExternalPath();
                          //suppose external path is in format of "groupId/artifactId/version/type"
                          String[] segments = externalPath.split("/");
                            return segments[2];
                        }
                        return "";
                    case 6:
                        if (extModule.getExternalPath() != null) {
                          String externalPath = extModule.getExternalPath();
                          //suppose external path is in format of "groupId/artifactId/version/type"
                          String[] segments = externalPath.split("/");
                            return segments[3];
                        }
                        return "";
View Full Code Here

    }

    public boolean performFinish() {
        AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
        PathType path;
        ModuleType module;

        if (eObject == null) {
            eObject = getEFactory().create(ModuleType.class);
            JAXBElement plan = section.getPlan();

            module = (ModuleType)eObject;

            List moduleList = ((ApplicationType)plan.getValue()).getModule();
            if (moduleList == null) {
                moduleList = (List)getEFactory().create(ModuleType.class);
            }
            moduleList.add(eObject);
        }
        else {
            module = (ModuleType)eObject;
            module.setConnector(null);
            module.setEjb(null);
            module.setJava(null);
            module.setWeb(null);
        }

        // NOTE!! this replaces the call to processEAttributes (page);
        path = (PathType)getEFactory().create(PathType.class);
        path.setValue(page.getTextEntry(0).getText());

        if (((ModuleWizardPage)page).buttonList[0].getSelection())
            module.setConnector(path);
        else if (((ModuleWizardPage)page).buttonList[1].getSelection())
            module.setEjb(path);
        else if (((ModuleWizardPage)page).buttonList[2].getSelection())
            module.setJava(path);
        else if (((ModuleWizardPage)page).buttonList[3].getSelection())
            module.setWeb(path);
       
        String altDD = page.getTextEntry(1).getText();
        path = (PathType)getEFactory().create(PathType.class);
        path.setValue(altDD);
        module.setAltDd(path);
       
        if (section.getViewer().getInput() == section.getPlan()) {
            section.getViewer().setInput(section.getInput());
        }
View Full Code Here

        }

        public void createControl(Composite parent) {
            Composite composite = createComposite(parent);
            GridData data;
            ModuleType module = (ModuleType)eObject;
           
            // First we need a set of radio buttons to determine what kind of module we are
            // dealing with.
            Group group = new Group (composite, SWT.NONE);
            Button button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.connector);
            buttonList[0] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.ejb);
            buttonList[1] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.java);
            buttonList[2] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.web);
            buttonList[3] = button;
            FillLayout fillLayout = new FillLayout();
            fillLayout.type = SWT.HORIZONTAL;
            group.setLayout(fillLayout);
            data = new GridData();
            data.horizontalAlignment = GridData.FILL;
            data.horizontalSpan = 2;
            group.setLayoutData(data);
           
            for (int i = 1; i < section.getTableColumnNames().length; i++) {
                Label label = new Label(composite, SWT.LEFT);
                String columnName = section.getTableColumnNames()[i];
                if (!columnName.endsWith(":"))
                    columnName = columnName.concat(":");
                label.setText(columnName);
                data = new GridData();
                data.horizontalAlignment = GridData.FILL;
                label.setLayoutData(data);

                Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
                data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
                        | GridData.VERTICAL_ALIGN_FILL);
                data.grabExcessHorizontalSpace = true;
                data.widthHint = 100;
                text.setLayoutData(data);
                if (module != null) {
                    if (i == 1) {
                        if (module.getConnector() != null) {
                            text.setText(module.getConnector().getValue());
                            buttonList[0].setSelection(true);
                        }
                        else if (module.getEjb() != null) {
                            text.setText(module.getEjb().getValue());
                            buttonList[1].setSelection(true);
                        }
                        else if (module.getJava() != null) {
                            text.setText(module.getJava().getValue());
                            buttonList[2].setSelection(true);
                        }
                        else if (module.getWeb() != null) {
                            text.setText(module.getWeb().getValue());
                            buttonList[3].setSelection(true);
                        }                       
                    }
                    else if (i == 2 && module.getAltDd() != null) {
                        text.setText(module.getAltDd().getValue());
                    }
                }
                textEntries[i - 1] = text;
            }
View Full Code Here

    public ITableLabelProvider getLabelProvider() {
        return new LabelProvider() {
            @Override
            public String getColumnText(Object element, int columnIndex) {
                if (ModuleType.class.isInstance(element)) {
                  ModuleType module = (ModuleType) element;
                    switch (columnIndex) {
                    case 0:
                        if (module.getConnector() != null) {
                            return "connector";
                        } else if (module.getEjb() != null) {
                            return "ejb";
                        } else if (module.getJava() != null) {
                            return "java";
                        } else if (module.getWeb() != null) {
                            return "web";
                        }
                        return "";
                    case 1:
                        if (module.getConnector() != null) {
                            return module.getConnector().getValue();
                        } else if (module.getEjb() != null) {
                            return module.getEjb().getValue();
                        } else if (module.getJava() != null) {
                            return module.getJava().getValue();
                        } else if (module.getWeb() != null) {
                            return module.getWeb().getValue();
                        }
                        return "";
                    case 2:
                        if (module.getAltDd() != null) {
                            return module.getAltDd().getValue();
                        }
                        return "";
                    }
                }
                return null;
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xml.ns.j2ee.application_1.ModuleType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.