blob: cb2a470f25ad6bff3a2b91874cb04d8adb7127b1 [file] [log] [blame]
<!--
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!-- jca/jcaResourceNew.jsf -->
<!initPage
setResourceBundle(key="i18njca" bundle="org.glassfish.jca.admingui.Strings");
setResourceBundle(key="help_jca" bundle="org.glassfish.jca.admingui.Helplinks")
/>
<!composition template="/templates/default.layout" guiTitle="$resource{i18njca.adminObject.NewPageTitle}" >
<!define name="content">
<event>
<!beforeCreate
getRequestValue(key="target" value="#{pageSession.targetValue}");
setPageSessionAttribute(key="selfPage" value="#{request.contextPath}/jca/adminObjectNew.jsf");
setPageSessionAttribute(key="parentPage" value="#{request.contextPath}/jca/adminObjectResources.jsf");
setPageSessionAttribute(key="childType" value="admin-object-resource");
createMap(result="#{pageSession.valueMap2}")
if(#{reload}){
createMap(result="#{pageSession.tmpMap}")
mapPut(map="#{pageSession.tmpMap}" key="name" value="$attribute{nameChosen}");
mapPut(map="#{pageSession.tmpMap}" key="resAdapter" value="$attribute{resAdapter}");
mapPut(map="#{pageSession.tmpMap}" key="resType" value="$attribute{resType}");
mapPut(map="#{pageSession.tmpMap}" key="className" value="#{className}");
mapPut(map="#{pageSession.tmpMap}" key="description" value="$attribute{desc}");
if("#{status[0]}") {
mapPut(map="#{pageSession.valueMap2}" key="enabled" value="#{status[0]}");
}
}
if(!#{reload}) {
mapPut(map="#{pageSession.valueMap2}" key="enabled" value="true");
}
setPageSessionAttribute(key="parentUrl", value="#{sessionScope.REST_URL}/resources");
gf.getDefaultValues(endpoint="#{pageSession.parentUrl}/#{pageSession.childType}", valueMap="#{pageSession.valueMap}");
setPageSessionAttribute(key="convertToFalseList" value={"enabled"});
//set the following for including buttons.inc
setPageSessionAttribute(key="edit" value="#{false}" );
setPageSessionAttribute(key="showDefaultButton" value="#{true}" );
setPageSessionAttribute(key="showCancelButton" value="#{true}" );
setPageSessionAttribute(key="hasPropertySheet" value="#{true}" );
setPageSessionAttribute(key="hasPropertyTable" value="#{true}" );
setPageSessionAttribute(key="reload" value="#{false}" );
gf.getAdminObjectResourceWizard(
reload="#{reload}"
attrMap="#{pageSession.tmpMap}"
currentMap="#{pageSession.valueMap}"
valueMap=>$pageSession{valueMap});
mapPut(map="#{pageSession.valueMap}" key="enabled" value="true");
//To get the resource types
if ("#{pageSession.valueMap.resAdapter}"){
createMap(result="#{pageSession.attrsMap}");
mapPut(map="#{pageSession.attrsMap}" key="rarName" value="#{pageSession.valueMap.resAdapter}");
gf.restRequest(endpoint="#{sessionScope.REST_URL}/resources/get-admin-object-interface-names"
attrs="#{pageSession.attrsMap}"
method="GET"
result="#{requestScope.result}");
setAttribute(key="resourceTypes" value="#{requestScope.result.data.extraProperties.adminObjectInterfaceNames}");
setAttribute(key="zero" value="$int{0}");
setAttribute(key="size" value="#{requestScope.resourceTypes.size()}");
if ("!#{requestScope.resourceTypes}"){
setAttribute(key="size" value="$int{0}");
}
if (#{requestScope.size} > #{requestScope.zero}) {
if("!(#{pageSession.valueMap['resType']})") {
mapPut(map="#{pageSession.valueMap}" key="resType" value="#{requestScope.resourceTypes[0]}");
}
mapPut(map="#{pageSession.attrsMap}" key="adminObjectInterface" value="#{pageSession.valueMap.resType}");
//To get the get-admin-object-class-names
gf.restRequest(endpoint="#{sessionScope.REST_URL}/resources/get-admin-object-class-names"
attrs="#{pageSession.attrsMap}"
method="GET"
result="#{requestScope.result}");
setAttribute(key="classNames" value="#{requestScope.result.data.extraProperties.adminObjectClassNames}");
setAttribute(key="size" value="#{requestScope.resourceTypes.size()}");
if (#{requestScope.size} > #{requestScope.zero}) {
if(!#{pageSession.valueMap['className']}) {
mapPut(map="#{pageSession.valueMap}" key="className" value="#{requestScope.classNames[0]}");
}
}
//To get the admin-object-config-props
gf.restRequest(endpoint="#{sessionScope.REST_URL}/resources/get-admin-object-config-properties"
attrs="#{pageSession.attrsMap}"
method="GET"
result="#{requestScope.result}");
gf.getConfigPropsInfo(extraProps="#{requestScope.result.data.extraProperties}", key="adminObjectConfigProps", result="#{pageSession.tableList}" hasConfidentialProps="#{pageSession.hasConfidential}");
}
}
/>
</event>
" <script type="text/javascript">admingui.nav.selectTreeNodeById(admingui.nav.TREE_ID+":resources:Connectors:adminObjectResources");</script>
<sun:form id="form">
#include "/common/shared/alertMsg_1.inc"
<!-- Page Title #include "/jca/buttons.inc" -->
<sun:title id="propertyContentPage" title="$resource{i18njca.adminObject.NewPageTitle}" helpText="$resource{i18njca.adminObject.NewPageTitleHelp}">
#include "/common/resourceNode/resourceEditPageButtons.inc"
</sun:title>
"<br><br>
#include "/jca/adminObjectAttr.inc"
#include "/common/resourceNode/confidentialPropsTable.inc"
<event>
<!afterCreate
setPageSessionAttribute(key="setDefaultTarget" value="true");
includeIntegrations(type="org.glassfish.admingui:TargetSectionForResource" );
/>
</event>
<sun:hidden id="helpKey" value="$resource{help_jca.adminObjectNew1}" />
</sun:form>
"<br/>
#include "/common/shared/changeButtonsJS.inc"
</define>
</composition>