Author: ips
Date: 2008-10-22 20:54:28 -0400 (Wed, 22 Oct 2008)
New Revision: 19
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java
trunk/core/src/main/java/org/jboss/on/embedded/bean/MeasurementDisplay.java
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/content/ContentServerServiceImpl.java
trunk/core/src/main/java/org/jboss/on/embedded/manager/ResourceManager.java
trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java
trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java
trunk/core/src/main/java/org/jboss/on/embedded/ui/content/ResourceTypeContentAction.java
trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
trunk/core/src/main/webapp/WEB-INF/pages.xml
trunk/core/src/main/webapp/include/tabMenu.xhtml
trunk/core/src/main/webapp/secure/resourceContentCreate.xhtml
trunk/core/src/main/webapp/secure/resourceTypeSummary.xhtml
trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java
trunk/pom.xml
Log:
resource-create/deploy is now implemented, e.g. for WARs and EARs
(
https://jira.jboss.org/jira/browse/EMBJOPR-9)
Modified: trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java 2008-10-22
21:08:53 UTC (rev 18)
+++ trunk/core/src/main/java/org/jboss/on/embedded/BootstrapAction.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -57,9 +57,9 @@
import java.util.logging.Level;
/**
- * A Seam managed bean that bootstraps the admin console immediately after the WAR is
deployed.
+ * A Seam managed bean that bootstraps the admin console immediately after the admin
console WAR is deployed.
*/
-@Name("pluginContainerBootstrap")
+@Name("bootstrapAction")
@Scope(ScopeType.APPLICATION)
@Startup
public class BootstrapAction
@@ -76,6 +76,8 @@
@In(value = "contentHistoryManager", create = true)
private ContentHistoryManagerBean contentHistoryManager;
+ private File tempDir;
+
@Create
public void init() throws ServletException
{
@@ -98,6 +100,11 @@
PluginContainer.getInstance().shutdown();
}
+ public File getTempDir()
+ {
+ return this.tempDir;
+ }
+
private void bootstrap()
throws Exception
{
@@ -151,7 +158,7 @@
PluginContainerConfiguration config = new PluginContainerConfiguration();
config.setPluginFinder(createPluginFinder());
setPluginContainerDataDirectory(config);
- setPluginContainerTempDirectory(config);
+ config.setTemporaryDirectory(initTempDir());
config.setContentDiscoveryPeriod(0);
ServerServices services = new ServerServices();
@@ -212,25 +219,18 @@
}
}
- private static void setPluginContainerTempDirectory(PluginContainerConfiguration
config)
+ private File initTempDir()
{
- File tempDirectory = getDirectory("jboss.server.temp.dir");
- if (tempDirectory != null)
- {
- File jonTempDirectory = new File(tempDirectory + File.separator +
"jon_temp");
- if (jonTempDirectory.exists())
- {
- config.setTemporaryDirectory(jonTempDirectory);
- }
- else
- {
- // only set it, if the create was successful
- if (jonTempDirectory.mkdir())
- {
- config.setTemporaryDirectory(jonTempDirectory);
- }
- }
- }
+ String jbasTempDir = System.getProperty("jboss.server.temp.dir");
+ String javaTempDir = System.getProperty("java.io.tmpdir");
+ String baseTempDir = (jbasTempDir != null) ? jbasTempDir : javaTempDir;
+ if (baseTempDir == null)
+ baseTempDir = File.separatorChar == '/' ? "/tmp" :
"C:/tmp";
+ this.tempDir = new File(baseTempDir, "embjopr");
+ this.tempDir.mkdirs();
+ if (!this.tempDir.exists())
+ throw new IllegalStateException("Failed to initialize temporary
directory: " + this.tempDir);
+ return this.tempDir;
}
@Nullable
Modified: trunk/core/src/main/java/org/jboss/on/embedded/bean/MeasurementDisplay.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/bean/MeasurementDisplay.java 2008-10-22
21:08:53 UTC (rev 18)
+++ trunk/core/src/main/java/org/jboss/on/embedded/bean/MeasurementDisplay.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -19,6 +19,8 @@
*/
package org.jboss.on.embedded.bean;
+import java.io.Serializable;
+
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.composite.MeasurementValueAndUnits;
@@ -28,7 +30,7 @@
*
* @author Jessica Sant
*/
-public class MeasurementDisplay
+public class MeasurementDisplay implements Serializable
{
/**
* the data to be displayed
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/content/ContentServerServiceImpl.java
===================================================================
---
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/content/ContentServerServiceImpl.java 2008-10-22
21:08:53 UTC (rev 18)
+++
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/content/ContentServerServiceImpl.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.BufferedInputStream;
import java.util.Set;
import org.apache.commons.logging.Log;
@@ -60,38 +61,51 @@
public void completeDeletePackageRequest(RemovePackagesResponse response)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In completeDeletePackageRequest");
+ log.debug("In completeDeletePackageRequest()");
}
public void completeDeployPackageRequest(DeployPackagesResponse response)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In completeDeployPackageRequest");
+ log.debug("In completeDeployPackageRequest()");
}
public void completeRetrievePackageBitsRequest(ContentServiceResponse response,
InputStream contentStream)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In
completeRetrievePackageBitsRequest");
+ log.debug("In completeRetrievePackageBitsRequest()");
}
public long downloadPackageBitsForChildResource(int parentResourceId, String
resourceTypeName, PackageDetailsKey packageDetailsKey, OutputStream outputStream)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In
downloadPackageBitsForChildResource");
+ log.debug("In downloadPackageBitsForChildResource()");
long bitSize;
String fileName = packageDetailsKey.getName();
File file = new File(fileName);
+ InputStream inputStream = null;
try
{
- FileInputStream stream = new FileInputStream(file);
+ inputStream = new BufferedInputStream(new FileInputStream(file));
byte[] fileBytes = new byte[(int)file.length()];
- bitSize = stream.read(fileBytes);
+ bitSize = inputStream.read(fileBytes);
+ inputStream.close();
outputStream.write(fileBytes);
-
}
catch (IOException e)
{
- log.error("Unable to downloadPackageBitsForChildResource", e);
+ log.error("Unable to download package bits for " + resourceTypeName
+ " child Resource.", e);
bitSize = -1;
}
+ finally
+ {
+ if (inputStream != null)
+ try
+ {
+ inputStream.close();
+ }
+ catch (IOException e)
+ {
+ log.error("Failed to close input stream.", e);
+ }
+ }
return bitSize;
}
@@ -102,13 +116,13 @@
public long downloadPackageBitsRangeGivenResource(int resourceId, PackageDetailsKey
packageDetailsKey, OutputStream outputStream, long startByte, long endByte)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In
downloadPackageBitsRangeGivenResource");
+ log.debug("In downloadPackageBitsRangeGivenResource()");
return 0;
}
public long getPackageBitsLength(int resourceId, PackageDetailsKey
packageDetailsKey)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In getPackageBitsLength");
+ log.debug("In getPackageBitsLength()");
long bitsLength = 0;
String fileName = packageDetailsKey.getName();
File file = new File(fileName);
@@ -121,19 +135,19 @@
public PageList<PackageVersionMetadataComposite> getPackageVersionMetadata(int
resourceId, PageControl pc)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In getPackageVersionMetadata");
+ log.debug("In getPackageVersionMetadata()");
return null;
}
public String getResourceSubscriptionMD5(int resourceId)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In getResourceSubscriptionMD5");
+ log.debug("In getResourceSubscriptionMD5()");
return null;
}
public Set<ResourcePackageDetails> loadDependencies(int requestId,
Set<PackageDetailsKey> dependencyPackages)
{
- log.info("$$$$$$$$$$$$$$$$$$$$$$$$ In loadDependencies");
+ log.debug("In loadDependencies()");
return null;
}
Modified: trunk/core/src/main/java/org/jboss/on/embedded/manager/ResourceManager.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/manager/ResourceManager.java 2008-10-22
21:08:53 UTC (rev 18)
+++ trunk/core/src/main/java/org/jboss/on/embedded/manager/ResourceManager.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -124,12 +124,12 @@
*
* @param resourceName name of the resource being created
* @param resourceType type of resource being created.
- * @param ancestorResource the closest ancestor resource to the one being created,
usually parent
+ * @param parentResource the parent resource of the one being created
* @param pluginConfiguration optional values that can be used use when creating
the newly created resource.
* @param packageDetails PackagedDetails for a content backed resource.
* @return returns the CreateResourceRequest, allows the caller to check for errors
and status.
*/
- CreateResourceResponse createResource(String resourceName, ResourceType resourceType,
Resource ancestorResource, Configuration pluginConfiguration, ResourcePackageDetails
packageDetails);
+ CreateResourceResponse createResource(String resourceName, ResourceType resourceType,
Resource parentResource, Configuration pluginConfiguration, ResourcePackageDetails
packageDetails);
/**
* Updates the resource with the specified configuration values.
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java
===================================================================
---
trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java 2008-10-22
21:08:53 UTC (rev 18)
+++
trunk/core/src/main/java/org/jboss/on/embedded/manager/pc/PluginContainerResourceManager.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -277,10 +277,10 @@
return response;
}
- public CreateResourceResponse createResource(String resourceName, ResourceType
resourceType, Resource ancestorResource, Configuration pluginConfiguration,
ResourcePackageDetails packageDetails)
+ public CreateResourceResponse createResource(String resourceName, ResourceType
resourceType, Resource parentResource, Configuration pluginConfiguration,
ResourcePackageDetails packageDetails)
{
CreateResourceResponse response;
- CreateResourceRequest request = new CreateResourceRequest(1,
ancestorResource.getId(), resourceName, resourceType.getName(), resourceType.getPlugin(),
pluginConfiguration, packageDetails);
+ CreateResourceRequest request = new CreateResourceRequest(1,
parentResource.getId(), resourceName, resourceType.getName(), resourceType.getPlugin(),
pluginConfiguration, packageDetails);
response = createResource(resourceType, request);
return response;
Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java 2008-10-22
21:08:53 UTC (rev 18)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/SummaryAction.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -70,7 +70,7 @@
/**
* the resourceType that was selected based on the path request parameter
*/
- @Out(required = false)
+ @Out(required = false, scope = ScopeType.PAGE)
private ResourceType resourceType;
/**
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/ui/content/ResourceTypeContentAction.java
===================================================================
---
trunk/core/src/main/java/org/jboss/on/embedded/ui/content/ResourceTypeContentAction.java 2008-10-22
21:08:53 UTC (rev 18)
+++
trunk/core/src/main/java/org/jboss/on/embedded/ui/content/ResourceTypeContentAction.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -19,54 +19,78 @@
*/
package org.jboss.on.embedded.ui.content;
-import org.jboss.on.embedded.manager.ResourceManager;
-import org.jboss.on.embedded.manager.ResourceManagerFactory;
-import org.jboss.on.embedded.ui.NavigationAction;
-import org.jboss.on.embedded.ui.nav.JONTreeNode;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jetbrains.annotations.Nullable;
+
import org.jboss.seam.ScopeType;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.web.RequestParameter;
+import org.jboss.seam.faces.FacesMessages;
+
import org.rhq.core.clientapi.server.plugin.content.ContentSourcePackageDetailsKey;
+import org.rhq.core.clientapi.agent.inventory.CreateResourceResponse;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.PackageType;
import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import javax.faces.application.FacesMessage;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.File;
-import java.util.Set;
+import org.jboss.on.embedded.manager.ResourceManager;
+import org.jboss.on.embedded.manager.ResourceManagerFactory;
+import org.jboss.on.embedded.ui.NavigationAction;
+import org.jboss.on.embedded.ui.nav.JONTreeNode;
+import org.jboss.on.embedded.ui.nav.ResourceTypeTreeNode;
+import org.jboss.on.embedded.BootstrapAction;
+/**
+ * A Seam action for creating a content-backed Resource (e.g. a WAR or an EAR).
+ *
+ * @author Ian Springer
+ */
@Name("resourceTypeContentAction")
-(a)Scope(ScopeType.PAGE)
+(a)Scope(ScopeType.CONVERSATION)
public class ResourceTypeContentAction
{
+ private static final String SUCCESS_OUTCOME = "success";
+ private static final String FAILURE_OUTCOME = "failure";
- private final Log LOG = LogFactory.getLog(ResourceTypeContentAction.class);
+ private final Log log = LogFactory.getLog(ResourceTypeContentAction.class);
- private ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
+ private final ResourceManager resourceManager =
ResourceManagerFactory.resourceManager();
private String fileName;
private byte[] file;
private String fileContentType;
-
- @In(value = "navigationAction", required = false)
+
+ @Out
+ private ConfigurationDefinition configurationDefinition;
+
+ @Out
+ private Configuration configuration;
+
+ @In
NavigationAction navigationAction;
+ @In
+ BootstrapAction bootstrapAction;
+
/**
* facesMessages is a Seam Component that will handle the success/fail messages
across a page redirect
*/
@@ -76,70 +100,117 @@
@RequestParameter
String selectedResourceTypeName;
+ private ResourceType resourceType;
+
+ private PackageType packageType;
+
+ @Begin(join = true)
+ public String init()
+ {
+ ResourceTypeTreeNode resourceTypeTreeNode =
(ResourceTypeTreeNode)this.navigationAction.getSelectedNode();
+ this.resourceType = resourceTypeTreeNode.getResourceType();
+ this.packageType = getCreationPackageType(this.resourceType);
+ if (this.packageType == null)
+ {
+ facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
"content.resourceInstance.create.resourceTypeHasNoCreationPackageType");
+ return FAILURE_OUTCOME;
+ }
+ this.configurationDefinition =
this.packageType.getDeploymentConfigurationDefinition();
+ if (this.configurationDefinition != null)
+ {
+ if (this.configurationDefinition.getDefaultTemplate() != null)
+ //noinspection ConstantConditions
+ this.configuration =
this.configurationDefinition.getDefaultTemplate().getConfiguration();
+ else
+ this.configuration = new Configuration();
+ }
+ return SUCCESS_OUTCOME;
+ }
+
+ @End(ifOutcome={"success"})
public String createContentBackedResource()
{
- selectedResourceTypeName = "Enterprise Application (EAR)";
- ResourceType resourceType =
resourceManager.getResourceType(selectedResourceTypeName);
- String resourceName = fileName;
- String tempFileName = System.getProperty("jboss.server.temp.dir") +
System.getProperty("file.separator") + "jon_temp/" + fileName;
+ if (this.fileName == null)
+ {
+ // NOTE: This check is necessary, because the "required" attribute
of the Seam FileUpload component doesn't
+ // work.
+ facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
+ "content.resourceInstance.create.noFileSelected");
+ return FAILURE_OUTCOME;
+ }
+ log.debug("Creating content-backed " + this.resourceType + "
Resource " + this.fileName + "...");
+ File tempDir = this.bootstrapAction.getTempDir();
+ tempDir.mkdirs(); // just in case the temp dir got deleted since this webapp was
last deployed
+ File tempFile;
try
{
- if (resourceName != null)
- {
- File newTempFile = new File(tempFileName);
- boolean createdTempFile = newTempFile.createNewFile();
- if (createdTempFile)
- {
- FileOutputStream fos = new FileOutputStream(newTempFile);
- fos.write(file);
+ tempFile = writeTempFile(tempDir);
+ }
+ catch (IOException e)
+ {
+ facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
+ "content.resourceInstance.create.unableToCreateTempFile");
+ log.error("Unable to save uploaded file to temp directory " +
tempDir + ".", e);
+ return FAILURE_OUTCOME;
+ }
- String version = "1.0";
- String architectureName = "no-arch";
- String resourceTypeName = resourceType.getName();
- String resourceTypePluginName = resourceType.getPlugin();
+ final String version = "1.0";
+ final String architectureName = "no-arch";
- String packageTypeName = null;
- Set<PackageType> packageTypes =
resourceType.getPackageTypes();
- for (PackageType packageType : packageTypes)
- {
- packageTypeName = packageType.getName();
- }
+ PackageDetailsKey key = new ContentSourcePackageDetailsKey(tempFile.getPath(),
version, this.packageType.getName(),
+ architectureName, this.resourceType.getName(),
this.resourceType.getPlugin());
+ ResourcePackageDetails detail = new ResourcePackageDetails(key);
+ detail.setDeploymentTimeConfiguration(this.configuration);
- if (packageTypeName == null)
- {
- facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
"content.resourceInstance.create.resourceTypeHasNoPackageTypes");
- }
- else
- {
- PackageDetailsKey key = new
ContentSourcePackageDetailsKey(tempFileName, version, packageTypeName, architectureName,
resourceTypeName, resourceTypePluginName);
- ResourcePackageDetails detail = new ResourcePackageDetails(key);
+ Configuration pluginConfiguration = null;
- Configuration pluginConfiguration = null;
+ JONTreeNode currentNode = navigationAction.getSelectedNode();
+ Resource ancestorResource = currentNode.getClosestResource();
- JONTreeNode currentNode = navigationAction.getSelectedNode();
- Resource ancestorResource = currentNode.getClosestResource();
-
- resourceManager.createResource(resourceName, resourceType,
ancestorResource, pluginConfiguration, detail);
+ final String resourceName = this.fileName;
+ CreateResourceResponse createResourceResponse =
this.resourceManager.createResource(resourceName,
+ this.resourceType, ancestorResource, pluginConfiguration, detail);
+ switch (createResourceResponse.getStatus())
+ {
+ case SUCCESS:
+ facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_INFO,
"content.resourceInstance.create.success",
+ this.fileName);
+ return SUCCESS_OUTCOME;
+ default:
+ String cause = (createResourceResponse.getErrorMessage() != null) ?
+ createResourceResponse.getErrorMessage() : "unknown";
+ facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
"content.resourceInstance.create.failure",
+ this.fileName, cause);
+ return FAILURE_OUTCOME;
+ }
+ }
- return "success";
- }
- }
- else
- {
- facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
"content.resourceInstance.create.unableToCreateTempFile");
- }
- }
- else
+ private File writeTempFile(File tempDir)
+ throws IOException
+ {
+ File tempFile = new File(tempDir, this.fileName);
+ log.debug("Writing temp file to " + tempFile + "...");
+ if (tempFile.exists())
+ tempFile.delete();
+ FileOutputStream fos = new FileOutputStream(tempFile);
+ fos.write(this.file);
+ fos.close();
+ return tempFile;
+ }
+
+ @Nullable
+ private static PackageType getCreationPackageType(ResourceType resourceType)
+ {
+ Set<PackageType> packageTypes = resourceType.getPackageTypes();
+ for (PackageType packageType : packageTypes)
+ {
+ if (packageType.isCreationData())
{
- facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
"content.resourceInstance.create.noFileSelected");
+ return packageType;
}
-
- } catch (IOException e) {
- facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR,
"content.resourceInstance.create.fileUploadFailure");
- LOG.warn("Unable to create file in temp directory",e);
}
- return "failure";
+ return null;
}
public String getFileName()
@@ -152,20 +223,23 @@
this.fileName = fileName;
}
- public byte[] getFile() {
+ public byte[] getFile()
+ {
return file;
}
- public void setFile(byte[] file) {
+ public void setFile(byte[] file)
+ {
this.file = file;
}
- public String getFileContentType() {
+ public String getFileContentType()
+ {
return fileContentType;
}
- public void setFileContentType(String fileContentType) {
+ public void setFileContentType(String fileContentType)
+ {
this.fileContentType = fileContentType;
}
-
}
Modified: trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
===================================================================
--- trunk/core/src/main/webapp/WEB-INF/classes/messages.properties 2008-10-22 21:08:53 UTC
(rev 18)
+++ trunk/core/src/main/webapp/WEB-INF/classes/messages.properties 2008-10-23 00:54:28 UTC
(rev 19)
@@ -68,7 +68,7 @@
resource.view.button.cancel=Cancel
resource.view.requiredFields=Required fields
-resource.add.pageTitle=Add New Resource
+resource.add.pageTitlePrefix=Add New
resource.add.button.continue=Continue
resource.add.button.save=Save
resource.add.button.cancel=Cancel
@@ -149,11 +149,12 @@
content.resourceInstance.version=Version
#Messages for resourceContentCreate.xhtml
-content.resourceInstance.create=Enter the filename to deploy
-content.resourceInstance.create.fileUploadFailure=Unable to upload file.
+content.resourceInstance.create=Enter the filename you wish to deploy:
content.resourceInstance.create.noFileSelected=Please enter a file to upload.
-content.resourceInstance.create.resourceTypeHasNoPackageTypes=Unable to deploy files of
this type. The file type is not defined in the plugin. Please contact the plugin creator
about this issue.
+content.resourceInstance.create.resourceTypeHasNoCreationPackageType=Unable to create
resources of this type. The resource type does not define a creation package type.
content.resourceInstance.create.unableToCreateTempFile=Unable to create temp file from
file upload.
+content.resourceInstance.create.success=Resource {0} created successfully!
+content.resourceInstance.create.failure=Failed to create Resource {0} - cause: {1}
exception.heading=Internal Error
exception.paragraph1=The application has encountered an error.
Modified: trunk/core/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/core/src/main/webapp/WEB-INF/pages.xml 2008-10-22 21:08:53 UTC (rev 18)
+++ trunk/core/src/main/webapp/WEB-INF/pages.xml 2008-10-23 00:54:28 UTC (rev 19)
@@ -69,6 +69,25 @@
</navigation>
</page>
+ <page view-id="/secure/resourceTypeSummary.xhtml">
+ <navigation from-action="#{resourceTypeContentAction.init()}">
+ <rule if-outcome="success">
+ <redirect
view-id="/secure/resourceContentCreate.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
+ <page view-id="/secure/resourceContentCreate.xhtml">
+ <navigation>
+ <rule if-outcome="success">
+ <redirect view-id="/secure/summary.xhtml"/>
+ </rule>
+ <rule if-outcome="failure">
+ <render view-id="/secure/resourceContentCreate.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
<page view-id="/secure/resourceView.xhtml">
<!--Do NOT try and put parenthesis in the add/edit/open map pages from action
because the
@@ -121,8 +140,7 @@
<!-- Run this method before rendering the page. -->
<action
execute="#{operationAction.initOperationsAndHistory()}"/>
-
- <!-- Do not put a parenthesis on the invokeOperation or it will rerun the
operation on refresh. -->
+
<navigation from-action="#{operationAction.invokeOperation()}">
<rule if-outcome="missingParams">
<render view-id="/secure/operationParameters.xhtml"/>
@@ -152,18 +170,6 @@
</navigation>
</page>
- <page view-id="/secure/resourceContentCreate.xhtml">
- <navigation>
- <rule if-outcome="success">
- <redirect view-id="/secure/summary.xhtml"/>
- </rule>
- <rule if-outcome="failure">
- <render view-id="/secure/resourceContentCreate.xhtml"/>
- </rule>
-
- </navigation>
- </page>
-
<page view-id="/secure/resourceInstanceMetrics.xhtml">
<param name="path"
value="#{navigationAction.currentPath}"/>
Modified: trunk/core/src/main/webapp/include/tabMenu.xhtml
===================================================================
--- trunk/core/src/main/webapp/include/tabMenu.xhtml 2008-10-22 21:08:53 UTC (rev 18)
+++ trunk/core/src/main/webapp/include/tabMenu.xhtml 2008-10-23 00:54:28 UTC (rev 19)
@@ -135,7 +135,6 @@
</h:panelGroup>
</h:panelGroup>
- <ui:remove>
<!-- ======================= CONTENT TAB ======================== -->
<h:panelGroup layout="block">
<!-- ACTIVE panel (currently being viewed) -->
@@ -160,7 +159,7 @@
</li>
</h:panelGroup>
</h:panelGroup>
- </ui:remove>
+
</ul>
<div class="statusindicator">
<h:panelGroup rendered="#{navigationAction.availableStatus ne
'SUMMARY'}">
Modified: trunk/core/src/main/webapp/secure/resourceContentCreate.xhtml
===================================================================
--- trunk/core/src/main/webapp/secure/resourceContentCreate.xhtml 2008-10-22 21:08:53 UTC
(rev 18)
+++ trunk/core/src/main/webapp/secure/resourceContentCreate.xhtml 2008-10-23 00:54:28 UTC
(rev 19)
@@ -30,7 +30,7 @@
<ui:composition template="/layout.xhtml">
<!-- page title -->
- <ui:define
name="pagetitle">#{messages['resource.add.pageTitle']}</ui:define>
+ <ui:define
name="pagetitle">#{messages['resource.add.pageTitlePrefix']}
#{param.selectedResourceTypeName}</ui:define>
<!-- body -->
<ui:define name="body">
<div class="notabmenubox">
@@ -41,22 +41,26 @@
<hr/>
<h:form enctype="multipart/form-data">
<h:panelGrid styleClass="formstyle">
+ <input type="hidden"
name="selectedResourceTypeName"
value="#{param.selectedResourceTypeName}"/>
<s:fileUpload id="file"
data="#{resourceTypeContentAction.file}"
fileName="#{resourceTypeContentAction.fileName}"
accept="application/zip,application/war,application/ear,application/jar"
-
contentType="#{resourceTypeContentAction.fileContentType}"/>
- <h:panelGroup>
+
contentType="#{resourceTypeContentAction.fileContentType}"
+ required="true"/>
+ <onc:config
configurationDefinition="#{configurationDefinition}"
+ configuration="#{configuration}"
+ nullConfigurationDefinitionMessage="null
ConfigurationDefinition!"
+ nullConfigurationMessage="null
Configuration!"/>
+ <h:panelGrid columns="2"
cellspacing="9">
<h:commandButton
value="#{messages['resource.add.button.continue']}"
action="#{resourceTypeContentAction.createContentBackedResource()}"
- styleClass="buttonmed">
- <f:param name="selectedResourceTypeName"
value="#{param.selectedResourceTypeName}"/>
- </h:commandButton>
+ styleClass="buttonmed"/>
<s:button
value="#{messages['resource.add.button.cancel']}"
view="/secure/summary.xhtml"
- styleClass="buttonmed">
- </s:button>
- </h:panelGroup>
+ propagation="end"
+ styleClass="buttonmed"/>
+ </h:panelGrid>
</h:panelGrid>
</h:form>
</div>
Modified: trunk/core/src/main/webapp/secure/resourceTypeSummary.xhtml
===================================================================
--- trunk/core/src/main/webapp/secure/resourceTypeSummary.xhtml 2008-10-22 21:08:53 UTC
(rev 18)
+++ trunk/core/src/main/webapp/secure/resourceTypeSummary.xhtml 2008-10-23 00:54:28 UTC
(rev 19)
@@ -57,22 +57,14 @@
value="#{messages['summary.resourceType.addNew']}"
styleClass="buttonmed">
<f:param name="selectedResourceTypeName"
value="#{resourceType.name}"/>
</s:button>
- <ui:remove>
- <!-- TODO: Uncomment this once content-backed Resource
creation is supported on the backend.
- (see
https://jira.jboss.org/jira/browse/JBMANCON-407) -->
- <s:button rendered="#{resourceType.creationDataType
eq 'CONTENT'}"
-
view="/secure/resourceContentCreate.xhtml"
-
value="#{messages['summary.resourceType.addNew']}"
styleClass="buttonmed">
- <f:param name="selectedResourceTypeName"
value="#{resourceType.name}"/>
- </s:button>
- </ui:remove>
+
+ <s:button rendered="#{resourceType.creationDataType eq
'CONTENT'}"
+ action="#{resourceTypeContentAction.init()}"
+
value="#{messages['summary.resourceType.addNew']}"
styleClass="buttonmed">
+ <f:param name="selectedResourceTypeName"
value="#{resourceType.name}"/>
+ </s:button>
</h:form>
- <ui:remove>
- <!-- TODO: Change below to
rendered="#{!resourceType.creatable} once content-backed Resource
- creation is supported on the backend.
- (see
https://jira.jboss.org/jira/browse/JBMANCON-407)
-->
- </ui:remove>
- <h:outputLabel rendered="#{!resourceType.creatable or
resourceType.creationDataType eq 'CONTENT'}"
+ <h:outputLabel rendered="#{!resourceType.creatable}"
value="#{messages['resourcetype.no.action']}"/>
</div>
<h:form>
Modified: trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java
===================================================================
--- trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java 2008-10-22
21:08:53 UTC (rev 18)
+++ trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java 2008-10-23
00:54:28 UTC (rev 19)
@@ -46,7 +46,7 @@
/**
* Seam version of BootstrapServlet
*/
-@Name("pluginContainerBootstrap")
+@Name("bootstrapAction")
@Scope(ScopeType.APPLICATION)
@Startup
@Install(precedence = (Install.MOCK))
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-10-22 21:08:53 UTC (rev 18)
+++ trunk/pom.xml 2008-10-23 00:54:28 UTC (rev 19)
@@ -65,7 +65,7 @@
<jaxb-api.version>2.1</jaxb-api.version>
<jaxb-impl.version>2.1.6</jaxb-impl.version>
<jon.version>2.2.0-SNAPSHOT</jon.version>
- <richfaces.version>3.2.0.GA</richfaces.version>
+ <richfaces.version>3.2.2.GA</richfaces.version>
<rhq.version>1.2.0-SNAPSHOT</rhq.version>
<seam.version>2.0.2.SP1</seam.version>
<seam.embedded.version>beta3.SP2</seam.embedded.version>