blob: 588e5ac67f874531a9c092807f084f15f7fcef4f [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
-->
<!-- full/externalResourceEdit.jsf -->
<!initPage
setResourceBundle(key="i18njmail" bundle="org.glassfish.full.admingui.Strings");
setResourceBundle(key="help_jmail" bundle="org.glassfish.full.admingui.Helplinks")
/>
<!composition template="/templates/default.layout" guiTitle="$resource{i18njmail.jndiResource.newPageTitle}" >
<!define name="content">
<event>
<!beforeCreate
getRequestValue(key="target" value="#{pageSession.targetValue}");
setPageSessionAttribute(key="selfPage" value="#{request.contextPath}/full/externalResourceNew.jsf");
setPageSessionAttribute(key="parentPage" value="#{request.contextPath}/full/externalResources.jsf");
setPageSessionAttribute(key="childType" value="external-jndi-resource");
setPageSessionAttribute(key="factoryClassHelpText" value="$resource{i18njmail.jndiResource.factoryClassHelp}");
setPageSessionAttribute(key="showJndiLookup" 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"});
setPageSessionAttribute(key="skipAttrsList", value={"Name"});
createMap(result="#{pageSession.valueMap2}")
mapPut(map="#{pageSession.valueMap}" key="enabled" value="true");
mapPut(map="#{pageSession.valueMap2}" key="enabled" value="true");
gf.restRequest(endpoint="#{sessionScope.REST_URL}/resources/get-built-in-custom-resources"
method="GET"
result="#{requestScope.result}");
setPageSessionAttribute(key="propsMap" value="#{requestScope.result.data.extraProperties.builtInCustomResources}");
if(#{resChosen}) {
setPageSessionAttribute(key="factoryClass", value="#{pageSession.propsMap['$attribute{resChosen}']");
mapPut(map="#{pageSession.valueMap}" key="name" value="#{Name}")
mapPut(map="#{pageSession.valueMap}" key="description" value="#{desc}")
mapPut(map="#{pageSession.valueMap2}" key="enabled" value="#{status}")
mapPut(map="#{pageSession.valueMap}" key="factoryClass" value="#{pageSession.factoryClass}")
mapPut(map="#{pageSession.valueMap}" key="resType" value="#{resChosen}")
mapPut(map="#{pageSession.valueMap}" key="jndiLookupName" value="#{jndiLookup}")
setPageSessionAttribute(key="tableList" value="#{newList}");
}
gf.getJndiResourceForCreate(resources="#{pageSession.propsMap}" result="#{requestScope.entriesList}", classnameOption=>$page{classnameOption}, attrMap="#{pageSession.attrMap}", factoryMap="#{pageSession.factoryMap}" );
addEmptyFirstElement(in="$attribute{entriesList}" out="#{pageSession.builtInEntries}")
setPageSessionAttribute(key="myOption" value="$pageSession{classnameOption}");
//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}" );
//for create, we want to set a default target. This is used by targetSectionForCreate.inc
setPageSessionAttribute(key="setDefaultTarget" value="#{true}" );
/>
</event>
" <script type="text/javascript">admingui.nav.selectTreeNodeById(admingui.nav.TREE_ID+":resources:jndi:externalResources");</script>
<sun:form id="form">
#include "/common/shared/alertMsg_1.inc"
<!-- Page Title -->
<sun:title id="propertyContentPage" title="$resource{i18njmail.jndiResource.newPageTitle}" helpText="$resource{i18njmail.jndiResource.newPageTitleHelp}">
#include "/full/jndiButtons.inc"
</sun:title>
"<br><br>
#include "/full/jndiResourceAttr.inc"
#include "/common/shared/propertyDescTable.inc"
<event>
<!afterCreate
setPageSessionAttribute(key="setDefaultTarget" value="true");
includeIntegrations(type="org.glassfish.admingui:TargetSectionForResource" );
/>
</event>
<sun:hidden id="helpKey" value="$resource{help_jmail.externalResourceNew}" />
</sun:form>
#include "/full/jndijs.inc"
"<br/>
#include "/common/shared/changeButtonsJS.inc"
</define>
</composition>