/
loggerLevels.jsf
140 lines (120 loc) · 6.51 KB
/
loggerLevels.jsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!--
Copyright (c) 2009, 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
-->
<!-- common/configuration/loggerLevels.jsf -->
<!initPage
setResourceBundle(key="i18nc" bundle="org.glassfish.common.admingui.Strings")
setResourceBundle(key="help_common" bundle="org.glassfish.common.admingui.Helplinks");
/>
<!composition template="/templates/default.layout" guiTitle="$resource{i18nc.log.LogLevelsPageTitle}" >
<!define name="content">
<event>
<!beforeCreate
setSessionAttribute(key="loggingTabs" value="loggerLevels");
setSessionAttribute(key="loggingTabs" value="loggerLevels");
getRequestValue(key="configName" value=>$page{configName} default="server-config");
createMap(result="#{requestScope.attrsMap}");
mapPut(map="#{requestScope.attrsMap}" key="target" value="#{pageSession.configName}");
gf.restRequest(
endpoint="#{sessionScope.REST_URL}/list-log-levels.json"
attrs="#{requestScope.attrsMap}"
method="GET"
result="#{requestScope.loggerLevels}");
getLoggerLevels(
loggerLevels="#{requestScope.loggerLevels.data.extraProperties.logLevels}"
loggerList="#{requestScope.tableList}");
setPageSessionAttribute(key="levelList" value={"ALL" "FINEST" "FINER" "FINE" "CONFIG" "INFO" "WARNING" "SEVERE" "ALERT" "EMERGENCY" "OFF"});
setPageSessionAttribute(key="defaultNewLevel" value="OFF");
gf.isConfigName(configName="#{pageSession.configName}" );
/>
</event>
<sun:form id="form1">
#include "/common/configuration/loggingTabs.inc"
#include "/common/shared/alertMsg.inc"
<sun:title id="title" title="$resource{i18nc.log.LogLevelsPageTitle}" helpText="$resource{i18nc.log.LogLevelsPageTitleHelp}">
#include "/common/configuration/loggerLevelsButtons.jsf"
</sun:title>
#include "/common/shared/configNameSection.inc"
<!-- Table .... -->
<sun:table id="basicTable" style="padding: 10pt" title="$resource{i18nc.log.LoggerLevelTableTitle}"
deselectMultipleButton="$boolean{true}"
deselectMultipleButtonOnClick="setTimeout('changeTwoTableButtons()', 0)"
selectMultipleButton="$boolean{true}"
selectMultipleButtonOnClick="setTimeout('changeTwoTableButtons()', 0)" >
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{tableId});
/>
<!-- Actions (Top) -->
<!facet actionsTop>
<sun:panelGroup id="topActionsGroup1">
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{topActionGroup});
/>
<sun:button id="addSharedTableButton" disabled="#{false}" text="$resource{i18nc.log.addLogger}" >
<!command
getUIComponent(clientId="$pageSession{tableRowGroupId}", component=>$attribute{tableRowGroup});
addRowToTable(TableRowGroup="$attribute{tableRowGroup}", NameList={"loggerName", "level"}, DefaultValueList={"","$pageSession{defaultNewLevel}"});
/>
</sun:button>
<sun:button id="button1" text="$resource{i18nc.log.deleteLogger}" disabled="#{true}" primary="#{true}">
<!command
getUIComponent(clientId="$pageSession{tableRowGroupId}", component=>$attribute{trg});
getSelectedTableRowKeys(tableRowGroup="${trg}" rowKeys=>$attribute{rowKeys});
deleteTableRows(tableRowGroup="${trg}" rowKeys="${rowKeys}");
commitTableRowGroup(tableRowGroup="${trg}");
/>
</sun:button>
<sun:dropDown id="change" selected="#{changeValue}" label="$resource{i18nc.log.levelLabel}" submitForm="#{false}" immediate="#{false}" labels="$pageSession{newLevelList}">
<!beforeCreate
addEmptyFirstElement(in="#{pageSession.levelList}" out="#{pageSession.newLevelList}")
/>
</sun:dropDown>
<sun:button id="button2" text="$resource{i18n.button.changeLevel}" disabled="#{true}" primary="#{true}" >
<!command
getUIComponent(clientId="$pageSession{tableRowGroupId}", component=>$attribute{tableRowGroup});
getAllSingleMapRows(TableRowGroup="${tableRowGroup}" Rows=>$attribute{allRows});
changeLoggerLevels( newLogLevel="#{changeValue}" allRows="${allRows}" newList="#{requestScope.tmpList}");
setAttribute(key="tableList" value="#{requestScope.tmpList}")
/>
</sun:button>
</sun:panelGroup>
</facet>
<sun:tableRowGroup id="rowGroup1" selected="#{td.value.selected}" data={"$attribute{tableList}"} sourceVar="td">
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{tableRowGroupId});
/>
<sun:tableColumn headerText="$resource{i18n.common.SelectHeader}" selectId="select" rowHeader="$boolean{false}" id="col1">
<sun:checkbox id="select"
selected="#{td.value.selected}"
selectedValue="$boolean{true}"
onClick="setTimeout('changeTwoTableButtons()', 0);"
/>
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18nc.log.LoggerNameCol}" sort="loggerName" rowHeader="$boolean{false}" id="col2">
<sun:textField columns="$int{50}" id="col1St" value="#{td.value.loggerName}" />
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18nc.log.LoggerLeveCol}" sort="level" rowHeader="$boolean{false}" id="col3">
//<sun:textField columns="$int{30}" id="col1St" value="#{td.value.level}" />
<sun:dropDown id="level" selected="#{td.value.level}" labels="$pageSession{levelList}" />
</sun:tableColumn>
"<br/>
</sun:tableRowGroup>
</sun:table>
<sun:title id="title2" >
#include "/common/configuration/loggerLevelsButtons.jsf"
</sun:title>
<sun:hidden id="helpKey" value="$resource{help_common.loggerLevels}" />
</sun:form>
"<br/>
#include "/common/shared/changeButtonsJS.inc"
</define>
</composition>