Index: admingui/common/src/main/java/org/glassfish/admingui/common/handlers/UtilHandlers.java =================================================================== --- admingui/common/src/main/java/org/glassfish/admingui/common/handlers/UtilHandlers.java (revision 44679) +++ admingui/common/src/main/java/org/glassfish/admingui/common/handlers/UtilHandlers.java (working copy) @@ -83,6 +83,7 @@ import java.util.logging.Level; import javax.faces.component.UIViewRoot; +import org.glassfish.internal.embedded.ScatteredArchive.Builder.type; /** @@ -992,7 +993,40 @@ int depth = ((Integer) handlerCtx.getInputValue("depth")); handlerCtx.setOutputValue("json", JSONUtil.javaToJSON(obj, depth)); } + + @Handler(id="gf.createPropertyString", + input={ + @HandlerInput(name="properties", type=List.class, required=true) + }, + output={ + @HandlerOutput(name="string", type=String.class) + } + ) + public static void createPropertyString(HandlerContext handlerCtx) { + StringBuilder sb = new StringBuilder(); + String sep = ""; + List> properties = (List>)handlerCtx.getInputValue("properties"); + for (Map property : properties) { + sb.append(sep) + .append(property.get("name")) + .append("=") + .append(escapePropertyValue(property.get("value"))) + ; + sep = ":"; + } + + handlerCtx.setOutputValue("string", sb.toString()); + } + + public static String escapePropertyValue(String value) { +// String[] chars = {"&","<",">","(",")","{","}",":","/","\\","\'","\""}; + String[] chars = {":"}; + for (String c : chars) { + value = value.replaceAll(c, "\\\\"+c); + } + + return value; + } - private static final String PATH_SEPARATOR = "${path.separator}"; } Index: admingui/common/src/main/resources/shared/propertyDescTable.inc =================================================================== --- admingui/common/src/main/resources/shared/propertyDescTable.inc (revision 44679) +++ admingui/common/src/main/resources/shared/propertyDescTable.inc (working copy) @@ -114,9 +114,9 @@ - + "
- \ No newline at end of file + Index: admingui/devtests/src/test/java/org/glassfish/admingui/devtests/ResourceAdapterConfigsTest.java =================================================================== --- admingui/devtests/src/test/java/org/glassfish/admingui/devtests/ResourceAdapterConfigsTest.java (revision 44679) +++ admingui/devtests/src/test/java/org/glassfish/admingui/devtests/ResourceAdapterConfigsTest.java (working copy) @@ -41,7 +41,10 @@ package org.glassfish.admingui.devtests; import org.junit.Test; +import org.omg.CORBA.SetOverrideType; +import static org.junit.Assert.*; + public class ResourceAdapterConfigsTest extends BaseSeleniumTestClass { private static final String TRIGGER_RESOURCE_ADAPTER_CONFIGS = "i18njca.resourceAdapterConfig.pageTitleHelp"; private static final String TRIGGER_NEW_RESOURCE_ADAPTER = "i18njca.resourceAdapterConfig.newPageTitleHelp"; @@ -49,10 +52,6 @@ @Test public void testResourceAdapterConfigs() throws Exception { - // There are *serious* performance issues in the backend when setting the properties for the RA causing this - // page to be *REALLY* slow, which, in turn, causes the test to time out. I'm going to make the executive - // decision to disable the test for now, until those issues can be worked out. -- jdl 18-Jan-2011 - /* clickAndWait("treeForm:tree:resources:resourceAdapterConfigs:resourceAdapterConfigs_link", TRIGGER_RESOURCE_ADAPTER_CONFIGS); if (tableContainsRow("propertyForm:poolTable", "col1", "jmsra")) { @@ -60,17 +59,17 @@ } + // Create new RA config clickAndWait("propertyForm:poolTable:topActionsGroup1:newButton", TRIGGER_NEW_RESOURCE_ADAPTER); selectDropdownOption("propertyForm:propertySheet:propertSectionTextField:threadPoolsIdProp:threadpoolsid", "thread-pool-1"); - clickAndWait("propertyForm:propertyContentPage:topButtons:newButton", TRIGGER_RESOURCE_ADAPTER_CONFIGS); + clickAndWait("propertyForm:propertyContentPage:topButtons:newButton", TRIGGER_RESOURCE_ADAPTER_CONFIGS, TIMEOUT*10); + // Verify config was saved and update values assertTrue(isTextPresent("jmsra")); clickAndWait(getLinkIdByLinkText("propertyForm:poolTable", "jmsra"), TRIGGER_EDIT_RESOURCE_ADAPTER_CONFIG); - - clickAndWait("propertyForm:propertyContentPage:topButtons:saveButton", TRIGGER_NEW_VALUES_SAVED); clickAndWait("propertyForm:propertyContentPage:topButtons:cancelButton", TRIGGER_RESOURCE_ADAPTER_CONFIGS); - + + // Remove config deleteRow("propertyForm:poolTable:topActionsGroup1:button1", "propertyForm:poolTable", "jmsra"); - */ } } Index: admingui/devtests/src/test/java/org/glassfish/admingui/devtests/SecurityTest.java =================================================================== --- admingui/devtests/src/test/java/org/glassfish/admingui/devtests/SecurityTest.java (revision 44679) +++ admingui/devtests/src/test/java/org/glassfish/admingui/devtests/SecurityTest.java (working copy) @@ -173,6 +173,9 @@ final String providerName = "testJaccProvider" + generateRandomString(); final String policyConfig = "com.example.Foo"; final String policyProvider = "com.example.Foo"; + final String propName = "propName"; + final String propValue = "propValue"; + final String propDescription = generateRandomString(); createConfig("new-config"); for (String configName : list) { @@ -184,9 +187,9 @@ setFieldValue("propertyForm:propertySheet:propertSectionTextField:policyProviderProp:PolicyProvider", policyProvider); int count = addTableRow("propertyForm:basicTable", "propertyForm:basicTable:topActionsGroup1:addSharedTableButton"); - setFieldValue("propertyForm:basicTable:rowGroup1:0:col2:col1St", "property"); - setFieldValue("propertyForm:basicTable:rowGroup1:0:col3:col1St", "value"); - setFieldValue("propertyForm:basicTable:rowGroup1:0:col4:col1St", "description"); + setFieldValue("propertyForm:basicTable:rowGroup1:0:col2:col1St", propName); + setFieldValue("propertyForm:basicTable:rowGroup1:0:col3:col1St", propValue); + setFieldValue("propertyForm:basicTable:rowGroup1:0:col4:col1St", propDescription); clickAndWait("propertyForm:propertyContentPage:topButtons:newButton", TRIGGER_JACC_PROVIDERS); assertTrue(tableContainsRow("propertyForm:configs", "col1", providerName)); @@ -194,6 +197,9 @@ clickAndWait(getLinkIdByLinkText("propertyForm:configs", providerName), TRIGGER_EDIT_JACC_PROVIDER); assertEquals(policyConfig, getFieldValue("propertyForm:propertySheet:propertSectionTextField:policyConfigProp:PolicyConfig")); assertEquals(policyProvider, getFieldValue("propertyForm:propertySheet:propertSectionTextField:policyProviderProp:PolicyProvider")); + assertEquals(propName, getFieldValue("propertyForm:basicTable:rowGroup1:0:col2:col1St")); + assertEquals(propValue, getFieldValue("propertyForm:basicTable:rowGroup1:0:col3:col1St")); + assertEquals(propDescription, getFieldValue("propertyForm:basicTable:rowGroup1:0:col4:col1St")); assertTableRowCount("propertyForm:basicTable", count); clickAndWait("propertyForm:propertyContentPage:topButtons:cancelButton", TRIGGER_JACC_PROVIDERS); Index: admingui/jca/src/main/resources/resourceAdapterConfigEdit.jsf =================================================================== --- admingui/jca/src/main/resources/resourceAdapterConfigEdit.jsf (revision 44679) +++ admingui/jca/src/main/resources/resourceAdapterConfigEdit.jsf (working copy) @@ -68,6 +68,7 @@ setPageSessionAttribute(key="hasPropertySheet" value="#{true}" ); setPageSessionAttribute(key="hasPropertyTable" value="#{true}" ); setPageSessionAttribute(key="skipAttrsList", value={"resourceAdapterName"}); + setPageSessionAttribute(key="showDescCol" value="false" ); /> Index: admingui/jca/src/main/resources/resourceAdapterConfigButtons.inc =================================================================== --- admingui/jca/src/main/resources/resourceAdapterConfigButtons.inc (revision 44679) +++ admingui/jca/src/main/resources/resourceAdapterConfigButtons.inc (working copy) @@ -73,21 +73,25 @@ if ("#{pageSession.myOption}=text") { setValueExpression(expression="#{pageSession.valueMap['name']}", value="#{pageSession.nameText}"); } + removeEmptyProps(props="#{pageSession.tableList}" modifiedProps="#{pageSession.tableList}"); + gf.createPropertyString(properties="#{pageSession.tableList}", string="#{requestScope.props}"); + mapPut(map="#{pageSession.valueMap}", key="property", value="#{requestScope.props}"); + gf.createEntity(endpoint="#{pageSession.parentUrl}/#{pageSession.childType}" attrs="#{pageSession.valueMap}" skipAttrs="#{pageSession.skipAttrsList}" convertToFalse="#{pageSession.convertToFalseList}" result => $attribute{objStr}); - removeEmptyProps(props="#{pageSession.tableList}" modifiedProps="#{pageSession.tableList}"); + + /* javaToJSON(obj="#{pageSession.tableList}" json="#{requestScope.tmpJSON}"); - //println("payload -------------------------------> #{requestScope.tmpJSON}"); urlencode(value="#{pageSession.valueMap['name']}" encoding="UTF-8" result="#{pageSession.encodeName}"); gf.restRequest(endpoint="#{pageSession.parentUrl}/#{pageSession.childType}/#{pageSession.encodeName}/property.json" method="POST" data="#{requestScope.tmpJSON}" result="#{requestScope.restResponse}"); - + */ if (#{pageSession.showSuccessfulMsg}){ prepareSuccessfulMsg(); gf.redirect(page="#{pageSession.selfPage}&alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}"); @@ -103,4 +107,4 @@ /> - \ No newline at end of file + Index: admingui/jca/src/main/resources/resourceAdapterConfigNew.jsf =================================================================== --- admingui/jca/src/main/resources/resourceAdapterConfigNew.jsf (revision 44679) +++ admingui/jca/src/main/resources/resourceAdapterConfigNew.jsf (working copy) @@ -62,6 +62,7 @@ setPageSessionAttribute(key="showCancelButton" value="#{true}" ); setPageSessionAttribute(key="hasPropertySheet" value="#{true}" ); setPageSessionAttribute(key="hasPropertyTable" value="#{true}" ); + setPageSessionAttribute(key="showDescCol" value="false" ); getRequestValue(key="name" value="#{pageSession.Name}"); getRequestValue(key="nameText" value="#{pageSession.nameText}");