blob: 33acf0e17d4bcb8ade9e6999c10313c99b6a42f1 [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
-->
<!-- applications/applicationEdit.jsf -->
<!composition template="/templates/default.layout" guiTitle="$resource{i18n.enterpriseApplications.editPageTitle}" >
<!define name="content">
<event>
<!beforeCreate
setSessionAttribute(key="appGeneralTabs" value="general");
getRequestValue(key="appName" value="#{pageSession.appName}");
urlencode(value="#{pageSession.appName}" encoding="UTF-8" result="#{pageSession.encodedAppName}");
getRequestValue(key="listPageLink" value="#{pageSession.listPageLink}");
//test the app still exists.
gf.checkIfEndPointExist(endpoint="#{sessionScope.REST_URL}/applications/application/#{pageSession.encodedAppName}" exists="#{requestScope.exist}");
if (! #{requestScope.exist}){
gf.redirect(page="#{request.contextPath}/common/applications/applications.jsf");
}
gf.restRequest(endpoint="#{sessionScope.REST_URL}/applications/application/#{pageSession.appName}/property"
method="GET", result="#{requestScope.result}");
setPageSessionAttribute(key="propsMap" value="#{requestScope.result.data.extraProperties.properties}");
foreach( var="oneProp" list="#{pageSession.propsMap}"){
if( #{requestScope.oneProp.name}=isComposite){
setPageSessionAttribute(key="appType" value="ear");
setAttribute(key="found" value="true");
}
}
if(! #{requestScope.found}){
gf.restRequest(endpoint="#{sessionScope.REST_URL}/applications/application/#{pageSession.appName}/module" method="GET", result="#{requestScope.result}");
gf.getMapKeys(Map="#{requestScope.result.data.extraProperties.childResources}" Keys="#{requestScope.keys}");
gf.restRequest(endpoint="#{sessionScope.REST_URL}/applications/application/#{pageSession.appName}/module/#{requestScope.keys[0]}/engine" method="GET", result="#{requestScope.result}");
setAttribute(key="snifferMap" value="#{requestScope.result.data.extraProperties.childResources}");
gf.getApplicationType(snifferMap="#{requestScope.result.data.extraProperties.childResources}", appType="#{pageSession.appType}");
}
getAppEditIntegrationPoint(type="org.glassfish.admingui:editAppPage" appEditPageMap="#{requestScope.editMap}")
mapGet(Map="#{requestScope.editMap}" Key="#{pageSession.appType}" Value="#{requestScope.dPage}")
if (! #{requestScope.dPage}){
mapGet(Map="#{requestScope.editMap}" Key="other" Value="#{requestScope.dPage}")
}
gf.redirect(page="#{request.contextPath}/#{requestScope.dPage}?appName=#{pageSession.encodedAppName}&appType=#{pageSession.appType}")
/>
</event>
</define>
</composition>