Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
7e23e34e
Commit
7e23e34e
authored
Apr 27, 2018
by
michael.simon
Browse files
Edit scripts
parent
156784c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
bwreg-webapp/src/main/java/edu/kit/scc/webreg/bean/admin/brule/EditScriptBean.java
0 → 100644
View file @
7e23e34e
/*******************************************************************************
* Copyright (c) 2014 Michael Simon.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Michael Simon - initial
******************************************************************************/
package
edu.kit.scc.webreg.bean.admin.brule
;
import
java.io.Serializable
;
import
javax.faces.bean.ManagedBean
;
import
javax.faces.bean.ViewScoped
;
import
javax.faces.event.ComponentSystemEvent
;
import
javax.inject.Inject
;
import
edu.kit.scc.webreg.entity.ScriptEntity
;
import
edu.kit.scc.webreg.service.ScriptService
;
import
edu.kit.scc.webreg.util.ViewIds
;
@ManagedBean
@ViewScoped
public
class
EditScriptBean
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Inject
private
ScriptService
service
;
private
ScriptEntity
entity
;
private
Long
id
;
public
void
preRenderView
(
ComponentSystemEvent
ev
)
{
entity
=
service
.
findById
(
id
);
}
public
String
save
()
{
service
.
save
(
entity
);
return
ViewIds
.
SHOW_SCRIPT
+
"?faces-redirect=true&scriptId="
+
entity
.
getId
();
}
public
String
cancel
()
{
return
ViewIds
.
LIST_SCRIPTS
+
"?faces-redirect=true"
;
}
public
ScriptEntity
getEntity
()
{
return
entity
;
}
public
void
setEntity
(
ScriptEntity
entity
)
{
this
.
entity
=
entity
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
}
bwreg-webapp/src/main/java/edu/kit/scc/webreg/util/ViewIds.java
View file @
7e23e34e
...
...
@@ -106,7 +106,12 @@ public class ViewIds {
public
static
final
String
ADD_RULE_PACKAGE
=
"/admin/business-rule/add-rule-package.xhtml"
;
public
static
final
String
EDIT_RULE_PACKAGE
=
"/admin/business-rule/edit-rule-package.xhtml"
;
public
static
final
String
SHOW_RULE_PACKAGE
=
"/admin/business-rule/show-rule-package.xhtml"
;
public
static
final
String
ADD_SCRIPT
=
"/admin/business-rule/add-script.xhtml"
;
public
static
final
String
EDIT_SCRIPT
=
"/admin/business-rule/edit-script.xhtml"
;
public
static
final
String
SHOW_SCRIPT
=
"/admin/business-rule/show-script.xhtml"
;
public
static
final
String
LIST_SCRIPTS
=
"/admin/business-rule/list-scripts.xhtml"
;
/*
* Timer and Schedule
*/
...
...
bwreg-webapp/src/main/resources/msg/messages_de.properties
View file @
7e23e34e
...
...
@@ -367,6 +367,7 @@ compare_child_registries=Child Registries abgleichen
regex
=
Regex
replace
=
Ersetzen
regex_replace
=
Regex ersetzen
script
=
Skript
add_script
=
Skript hinzuf
\u
00FCgen
script_engine
=
Skript Engine
script_type
=
Skript Typ
bwreg-webapp/src/main/resources/msg/messages_en.properties
View file @
7e23e34e
...
...
@@ -369,6 +369,7 @@ replace=Replace
regex_replace
=
Regex replace
list_scripts
=
Scripts
script
=
Script
add_script
=
Add script
script_engine
=
Script engine
script_type
=
Script type
bwreg-webapp/src/main/webapp/admin/business-rule/edit-script.xhtml
0 → 100644
View file @
7e23e34e
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:bw=
"http://www.scc.kit.edu/bwfacelets"
xmlns:p=
"http://primefaces.org/ui"
>
<head>
<title></title>
</head>
<body>
<f:view>
<f:metadata>
<f:viewParam
name=
"scriptId"
value=
"#{editScriptBean.id}"
/>
<f:event
type=
"javax.faces.event.PreRenderViewEvent"
listener=
"#{editScriptBean.preRenderView}"
/>
</f:metadata>
<ui:composition
template=
"/template/default-admin.xhtml"
>
<ui:param
name=
"title"
value=
"#{messages.title}"
/>
<ui:define
name=
"content"
>
<h:form
id=
"form"
>
<h2><h:outputText
value=
"#{messages.script}: #{editScriptBean.entity.name}"
/></h2>
<div
id=
"panelInline"
>
<p:panel
header=
"#{messages.script}"
>
<p:panelGrid
id=
"baseData"
columns=
"2"
>
<h:outputText
value=
"#{messages.id}:"
/>
<h:outputText
value=
"#{editScriptBean.entity.id}"
/>
<bw:inputText
id=
"nameField"
label=
"#{messages.name}"
value=
"#{editScriptBean.entity.name}"
required=
"true"
/>
<bw:inputText
id=
"scriptEngineField"
label=
"#{messages.script_engine}"
value=
"#{editScriptBean.entity.scriptEngine}"
required=
"true"
/>
<bw:inputText
id=
"scriptTypeField"
label=
"#{messages.script_type}"
value=
"#{editScriptBean.entity.scriptType}"
required=
"true"
/>
<h:outputText
value=
"#{messages.script}:"
/>
<p:inputTextarea
value=
"#{editScriptBean.entity.script}"
style=
"width: 600px; height: 300px;"
autoResize=
"false"
/>
</p:panelGrid>
<p:commandButton
id=
"save"
action=
"#{editScriptBean.save}"
value=
"#{messages.save}"
/>
<p:commandButton
id=
"cancel"
action=
"#{editScriptBean.cancel}"
value=
"#{messages.cancel}"
immediate=
"true"
/>
</p:panel>
</div>
</h:form>
</ui:define>
</ui:composition>
</f:view>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment