Commit 156784c8 authored by michael.simon's avatar michael.simon
Browse files

Show scripts

parent 3bc804a0
/*******************************************************************************
* 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.enterprise.context.RequestScoped;
import javax.faces.event.ComponentSystemEvent;
import javax.inject.Inject;
import javax.inject.Named;
import edu.kit.scc.webreg.entity.ScriptEntity;
import edu.kit.scc.webreg.service.ScriptService;
@Named("showScriptBean")
@RequestScoped
public class ShowScriptBean 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 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;
}
}
......@@ -369,3 +369,4 @@ replace=Ersetzen
regex_replace=Regex ersetzen
add_script=Skript hinzuf\u00FCgen
script_engine=Skript Engine
script_type=Skript Typ
......@@ -371,3 +371,4 @@ regex_replace=Regex replace
list_scripts=Scripts
add_script=Add script
script_engine=Script engine
script_type=Script type
......@@ -47,6 +47,12 @@
</f:facet>
<h:outputText value="#{entity.scriptEngine}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.script_type}" />
</f:facet>
<h:outputText value="#{entity.scriptType}" />
</p:column>
</p:dataTable>
<h:link outcome="add-script.xhtml" value="#{messages.add_script}"/><br/>
......
<!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="#{showScriptBean.id}"/>
<f:event type="javax.faces.event.PreRenderViewEvent"
listener="#{showScriptBean.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.business_rule}: #{showScriptBean.entity.name}"/></h2>
<div id="panelInline">
<p:panel header="#{messages.business_rule}">
<p:panelGrid id="baseData" columns="2">
<h:outputText value="#{messages.id}:"/>
<h:outputText value="#{showScriptBean.entity.id}"/>
<h:outputText value="#{messages.name}:"/>
<h:outputText value="#{showScriptBean.entity.name}"/>
<h:outputText value="#{messages.script_engine}:"/>
<h:outputText value="#{showScriptBean.entity.scriptEngine}"/>
<h:outputText value="#{messages.script_type}:"/>
<h:outputText value="#{showScriptBean.entity.scriptType}"/>
<h:outputText value="#{messages.script}:"/>
<h:panelGroup>
<div style="font-family: 'Courier New', monospace; white-space: pre; font-size: 70%;">
<h:outputText value="#{showScriptBean.entity.script}"/>
</div>
</h:panelGroup>
</p:panelGrid>
<h:link outcome="edit-script.xhtml" value="#{messages.edit}">
<f:param name="scriptId" value="#{showScriptBean.entity.id}"/>
</h:link>
</p:panel>
</div>
</h:form>
</ui:define>
</ui:composition>
</f:view>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment