parent
c91163a981
commit
93124b223f
@ -0,0 +1,7 @@
|
|||||||
|
<dispatcherinfo>
|
||||||
|
|
||||||
|
<managedpackage name="de.database.nanoleaf"/>
|
||||||
|
|
||||||
|
|
||||||
|
</dispatcherinfo>
|
||||||
|
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
package de.database.nanoleaf;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import org.eclnt.editor.annotations.CCGenClass;
|
||||||
|
import org.eclnt.jsfserver.pagebean.PageBean;
|
||||||
|
|
||||||
|
import de.tvo.database.tables.NLCONNECT.Nlconnect;
|
||||||
|
import de.tvo.database.tables.NLCONNECT.NlconnectWorker;
|
||||||
|
import de.tvo.nanoleaf.enums.NanoTypeEnum;
|
||||||
|
|
||||||
|
import org.eclnt.jsfserver.base.faces.event.ActionEvent;
|
||||||
|
import org.eclnt.jsfserver.defaultscreens.Statusbar;
|
||||||
|
|
||||||
|
@CCGenClass (expressionBase="#{d.CreateConnectionBean}")
|
||||||
|
|
||||||
|
public class CreateConnectionBean
|
||||||
|
extends PageBean
|
||||||
|
implements Serializable
|
||||||
|
{
|
||||||
|
public void onSave(org.eclnt.jsfserver.base.faces.event.ActionEvent event) {
|
||||||
|
boolean saved = true;
|
||||||
|
try {
|
||||||
|
NlconnectWorker worker = new NlconnectWorker();
|
||||||
|
saved = worker.insertNlconnect(getNlconnect());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
saved = false;
|
||||||
|
Statusbar.outputWarning("Fehler beim speichern!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saved) {
|
||||||
|
m_nlconnect = new Nlconnect();
|
||||||
|
m_test = false;
|
||||||
|
Statusbar.outputMessage("Connection gespeichert.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean m_test = true;
|
||||||
|
public boolean getTest() { return m_test; }
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// inner classes
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Listener to the user of the page bean. */
|
||||||
|
public interface IListener extends Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// members
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private IListener m_listener;
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// constructors & initialization
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public CreateConnectionBean() {
|
||||||
|
if (getTest()) {
|
||||||
|
m_nlconnect = new Nlconnect();
|
||||||
|
|
||||||
|
m_nlconnect.setNchostname("Canvas-72FA.fritz.box");
|
||||||
|
m_nlconnect.setNcipadress("192.168.178.141");
|
||||||
|
m_nlconnect.setNcport(16021);
|
||||||
|
m_nlconnect.setNccountpanel(15);
|
||||||
|
m_nlconnect.setNctoken("LAG28BQWrXK2p79NbHMQsvcYYCN1TcD4");
|
||||||
|
m_nlconnect.setNctype(NanoTypeEnum.CANVAS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPageName() { return "/database/nanoleaf/createConnection.xml"; }
|
||||||
|
@Override
|
||||||
|
public String getRootExpressionUsedInPage() { return "#{d.CreateConnectionBean}"; }
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// public usage
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
private Nlconnect m_nlconnect = new Nlconnect();
|
||||||
|
public void setNlconnect(Nlconnect nlconnect) {
|
||||||
|
m_nlconnect = nlconnect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Nlconnect getNlconnect() { return m_nlconnect; }
|
||||||
|
|
||||||
|
/* Initialization of the bean. Add any parameter that is required within your scenario. */
|
||||||
|
public void prepare(IListener listener)
|
||||||
|
{
|
||||||
|
m_listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// private usage
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
/rebel.xml
|
||||||
@ -1,3 +1,10 @@
|
|||||||
|
count_panels=Anzahl Panels
|
||||||
|
hostname=Hostname
|
||||||
|
ipadress=IP Adresse
|
||||||
load=Laden
|
load=Laden
|
||||||
|
nanoleaf=Nano Leaf
|
||||||
|
nanoleaf_type=Nano Leaf Type
|
||||||
|
port=Port
|
||||||
reset=Zu\u00FCcksetzen
|
reset=Zu\u00FCcksetzen
|
||||||
save=Speichern
|
save=Speichern
|
||||||
|
token=Token
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<t:layoutdefinition xmlns:t="http://www.captaincasa.com/controllibrary/t" >
|
||||||
|
|
||||||
|
<t:beanprocessing id="g_1" beanbinding="#{d.CreateConnectionBean}" />
|
||||||
|
<t:rowtitlebar id="g_2" text="#{rr.literalsNanoleaf['nanoleaf']}" />
|
||||||
|
<t:rowheader id="g_3" />
|
||||||
|
<t:rowbodypane id="g_4" >
|
||||||
|
<t:rowdistance id="g_6" />
|
||||||
|
<t:row id="g_8" >
|
||||||
|
<t:coldistance id="g_10" />
|
||||||
|
<t:label id="g_12" align="center" text="#{rr.literalsNanoleaf['hostname']}" width="200" />
|
||||||
|
<t:coldistance id="g_5" />
|
||||||
|
<t:label id="g_14" align="center" text="#{rr.literalsNanoleaf['ipadress']}" width="200" />
|
||||||
|
<t:coldistance id="g_13" />
|
||||||
|
<t:label id="g_22" align="center" text="#{rr.literalsNanoleaf['port']}" width="100" />
|
||||||
|
</t:row>
|
||||||
|
<t:rowdistance id="g_7" />
|
||||||
|
<t:row id="g_16" >
|
||||||
|
<t:coldistance id="g_9" />
|
||||||
|
<t:field id="g_18" text="#{d.CreateConnectionBean.nlconnect.nchostname}" width="200" />
|
||||||
|
<t:coldistance id="g_11" />
|
||||||
|
<t:field id="g_20" text="#{d.CreateConnectionBean.nlconnect.ncipadress}" width="200" />
|
||||||
|
<t:coldistance id="g_15" />
|
||||||
|
<t:field id="g_24" text="#{d.CreateConnectionBean.nlconnect.ncport}" width="100" />
|
||||||
|
</t:row>
|
||||||
|
<t:rowdistance id="g_17" height="20" />
|
||||||
|
<t:row id="g_26" >
|
||||||
|
<t:coldistance id="g_19" />
|
||||||
|
<t:label id="g_28" align="center" text="#{rr.literalsNanoleaf['token']}" width="300" />
|
||||||
|
<t:coldistance id="g_21" />
|
||||||
|
<t:label id="g_30" align="center" text="#{rr.literalsNanoleaf['nanoleaf_type']}" width="150" />
|
||||||
|
<t:coldistance id="g_23" />
|
||||||
|
<t:label id="g_32" text="#{rr.literalsNanoleaf['count_panels']}" width="100" />
|
||||||
|
</t:row>
|
||||||
|
<t:rowdistance id="g_25" />
|
||||||
|
<t:row id="g_34" >
|
||||||
|
<t:coldistance id="g_27" />
|
||||||
|
<t:field id="g_36" text="#{d.CreateConnectionBean.nlconnect.nctoken}" width="300" />
|
||||||
|
<t:coldistance id="g_29" />
|
||||||
|
<t:combobox id="g_38" value="#{d.CreateConnectionBean.nlconnect.nctype}" width="150" >
|
||||||
|
<t:comboboxitem id="g_33" text="CANVAS" value="CANVAS" />
|
||||||
|
<t:comboboxitem id="g_42" text="SHAPES" value="SHAPES" />
|
||||||
|
</t:combobox>
|
||||||
|
<t:coldistance id="g_31" />
|
||||||
|
<t:spinner id="g_40" maxvalue="100" minvalue="4" value="#{d.CreateConnectionBean.nlconnect.nccountpanel}" width="100" />
|
||||||
|
</t:row>
|
||||||
|
<t:rowdistance id="g_35" height="40" />
|
||||||
|
<t:row id="g_44" >
|
||||||
|
<t:coldistance id="g_37" />
|
||||||
|
<t:button id="g_46" actionListener="#{d.CreateConnectionBean.onSave}" text="#{rr.literalsNanoleaf['save']}" />
|
||||||
|
</t:row>
|
||||||
|
</t:rowbodypane>
|
||||||
|
|
||||||
|
</t:layoutdefinition>
|
||||||
@ -1,4 +1,6 @@
|
|||||||
<system>
|
<system>
|
||||||
<httpheaderattributesforpages/>
|
<httpheaderattributesforpages/>
|
||||||
<sessionmanagement type="COOKIE"/>
|
<sessionmanagement type="COOKIE"/>
|
||||||
|
|
||||||
|
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
Loading…
Reference in new issue