Commit 9120ba10 authored by Claes Sjofors's avatar Claes Sjofors

Web and App configuration changed, OpPlaceWeb and OpPlaceApp added

parent e573ba36
......@@ -1478,8 +1478,8 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
break;
}
case OPWIN: {
// Find AppGraph object under WebHandler, search on two hierarchy levels
CdhrObjid oret = gdh.getClassList( Pwrb.cClass_WebHandler);
// Find AppGraph object under OpPlaceApp, search on two hierarchy levels
CdhrObjid oret = gdh.getClassList( Pwrb.cClass_OpPlaceApp);
if (oret.oddSts()) {
CdhrString sret = gdh.objidToName(oret.objid, Cdh.mName_volumeStrict);
......@@ -2644,13 +2644,13 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
void loadUrlSymbols() {
// Get language from webhandler object
CdhrObjid webHandler = gdh.getClassList( Pwrb.cClass_WebHandler);
if ( webHandler.evenSts()) return;
CdhrObjid opPlace = gdh.getClassList( Pwrb.cClass_OpPlaceApp);
if ( opPlace.evenSts()) return;
CdhrString webHandlerName = gdh.objidToName( webHandler.objid, Cdh.mName_volumeStrict);
if ( webHandlerName.evenSts()) return;
CdhrString opPlaceName = gdh.objidToName( opPlace.objid, Cdh.mName_volumeStrict);
if ( opPlaceName.evenSts()) return;
String attr = webHandlerName.str + ".Language";
String attr = opPlaceName.str + ".Language";
CdhrInt iAttrValue = gdh.getObjectInfoInt( attr);
if ( iAttrValue.evenSts()) return;
......
......@@ -61,18 +61,18 @@ public class JopOpWindow extends JPanel {
OpWindButton eventLogButton;
OpWindButton helpButton;
public JopOpWindow( JopSession session, Object root) {
public JopOpWindow( JopSession session, Object root, String pwrPlace) {
// super( BoxLayout.Y_AXIS);
// createGlue();
this.session = session;
this.root = root;
en = session.getEngine();
// Get WebHandler object
CdhrObjid oretWebH = en.gdh.getClassList( Pwrb.cClass_WebHandler);
if ( oretWebH.evenSts()) return;
// Get OpPlaceWeb object
CdhrObjid oretOpWeb = en.gdh.nameToObjid( pwrPlace);
if ( oretOpWeb.evenSts()) return;
CdhrString sret = en.gdh.objidToName( oretWebH.objid, Cdh.mName_volumeStrict);
CdhrString sret = en.gdh.objidToName( oretOpWeb.objid, Cdh.mName_volumeStrict);
if ( sret.evenSts()) return;
// Set language
......@@ -193,7 +193,7 @@ public class JopOpWindow extends JPanel {
CdhrString sretURL = null;
CdhrInt iretTarget = null;
CdhrObjid oret = en.gdh.getChild( oretWebH.objid);
CdhrObjid oret = en.gdh.getChild( oretOpWeb.objid);
while ( oret.oddSts()) {
CdhrClassId retCid = en.gdh.getObjectClass( oret.objid);
if ( retCid.evenSts()) return;
......@@ -219,7 +219,7 @@ public class JopOpWindow extends JPanel {
this.add( new JSeparator());
oret = en.gdh.getChild( oretWebH.objid);
oret = en.gdh.getChild( oretOpWeb.objid);
while ( oret.oddSts()) {
CdhrClassId retCid = en.gdh.getObjectClass( oret.objid);
if ( retCid.evenSts()) return;
......
......@@ -94,8 +94,9 @@ public class JopOpWindowApplet extends JopApplet
{
super.init();
setSize(new Dimension(370, 570));
String pwrPlace = this.getParameter("pwrplace");
localPanel = new JopOpWindow( session, (Object)this);
localPanel = new JopOpWindow( session, (Object)this, pwrPlace);
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
scrollPane = new JScrollPane(localPanel);
......
......@@ -336,6 +336,8 @@ public class Pwrb {
public static final int cClass_waith = 133072;
public static final int cClass_WebBrowserConfig = 133488;
public static final int cClass_WebHandler = 133440;
public static final int cClass_OpPlaceWeb = 136528;
public static final int cClass_OpPlaceApp = 136536;
public static final int cClass_WebGraph = 133472;
public static final int cClass_WebLink = 133480;
public static final int cClass_xor = 133136;
......
......@@ -4764,11 +4764,11 @@ If there is a WebHandler object, the server processes for the web interface is s
<h2>Configuration of operator menu
The configuration of the operator menu is made in the node hierarchy with attributes in
the WebHandler object, and with WebGraph and WebLink object beneath this object.
the OpPlaceWeb object, and with WebGraph and WebLink object beneath this object.
<b>WebHandler
<b>OpPlaceWeb
In the WebHandler object, menu buttons for the standard function are configured.
In the OpPlaceWeb object, menu buttons for the standard function are configured.
<b>EnableLanguage
Displays a button for language selection in the menu. The language selection has to be
......@@ -4790,7 +4790,7 @@ Displays a button in the menu to open the navigator.
<b>WebGraph
WebGraph object configures buttons in the menu to open process graphics. WebGraph objects
are positioned under the WebHandler object.
are positioned under the OpPlaceWeb object.
A WebGraph object opens a Ge graph as a Java Frame, i.e. in a separate window. In the Ge
editor, you have to specify that the graph should be exported as a java frame by setting
......@@ -4825,7 +4825,7 @@ is not affected by a possible login.
The home page for a project consists of a menu and a right frame. As default, the xtt help
text for the project is viewed in the right frame. This is converted to html when the node
is built. If another start page is desired, an URL can be stated in the StartURL attribute
of the WebHandler object. If you, for example, want to show a Ge graph, you export the
of the OpPlaceWeb object. If you, for example, want to show a Ge graph, you export the
graph as a java applet, and insert the html-file for the graph into the StartURL attribute.
<h2>LoadArchives
......@@ -4833,7 +4833,7 @@ If Ge graphs from other projects are to be displayed, the java archives for thes
have to be available for the web browser. The java classes that are generated when the graphs
are exported in the Ge editor, are placed in an archive with the name pwrp_'systemname'_web.jar.
The archive of the present project is always loaded, but if other archives also are to be
loaded, they should be stated in the LoadArchive attribute of the WebHandler object. The
loaded, they should be stated in the LoadArchive attribute of the OpPlaceWeb object. The
archives also have to be copied to $pwrp_web.
<h2>Privileges
......@@ -4844,7 +4844,7 @@ user only has access to the login dialog. Normally you set RtRead, which gives n
in users access to look, but not to change values.
<b>Login
To be able to log in, the login function has to be enabled in the WebHandler object. By
To be able to log in, the login function has to be enabled in the OpPlaceWeb object. By
clicking on the Login button in the operator window, the user can log in with username and
password. The username has to be registered in the system group that is stated in the
WebSystemGroup attribute of the Security object. After a successful login, privileges of
......@@ -4874,13 +4874,13 @@ This section describes how various functions in the web and java environment are
configured and generated more in detail.
<h2>Homepage
The home page is configured by the WebHandler object, and generated by the build method of
The home page is configured by the OpPlaceWeb object, and generated by the build method of
the WebHandler object. It consists of a number of html and jar files that are created on
the $pwrp_web directory.
The start page, index.html, consists of two frames. The left frame opens the html-file for
the menu that starts an applet that connects to the Proivew server and builds the menu. The
right frame displays the URL stated in the StartURL attribute of the WebHandler object, or
right frame displays the URL stated in the StartURL attribute of the OpPlaceWeb object, or
if this attribute is empty, the start page for the xtt help.
<h2>Ge graphs
......@@ -4934,9 +4934,9 @@ in with hierarchies from which alarms and events should be displayed.
<h2>Help texts
The help texts for the project in the file xtt_help.dat, is exported to html files on
$pwrp_web by the build method of the WebHandler object. The start page for the help texts are
$pwrp_web by the build method of the OpPlaceWeb object. The start page for the help texts are
$pwrp_web/xtt_help_index.html. This is showed as default in the right frame of the home page
if no other URL is stated in the StartURL attribute of the WebHandler.
if no other URL is stated in the StartURL attribute of the OpPlaceWeb.
If the helptext contains image tags, the png or gif files have to be copied to $pwrp_web.
......@@ -4946,7 +4946,7 @@ be copied to $pwrp_web.
<h2>Language
The default language is English. Other languages can be stated in the Language attribute of
the WebHandler object, or be selected in the language selection dialog, if configured.
the OpPlaceWeb object, or be selected in the language selection dialog, if configured.
If another language than English should be available, language files for this language, and
for English, have to be copied from $pwrp_exe to $pwrp_web. For example, to make Swedish
available, the directories $pwrp_web/en_us and $pwrp_web/sv_se are created, and the files
......@@ -5024,10 +5024,9 @@ is configured by the WebHandler object. See chapter Java Operator Environment fo
When the application is started a startmenu is displayed, or if this is not configured, the
runtime navigator is displayed.
The start menu is configured with AppGraph and AppLink objects under the WebHandler object.
The AppGraph is used to open Ge graphs, and the AppLink is a link to a web page or document.
If you want to separate the App objects from the Web object under the WebHandler object, you
can create a sub hierarchy with a $NodeHier object.
The start menu is configured with an OpPlaceApp object, and below this AppGraph and AppLink
objects are placed. The AppGraph is used to open Ge graphs, and the AppLink is a link to a
web page or document.
In the AppGraph object, the name of the pwg-file is specified, an image file for the icon,
and a text that is written below the icon. In the AppLink object, an URL is specified,
......@@ -5040,7 +5039,7 @@ together with image file and text.
<b>Fig Start menu
<h2>Distribution
The attribute AppUseWebDir in the WebHandler object specifies if all files are fetched from
The attribute AppUseWebDir in the OpPlaceApp object specifies if all files are fetched from
the $pwrp_web directory, or if com files are fetched from $pwrp_exe and $pwrp_load. If
AppUseWebDir is set, the app works analogous with the web interface and pwg and flw files
has to be copied to $pwrp_web.
......@@ -5162,7 +5161,7 @@ Below follows a description of some build methods.
XttGraph <t>Copies the .pwg file for the graph from $pwrp_pop to $pwrp_exe.
WebGraph <t>Exports the graph to java, compiles and inserts into an archive.
WebHandler <t>Generates html-files for the homepage of the node, and converts xtt helpfiles
OpPlaceWeb <t>Generates html-files for the homepage of the node, and converts xtt helpfiles
<t>to web format.
PlcPgm <t>Generates c-code that is compiled by the c compiler.
RootVolume <t>Calls the build method for all objects in the volume, and creates a load file
......@@ -6871,7 +6870,7 @@ thereby change your privileges.
<h1>Web access
For process graphics on the web there is a special login frame that can be added to the
start menu of the project home page. This is enabled in WebHandler.EnableLogin attribute.
start menu of the project home page. This is enabled in OpPlaceWeb.EnableLogin attribute.
The login frame checks the username and password.
It's possible to specify a specific system group for web users in the WebSystemGroup
......
......@@ -1056,7 +1056,7 @@ relation to the radius, so a LineLength of 0.1 will give a length on the longest
<topic> geg_specialobjects_table
Table
Table is a lucid disposition of data, organized in rows and columns, often providede with
Table is a lucid disposition of data, organized in rows and columns, often provided with
headers. Table is found under the Other map in the subgraph palette.
<image> geg_fig76.png
......
......@@ -4714,12 +4714,12 @@ Operat
Om det finns ett WebHandler objekt startas server-processerna för webgränssnittet.
<h2>Konfigurering av menyn
Konfigureringen av menyn i operatörsfönstret gör i nodhierakin med attribut i WebHandler
Konfigureringen av menyn i operatörsfönstret gör i nodhierakin med attribut i ett OpPlaceWeb
objektet, och ett antal WebGraph och WebLink objekt som läggs under detta objekt.
<b>WebHandler
<b>OpPlaceWeb
I WebHandler objektet konfigureras vilka standardfunktioner som ska finnas med
I OpPlaceWeb objektet konfigureras vilka standardfunktioner som ska finnas med
i operatörsfönstrets meny.
<b>EnableLanguage
......@@ -4742,7 +4742,7 @@ Visar en knapp i menyn f
<b>WebGraph
WebGraph objekt konfigurererar knappar i menyn för att visa process grafik. WebGraph
objekt läggs under WebHandler objektet.
objekt läggs under OpPlaceWeb objektet.
WebGraph objektet gör att grafen öppnas som en Java Frame, dvs i ett eget fönster. I Ge
editorn måste man ange att grafen ska exporteras som en Java Frame genom att markera
......@@ -4776,7 +4776,7 @@ eventuell inlogging.
Hemsidan för ett projekt består av en meny och en höger ram. I höger ramen visas som
default innehållet i xtt-hjälptexten för projektet. Denna konverteras till html när
noden byggs. Om man vill ha en annan startsida i högra ramen kan man lägga in en URL
till denna i WebHandler objektets attribute StartURL. Om man t ex vill visa en Ge graf,
till denna i OpPlaceWeb objektets attribute StartURL. Om man t ex vill visa en Ge graf,
exporterar man grafen som en Java Applet och lägger man in html-filen för grafen på samma
sätt som i WebLink objektet ovan.
......@@ -4785,7 +4785,7 @@ Om man vill kunna visa Ge grafer fr
projekt vara tillgängliga för web-läsaren. Java klasserna som genereras när graferna
exporteras i Ge editorn, läggas i ett arkiv men namnet pwrp_'systemname'_web.jar.
Arkivet för det egna projektet laddas alltid, men om även andra arkiv ska laddas, ska de
läggas in i WebHandler objektets LoadArchive attribut, och kopieras till $pwrp_web.
läggas in i OpPlaceWeb objektets LoadArchive attribut, och kopieras till $pwrp_web.
<h2>Behörighet
<b>Default behörighet
......@@ -4795,7 +4795,7 @@ n
kan titta, men inte ändra värden.
<b>Inloggning
För att kunna logga in måste inloggingfunktionen vara aktiverad i WebHandler objektet.
För att kunna logga in måste inloggingfunktionen vara aktiverad i OpPlaceWeb objektet.
Genom att klicka på Login knappen in operatörsfönstret, kan användaren logga in med
användarnamn och passerord. Användarnamnet måste vara registrerat i den systemgrupp
som har angivits i Security objektets WebSystemGroup. Vid registreringen tilldelas
......@@ -4825,13 +4825,13 @@ I det h
hur de genereras och konfigureras.
<h2>Hemsida
Hemsidan konfigureras med WebHandler objektet, och genereras av WebHander objektets
Hemsidan konfigureras med OpPlaceWeb objektet, och genereras av OpPlaceWeb objektets
bygg-metod. Den består av ett antal html-filer och jar-filer som läggs på katalogen
$pwrp_web.
Startsidan, index.html, består av två ramar. Den vänstra ramen öppnar html-filen för menyn,
index_opwin_menu.html, som i sin tur öppnar en applet som knyter upp sig mot Proview
servern och bygger upp menyn. Den högra ramen visar den URL som angivits i WebHandler
servern och bygger upp menyn. Den högra ramen visar den URL som angivits i OpPlaceWeb
objektets StartURL attribut, eller om detta attribut är tomt, startsidan för xtt-hälpen.
<h2>Ge grafer
......@@ -4886,9 +4886,9 @@ hierarkier fr
<h2>Hjälptexter
Hjälptexterna för projektet, filen xtt_help.dat, exporteras till html-filer på $pwrp_web
av WebHandler objektets byggmetod. Startsidan för hjälptexterna är
av OpPlaceWeb objektets byggmetod. Startsidan för hjälptexterna är
$pwrp_web/xtt_help_index.html. Denna vissas som default i hemsidans högra ram, om ingen
annan URL är angiven i WebHandler objektets StartURL attribut.
annan URL är angiven i OpPlaceWeb objektets StartURL attribut.
Om hjälptexten innehåller image taggar måste dessa png eller gif filer kopieras till
$pwrp_web.
......@@ -4898,7 +4898,7 @@ F
$pwrp_web.
<h2>Språk
Default är språket engelska. Andra språk kan anges i WebHandler objektets Language attribut
Default är språket engelska. Andra språk kan anges i OpPlaceWeb objektets Language attribut
eller väljas i språkvalsfönstret om detta är konfigurerat. Om ett annat språk än
engelska ska kunna väljas, måste språkfiler för detta språk, och för engelska, kopieras
från $pwr_exe till $pwrp_web. För t ex svenska skapas katalogerna $pwrp_web/en_us och
......@@ -4975,10 +4975,9 @@ mer info.
När man startar applikationen visas först en startmeny, eller om denna inte är konfigurerad
runtime navigatorn.
Start menyn konfigureras under WebHandler objektet med AppGraph och AppLink objekt. AppGraph
används för att öppna Ge grafer, och AppLink är en länk till en hemsida eller ett dokument.
Om man vill separera App-objekten från Web-objekten under WebHandler objektet kan man skapa
en under hierarki men ett $NodeHier-objekt.
Start menyn konfigureras med ett OpPlaceApp objekt, och under detta med AppGraph och AppLink
objekt. AppGraph används för att öppna Ge grafer, och AppLink är en länk till en hemsida eller
ett dokument.
I AppGraph objeket anges namnet på pwg-filen, en bild-fil för ikonen och en text som skrivs
under ikonen. I AppLink objektet anges en URL, samt bild-fil och text.
......@@ -4990,7 +4989,7 @@ under ikonen. I AppLink objektet anges en URL, samt bild-fil och text.
<b>Fig Start meny
<h1>Distribution
Attributet AppUseWebDir i WebHandler-objektet anger om alla filer ska hämtas från pwrp_web
Attributet AppUseWebDir i OpPlaceApp-objektet anger om alla filer ska hämtas från pwrp_web
katalogen, eller om vissa filer ska hämtas från $pwrp_exe och $pwrp_load. Om AppUseWebDir
är satt fungerar appen analogt med webgränssnittet och pwg och flw filer måste kopieras till
$pwrp_web.
......@@ -5113,7 +5112,7 @@ H
XttGraph <t>Kopierar .pwg filen för grafen från $pwrp_pop till $pwrp_exe.
WebGraph <t>Exporterar grafen till java, kompilerar och lägger in i arkiv.
WebHandler <t>Genererar html-filer för nodens hemsida och konverterar xtt-hjälp filen till
OpPlaceWeb <t>Genererar html-filer för nodens hemsida och konverterar xtt-hjälp filen till
<t>web format (html).
PlcPgm <t>Genererar c-kod som kompileras av c-kompilatorn.
RootVolume <t>Anropar byggmetoden för all objekt i volymen, samt skapar en laddatafil med
......@@ -6805,7 +6804,7 @@ sina privilegier.
<h1>Behöriget på web
För operatörbilder på webben finns en speciellt inloggningsfönster som kan öppnas från
web menyn, om detta är konfigurerat i WebHandler objektets EnableLogin attribut. Default
web menyn, om detta är konfigurerat i OpPlaceWeb objektets EnableLogin attribut. Default
gruppen är common.web, som inte exsisterar i template användar-databasen. Istället används
då den första existerande föräldergruppen, dvs common, och användarna i denna grupp får
tillgång till hemsidan. Om man vill begränsa tillgången, skapar man antingen common.web
......
......@@ -103,7 +103,8 @@
[ $appid != "pwr_sim" ] &&
[ $appid != "pwr_plc" ] &&
[ "$appfile" != "rt_io_comm" ] &&
[ "$s8" != "pwr_plc_" ]; then
[ "$s8" != "pwr_plc_" ] &&
[ "$applname" != "" ]; then
killall $appname
fi
fi
......
......@@ -40,11 +40,11 @@ SObject pwrb:Class
! @Version 1.0
! @Summary Defines a graph in an android application.
! Defines a graph in an android application.
! AppGraph objects should be positioned as children to a WebHandler object.
! AppGraph objects should be positioned as children to a OpPlaceApp object.
!
!
! @b See also
! @classlink WebHandler pwrb_webhandler.html
! @classlink OpPlaceApp pwrb_opplaceapp.html
!*/
Object AppGraph $ClassDef 611
Body SysBody
......
......@@ -40,11 +40,11 @@ SObject pwrb:Class
! @Version 1.0
! @Summary Defines a link in an android application.
! Defines a link in an android application.
! AppLink objects should be positioned as children to a WebHandler object.
! AppLink objects should be positioned as children to a OpPlaceApp object.
!
!
! @b See also
! @classlink WebHandler pwrb_webhandler.html
! @classlink OpPlaceApp pwrb_opplaceapp.html
!*/
Object AppLink $ClassDef 616
Body SysBody
......
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2015 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_opplaceapp.wb_load -- Defines the class OpPlaceApp.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group NodeConfiguration,Operator
! @Summary Configures the App interface on a proview node.
! The OpPlaceApp object defines a Android applications interface on
! a proview node.
!
! With the OpPlaceApp object a start page is defined with icons that
! opens Ge graphs or links to web pages.
!
! @image orm_opplaceapp_1.png
!
! The start icons is configured with AppGraph and AppLink objects
! that is placed under the OpPlaceApp object.
!
! @b See also
! @classlink AppGraph pwrb_appgraph.html
! @classlink AppLink pwrb_appgraph.html
! @classlink WebHandler pwrb_webhandler.html
!*/
Object OpPlaceApp $ClassDef 683
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr PopEditor = 1
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "OpPlaceApp"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Specifies default language.
!*/
Object Language $Attribute 2
Body SysBody
Attr TypeRef = "pwrb:Type-LanguageEnum"
EndBody
EndObject
!/**
! If AppUseWebDir is set all files used by the Android application is
! read from pwrp_web.
!*/
Object AppUseWebDir $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
!
! Template for OpPlaceApp
!
Object Template OpPlaceApp
Body RtBody
Attr AppUseWebDir = 1
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2015 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_opplaceweb.wb_load -- Defines the class OpPlaceWeb.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group NodeConfiguration,Operator
! @Summary Defines a website on a proview node.
! The OpPlaceWeb object defines a website on a proview node.
!
! The website contains a menu to the left and a start page to the right.
!
! @image orm_opplaceweb_1.png
!
! The menu is divided in three sections. The first contains a number of
! standard function
! - language selection.
! - login and logout.
! - open alarm and event list.
! - open event log.
! - open runtime navigator.
! - link to project help texts.
! - link to Proview documentation.
!
! These buttons can be enabled or disabled with the Enable/Disable
! attributes in this object.
!
! The second section contains buttons to open graphs configured with
! WebGraph objects. The WebGraph objects is placed as children to the
! OpPlaceWeb object and contains the name of the Ge graph pwg-file or
! a java class.
!
! The third section contains links defined with WebLink objects. The
! WebLink objects contains an URL and is positions below the OpPlaceWeb
! object.
!
! The right page will by default contain the help text for the project,
! written in the file $pwrp_cnf/xtt_help.dat. If another page is prefered,
! this can be stated in the StartURL attribute.
!
! There can be serveral OpPlaceWeb objects in one node, configuring web
! pages with different settings. The OpPlaceWeb objects should have
! different filenames stated in the FileName attribute, and can be opened
! with an URL to the specified file. The default file is index.html for the
! first OpPlaceWeb object, and index2.html, index3.html etc, for the
! preceeding OpPlaceWeb objects.
!
! <b>Authorization
! If the login frame is enabled, a user can login with a valid username
! and password, and gain the privileges granted for the logged in user.
! Valid users are members or the system group specified in WebSystemGroup
! in the Security object.
!
! For not logged in users, the privileges are determined by DefaultWebPriv
! in the Security object. It is recommended that DefaultWebPriv is RtRead
! or zero (no privileges). Users that have no privileges can only open
! the login frame.
!
! @b See also
! @classlink WebGraph pwrb_webgraph.html
! @classlink WebLink pwrb_weblink.html
! @classlink WebHandler pwrb_webhandler.html
!*/
Object OpPlaceWeb $ClassDef 682
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr PopEditor = 1
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "OpPlaceWeb"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Name of the html-file for the start page.
! Default index.html
!*/
Object FileName $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Title in the menu frame.
!*/
Object Title $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Additional text in the menu frame.
!*/
Object Text $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! A language selection entry will be placed in the menu frame.
!*/
Object EnableLanguage $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! @Summary A login entry will be placed in the menu frame.
! A login entry will be placed in the menu frame, that makes it possible
! to login as a proview user, and gain privileges to make changes to
! the database.
!*/
Object EnableLogin $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! An entry for alarm and eventlist will be placed in the menu.
!*/
Object EnableAlarmList $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! An entry for eventlog will be placed in the menu.
!*/
Object EnableEventLog $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! An entry for runtime navigator will be placed in the menu.
!*/
Object EnableNavigator $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Disable the Help button.
! The Help button contains a link to the project help text.
!*/
Object DisableHelp $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Disable the Proview button.
! The Proview button contains a link to the Proview web documentation page.
!*/
Object DisableProview $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Specifies default language.
!*/
Object Language $Attribute 12
Body SysBody
Attr TypeRef = "pwrb:Type-LanguageEnum"
EndBody
EndObject
!/**
! @Summary css-file that will be used by generated html-files.
! css-file (Cascading Style Sheets) that will be used by
! generated html-files.
!*/
Object StyleSheet $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! @Summary URL in right frame when the website is opened
! The URL that will be displayed in the right frame when the
! web-site is opened.
!*/
Object StartURL $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! @Summary Web archives that is loaded when the menu applet is opened.
! Web archives that is loaded when the menu applet is opened.
! Object graphs for some classvolumes are not loaded by default, as
! they are quite large and timeconsuming. They can be loaded by adding
! the name of the archive in this attribute.
! Also archives with graphs from other projects can be added.
! Archive are separated by comma.
! The archives has to be copied to $pwrp_web.
!*/
Object LoadArchives $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$String256"
EndBody
EndObject
!/**
! Name of Proview host when web interface is opened from another
! site than the process or operator station.
!*/
Object PwrHost $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! @Summary Signature alias set to the project archive.
! To be able to open the web interface from another site than
! the process or operator station, the host name of the process
! station has to be stated in PwrHost and a signature has to be
! applied to the jar-files of the web site. The signature is an
! alias created by keytool and is stated in AppletSignature.
!
! In this example a signature with the alias pwrkey is created with
! a validity of 100 years
!
! > keytool -genkey -alias pwrkey
! > keytool -selfcert -alias pwrkey -validity 36500
!
! The alias should be signed to all jarfiles in $pwrp_web,
! pwr_rt_client.jar, pwr_jop.jar, pwr_jopc.jar etc. This is done with
! jarsigner
!
! > jarsigner $pwrp_web/pwr_rt_client.jar pwrkey
!
! The project specific jarfile will automatically be signed if the
! alias is stated in AppletSignature. Note that the passphrase for the
! keystore has to be entered in the terminal window. It is possible to
! state the passphrase in the AppletSignature after the alias and a '/',
! eg 'pwrkey/mypassphrase'.
!*/
Object AppletSignature $Attribute 17
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
EndObject
!
! Template for OpPlaceWeb
!
Object Template OpPlaceWeb
Body RtBody
Attr FileName = "index.html"
EndBody
EndObject
Object NavigatorPosnn $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "OpPlaceWeb-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPoson $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "OpPlaceWeb-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPosos $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "OpPlaceWeb-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPosms $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "WebHandler-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPosmn $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "OpPlaceWeb-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "OpPlaceWeb-PostCreate"
EndBody
EndObject
EndObject
EndSObject
......@@ -40,11 +40,11 @@ SObject pwrb:Class
! @Version 1.0
! @Summary Defines a web graph in a proview website
! The WebGraph object defines a web graph in a proview website.
! WebGraph objects should be positioned as children to a WebHandler object.
! WebGraph objects should be positioned as children to a OpPlaceWeb object.
!
!
! @b See also
! @classlink WebHandler pwrb_webhandler.html
! @classlink OpPlaceWeb pwrb_opplaceweb.html
! @classlink WebLink pwrb_weblink.html
!*/
Object WebGraph $ClassDef 300
......
......@@ -46,18 +46,8 @@ SObject pwrb:Class
! server process (GdhServer) to start, which provides the graph-applets
! with information from the realtime database.
!
! With the 'Generate website' function in Ge it is also possible to
! produce html-files for a website, containing a menu-frame and an
! applet frame. The links in the menu is defined by WebGraph and WebLink
! objects that are children to the WebHandler object.
!
! If the EnableLogin attribute is set, the menu will contain a link to
! a login-applet which makes it possible to login as a proview user, and
! gain privilege to make changes to the database.
!
! @b See also
! @classlink WebGraph pwrb_webgraph.html
! @classlink WebLink pwrb_weblink.html
! @classlink OpPlaceWeb pwrb_opplaceweb.html
!*/
Object WebHandler $ClassDef 296
Body SysBody
......@@ -103,89 +93,113 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! Name of the html-file for the start page.
! Default index.html
! Obsolete since V5.4.
!*/
Object FileName $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Title in the menu frame.
! Obsolete since V5.4.
!*/
Object Title $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Additional text in the menu frame.
! Obsolete since V5.4.
!*/
Object Text $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! A language selection entry will be placed in the menu frame.
! Obsolete since V5.4.
!*/
Object EnableLanguage $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! @Summary A login entry will be placed in the menu frame.
! A login entry will be placed in the menu frame, that makes it possible
! to login as a proview user, and gain privileges to make changes to
! the database.
! Obsolete since V5.4.
!*/
Object EnableLogin $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! An entry for alarm and eventlist will be placed in the menu.
! Obsolete since V5.4.
!*/
Object EnableAlarmList $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! An entry for eventlog will be placed in the menu.
! Obsolete since V5.4.
!*/
Object EnableEventLog $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! An entry for runtime navigator will be placed in the menu.
! Obsolete since V5.4.
!*/
Object EnableNavigator $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Disable the Help button.
! The Help button contains a link to the project help text.
! Obsolete since V5.4.
!*/
Object DisableHelp $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Disable the Proview button.
! The Proview button contains a link to the Proview web documentation page.
! Obsolete since V5.4.
!*/
Object DisableProview $Attribute 17
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
......@@ -194,91 +208,75 @@ SObject pwrb:Class
Object UserObject $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Specifies default language.
! Obsolete since V5.4.
!*/
Object Language $Attribute 15
Body SysBody
Attr TypeRef = "pwrb:Type-LanguageEnum"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! @Summary css-file that will be used by generated html-files.
! css-file (Cascading Style Sheets) that will be used by
! generated html-files.
! Obsolete since V5.4.
!*/
Object StyleSheet $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! @Summary URL in right frame when the website is opened
! The URL that will be displayed in the right frame when the
! web-site is opened.
! Obsolete since V5.4.
!*/
Object StartURL $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! @Summary Web archives that is loaded when the menu applet is opened.
! Web archives that is loaded when the menu applet is opened.
! Object graphs for some classvolumes are not loaded by default, as
! they are quite large and timeconsuming. They can be loaded by adding
! the name of the archive in this attribute.
! Also archives with graphs from other projects can be added.
! Archive are separated by comma.
! The archives has to be copied to $pwrp_web.
! Obsolete since V5.4.
!*/
Object LoadArchives $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$String256"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Name of Proview host when web interface is opened from another
! site than the process or operator station.
! Obsolete since V5.4.
!*/
Object PwrHost $Attribute 18
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! @Summary Signature alias set to the project archive.
! To be able to open the web interface from another site than
! the process or operator station, the host name of the process
! station has to be stated in PwrHost and a signature has to be
! applied to the jar-files of the web site. The signature is an
! alias created by keytool and is stated in AppletSignature.
!
! In this example a signature with the alias pwrkey is created with
! a validity of 100 years
!
! > keytool -genkey -alias pwrkey
! > keytool -selfcert -alias pwrkey -validity 36500
!
! The alias should be signed to all jarfiles in $pwrp_web,
! pwr_rt_client.jar, pwr_jop.jar, pwr_jopc.jar etc. This is done with
! jarsigner
!
! > jarsigner $pwrp_web/pwr_rt_client.jar pwrkey
!
! The project specific jarfile will automatically be signed if the
! alias is stated in AppletSignature. Note that the passphrase for the
! keystore has to be entered in the terminal window. It is possible to
! state the passphrase in the AppletSignature after the alias and a '/',
! eg 'pwrkey/mypassphrase'.
! Obsolete since V5.4.
!*/
Object AppletSignature $Attribute 19
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
......@@ -347,12 +345,14 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! If AppUseWebDir is set all files used by the Android application is
! read from pwrp_web.
! Obsolete since V5.4.
!*/
Object AppUseWebDir $Attribute 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
EndObject
......@@ -368,66 +368,6 @@ SObject pwrb:Class
Attr AppUseWebDir = 1
EndBody
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "WebHandler-PostCreate"
EndBody
EndObject
Object NavigatorPosnn $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "WebHandler-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPoson $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "WebHandler-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPosos $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "WebHandler-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPosms $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "WebHandler-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
Object NavigatorPosmn $Menu
Object Pointed $Menu
Object Build $MenuButton
Body SysBody
Attr ButtonName = "Build"
Attr MethodName = "WebHandler-Build"
Attr FilterName = "$Object-BuildFilter"
EndBody
EndObject
EndObject
EndObject
EndObject
EndSObject
......
......@@ -41,10 +41,10 @@ SObject pwrb:Class
! @Summary Defines a web link in a proview website
! The WebLink object defines a web link in a proview website, and will
! be displayed as an entry in the menu frame.
! WebLink objects should be positioned as children to a WebHandler object.
! WebLink objects should be positioned as children to a OpPlaceWeb object.
!
! @b See also
! @classlink WebHandler pwrb_webhandler.html
! @classlink OpPlaceWeb pwrb_opplaceweb.html
! @classlink WebGraph pwrb_webgraph.html
!*/
Object WebLink $ClassDef 301
......
......@@ -486,8 +486,10 @@ palette NavigatorPalette
class XttMultiView
class XttVideo
class WebBrowserConfig
class OpPlaceWeb
class WebGraph
class WebLink
class OpPlaceApp
class AppGraph
class AppLink
}
......
......@@ -89,8 +89,8 @@ void wb_build::classlist( pwr_tCid cid)
case pwr_cClass_XttGraph:
xttgraph( o.oid());
break;
case pwr_cClass_WebHandler:
webhandler( o.oid());
case pwr_cClass_OpPlaceWeb:
opplaceweb( o.oid());
break;
case pwr_cClass_WebBrowserConfig:
webbrowserconfig( o.oid());
......@@ -491,7 +491,7 @@ void wb_build::rootvolume( pwr_tVid vid)
if ( sumsts == PWRB__NOBUILT && m_sts != PWRB__NOBUILT)
sumsts = m_sts;
classlist( pwr_cClass_WebHandler);
classlist( pwr_cClass_OpPlaceWeb);
if ( evenSts()) return;
if ( sumsts == PWRB__NOBUILT && m_sts != PWRB__NOBUILT)
sumsts = m_sts;
......@@ -727,7 +727,7 @@ void wb_build::nodehier( pwr_tOid oid)
if ( evenSts()) return;
sumsts = m_sts;
classlist( pwr_cClass_WebHandler);
classlist( pwr_cClass_OpPlaceWeb);
if ( evenSts()) return;
if ( sumsts == PWRB__NOBUILT && m_sts != PWRB__NOBUILT)
sumsts = m_sts;
......@@ -1055,9 +1055,9 @@ void wb_build::webgraph( pwr_tOid oid)
MsgWindow::message('W', cmd, msgw_ePop_No, oid);
}
else {
// Get signature from WebHandler
// Get signature from OpPlaceWeb
for ( wb_object p = o.parent(); p.oddSts(); p = p.parent()) {
if ( p.cid() == pwr_cClass_WebHandler) {
if ( p.cid() == pwr_cClass_OpPlaceWeb) {
wb_attribute a = m_session.attribute( p.oid(), "RtBody", "AppletSignature");
if ( !a) {
m_sts = a.sts();
......@@ -1231,7 +1231,7 @@ void wb_build::appgraph( pwr_tOid oid)
m_sts = PWRB__NOBUILT;
}
void wb_build::webhandler( pwr_tOid oid)
void wb_build::opplaceweb( pwr_tOid oid)
{
pwr_tTime modtime;
pwr_tString80 file_name, name;
......@@ -1298,11 +1298,11 @@ void wb_build::webhandler( pwr_tOid oid)
m_sts = PWRB__NOBUILT;
if ( opt.force || EVEN(fsts) || time_Acomp( &modtime, &ftime) == 1) {
// modtime > ftime
m_sts = Graph::generate_web( (ldh_tSession *)&m_session);
m_sts = Graph::generate_web( (ldh_tSession *)&m_session, oid);
if ( evenSts()) return;
char msg[200];
sprintf( msg, "Build: WebHandler Webpage generated %s", fname);
sprintf( msg, "Build: OpPlaceWeb Webpage generated %s", fname);
MsgWindow::message( 'I', msg, msgw_ePop_No, oid);
}
......@@ -1317,7 +1317,7 @@ void wb_build::webhandler( pwr_tOid oid)
system( "co_convert -d $pwrp_web -t " pwr_cNameProjectXttHelp);
char msg[200];
sprintf( msg, "Build: WebHandler xtt_help.dat converted to html");
sprintf( msg, "Build: OpPlaceWeb xtt_help.dat converted to html");
MsgWindow::message( 'I', msg, msgw_ePop_No, oid);
m_sts = PWRB__SUCCESS;
}
......@@ -1368,7 +1368,7 @@ void wb_build::webhandler( pwr_tOid oid)
sprintf( cmd, "co_convert -d $pwrp_web -t %s", srcname);
system( cmd);
sprintf( msg, "Build: WebHandler plc xtthelp-file for volume %s converted to html", vol_array[0]);
sprintf( msg, "Build: OpPlaceWeb plc xtthelp-file for volume %s converted to html", vol_array[0]);
MsgWindow::message( 'I', msg, msgw_ePop_No, oid);
m_sts = PWRB__SUCCESS;
}
......
......@@ -72,7 +72,7 @@ class wb_build : public wb_status
void nodehier( pwr_tOid oid);
void plcpgm( pwr_tOid oid);
void xttgraph( pwr_tOid oid);
void webhandler( pwr_tOid oid);
void opplaceweb( pwr_tOid oid);
void webbrowserconfig( pwr_tOid oid);
void webgraph( pwr_tOid oid);
void appgraph( pwr_tOid oid);
......
......@@ -34,7 +34,7 @@
* General Public License plus this exception.
**/
/* wb_c_webhandler.cpp -- work bench methods of the WebHandler class. */
/* wb_c_opplaceweb.cpp -- work bench methods of the OpPlaceWeb class. */
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
......@@ -60,7 +60,7 @@ static pwr_tStatus Build (
wb_build build( *(wb_session *)ip->PointedSession, ip->wnav);
build.opt = ip->wnav->gbl.build;
build.webhandler( ip->Pointed.Objid);
build.opplaceweb( ip->Pointed.Objid);
if ( build.sts() == PWRB__NOBUILT)
ip->wnav->message( 'I', "Nothing to build");
......@@ -73,11 +73,46 @@ static pwr_tStatus PostCreate (
pwr_tOid Father,
pwr_tCid Class
) {
// Nothing to do from V4.7.0 ...
wb_session *sp = (wb_session *) Session;
wb_object o = sp->object( Object);
// Find a unique name for FileName
int idx = 0;
for ( wb_object co = sp->object( pwr_cClass_OpPlaceWeb); co; co = co.next()) {
pwr_tString80 filename;
int i;
if ( cdh_ObjidIsEqual( co.oid(), o.oid()))
continue;
wb_attribute ca = sp->attribute( co.oid(), "RtBody", "FileName");
if ( !ca) return ca.sts();
ca.value( filename);
if ( (strcmp( filename, "index.html") == 0) && idx < 1)
idx = 2;
else if ( sscanf( filename, "index%d.html", &i) != 0) {
if ( idx <= i)
idx = i+1;
}
if ( idx > 0) {
wb_attribute a = sp->attribute( o.oid(), "RtBody", "FileName");
if ( !a) return a.sts();
sprintf( filename, "index%d.html", idx);
try {
sp->writeAttribute( a, filename, sizeof(filename));
}
catch ( wb_error& e) {
return e.sts();
}
}
}
return PWRB__SUCCESS;
}
pwr_dExport pwr_BindMethods(WebHandler) = {
pwr_dExport pwr_BindMethods(OpPlaceWeb) = {
pwr_BindMethod(Build),
pwr_BindMethod(PostCreate),
pwr_NullMethod
......
......@@ -69,7 +69,7 @@ pwr_dImport pwr_BindMethods(Io);
pwr_dImport pwr_BindMethods(XttGraph);
pwr_dImport pwr_BindMethods(WebGraph);
pwr_dImport pwr_BindMethods(OpPlace);
pwr_dImport pwr_BindMethods(WebHandler);
pwr_dImport pwr_BindMethods(OpPlaceWeb);
pwr_dImport pwr_BindMethods(PlcProcess);
pwr_dImport pwr_BindMethods(PlcThread);
pwr_dImport pwr_BindMethods(NodeConfig);
......@@ -111,7 +111,7 @@ pwr_dExport pwr_BindClasses(Base) = {
pwr_BindClass(XttGraph),
pwr_BindClass(WebGraph),
pwr_BindClass(OpPlace),
pwr_BindClass(WebHandler),
pwr_BindClass(OpPlaceWeb),
pwr_BindClass(PlcProcess),
pwr_BindClass(PlcThread),
pwr_BindClass(NodeConfig),
......
......@@ -31,7 +31,7 @@ Bo
XttGraph
WebGraph
OpPlace
WebHandler
OpPlaceWeb
PlcProcess
PlcThread
NodeConfig
......
......@@ -2624,17 +2624,8 @@ static int wnav_generate_func( void *client_data,
}
if ( cdh_NoCaseStrncmp( arg1_str, "WEB", strlen( arg1_str)) == 0) {
int sts;
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->ldhses);
if ( EVEN(sts)) return sts;
sts = Ge::generate_web( wnav->ldhses);
if ( EVEN(sts))
{
wnav->message(' ', wnav_get_message(sts));
return sts;
}
wnav->message('E', "Generate web is obsolete");
return WNAV__SUCCESS;
}
else if ( cdh_NoCaseStrncmp( arg1_str, "HISTORY", strlen( arg1_str)) == 0) {
pwr_tFileName filestr;
......
......@@ -835,11 +835,6 @@ void GeGtk::activate_import_image(GtkWidget *w, gpointer gectx)
image_file_selected_cb, wow_eFileSelType_Image);
}
void GeGtk::activate_generate_web(GtkWidget *w, gpointer gectx)
{
((Ge *)gectx)->activate_generate_web();
}
void GeGtk::activate_creanextpage(GtkWidget *w, gpointer gectx)
{
((Ge *)gectx)->activate_creanextpage();
......
......@@ -198,7 +198,6 @@ class GeGtk : public Ge {
static void activate_customcolors_write(GtkWidget *w, gpointer gectx);
static void activate_import_graph( GtkWidget *w, gpointer gectx);
static void activate_import_image( GtkWidget *w, gpointer gectx);
static void activate_generate_web( GtkWidget *w, gpointer gectx);
static void activate_creanextpage( GtkWidget *w, gpointer gectx);
static void activate_nextpage( GtkWidget *w, gpointer gectx);
static void activate_prevpage( GtkWidget *w, gpointer gectx);
......
......@@ -673,11 +673,6 @@ void GeMotif::activate_export_java_as( Widget w, Ge *gectx, XmAnyCallbackStruct
gectx->activate_export_java_as();
}
void GeMotif::activate_generate_web( Widget w, Ge *gectx, XmAnyCallbackStruct *data)
{
gectx->activate_generate_web();
}
void GeMotif::activate_creanextpage( Widget w, Ge *gectx, XmAnyCallbackStruct *data)
{
gectx->activate_creanextpage();
......@@ -1364,7 +1359,6 @@ GeMotif::GeMotif( void *x_parent_ctx,
{(char*) "ge_activate_open",(caddr_t)GeMotif::activate_open },
{(char*) "ge_activate_export_java",(caddr_t)GeMotif::activate_export_java },
{(char*) "ge_activate_export_java_as",(caddr_t)GeMotif::activate_export_java_as },
{(char*) "ge_activate_generate_web",(caddr_t)GeMotif::activate_generate_web },
{(char*) "ge_activate_creanextpage",(caddr_t)GeMotif::activate_creanextpage },
{(char*) "ge_activate_nextpage",(caddr_t)GeMotif::activate_nextpage },
{(char*) "ge_activate_prevpage",(caddr_t)GeMotif::activate_prevpage },
......
......@@ -174,7 +174,6 @@ class GeMotif : public Ge {
static void activate_export_gejava_as( Widget w, Ge *gectx, XmAnyCallbackStruct *data);
static void activate_export_java( Widget w, Ge *gectx, XmAnyCallbackStruct *data);
static void activate_export_java_as( Widget w, Ge *gectx, XmAnyCallbackStruct *data);
static void activate_generate_web( Widget w, Ge *gectx, XmAnyCallbackStruct *data);
static void activate_creanextpage( Widget w, Ge *gectx, XmAnyCallbackStruct *data);
static void activate_nextpage( Widget w, Ge *gectx, XmAnyCallbackStruct *data);
static void activate_prevpage( Widget w, Ge *gectx, XmAnyCallbackStruct *data);
......
......@@ -1383,30 +1383,6 @@ void Ge::export_plcfo( Ge *gectx, char *filename)
gectx->message( sts);
}
void Ge::activate_generate_web()
{
int sts;
// graph->generate_web();
if ( !ldhses) {
message( 'E', "Ge is not connected to workbench");
return;
}
sts = Graph::generate_web( ldhses);
if ( sts == GE__NONODEOBJECT)
message( 'E', "Can't find $Node object");
else if ( sts == GE__NOWEBHANDLER)
message( 'E', "Can't find WebHandler object");
else if ( sts == GE__WEBHANDLERS)
message( 'E', "More than one WebHandler object found");
else if ( EVEN(sts))
message( 'E', "Error from generate web");
else
message( 'I', "Web-pages generated");
Graph::generate_web_help();
}
void Ge::activate_creanextpage()
{
char old_name[40];
......@@ -2245,11 +2221,6 @@ int Ge::set_focus( void *component)
return 1;
}
int Ge::generate_web( ldh_tSesContext x_ldhses)
{
return Graph::generate_web( x_ldhses);
}
int Ge::command( char *cmd)
{
return graph->command( cmd);
......
......@@ -125,7 +125,6 @@ class Ge {
void open( char *name);
void save( char *name);
void clear();
static int generate_web( ldh_tSesContext ldhses);
int command( char *cmd);
void message( pwr_tStatus sts);
......@@ -216,7 +215,6 @@ class Ge {
void activate_export_java_as();
void activate_export_plcfo();
void activate_export_plcfo_as();
void activate_generate_web();
void activate_creanextpage();
void activate_nextpage();
void activate_prevpage();
......
......@@ -1498,7 +1498,7 @@ class Graph {
//! Generate web site from configuration in database.
/*! \param ldhses Ldh session. */
static int generate_web( ldh_tSesContext ldhses);
static int generate_web( ldh_tSesContext ldhses, pwr_tOid opplaceweb_oid);
//! Generate web help from xtt_help.
static int generate_web_help();
......
......@@ -73,36 +73,14 @@ typedef enum {
static int graph_get_applet_size( char *graphname, int *width, int *height);
#endif
#if LDH
static int graph_webhandler_insert( pwr_sAttrRef *aref, void *o_p,
void *c_p, void *dum1, void *dum2, void *dum3)
{
int *count = (int *)c_p;
pwr_tObjid *objid_p = (pwr_tObjid *) o_p;
if ( *count == 0)
*objid_p = aref->Objid;
(*count)++;
return 1;
}
#endif
int Graph::generate_web( ldh_tSesContext ldhses)
int Graph::generate_web( ldh_tSesContext ldhses, pwr_tOid opplaceweb_oid)
{
#if LDH
unsigned long node_count;
pwr_tObjid *nodelist;
pwr_tObjid node_objid;
int sts;
int size;
pwr_tObjid webhandler_objid;
int webhandler_cnt = 0;
pwr_tClassId classid;
pwr_tObjid webgraph_objid;
pwr_tObjid weblink_objid;
pwr_tClassId class_vect[2];
char *value_p;
pwr_tString80 title;
pwr_tString80 text;
......@@ -133,45 +111,20 @@ int Graph::generate_web( ldh_tSesContext ldhses)
char target_str[80];
char sname[80];
char arlist[400];
pwr_tOName opplaceweb_name;
ge_get_systemname( sname);
// Get codebase for applets from global config file
cnf_get_value( "appletCodebase", codebase, sizeof(codebase));
// Find the WebHandler object
sts = trv_get_rtnodes( ldhses, &node_count, &nodelist);
if ( ODD(sts))
{
if ( node_count > 0)
{
node_objid = *nodelist;
free( (char *)nodelist);
}
else
sts = 0;
}
if ( EVEN(sts)) {
return GE__NONODEOBJECT;
}
class_vect[0] = pwr_cClass_WebHandler;
class_vect[1] = 0;
sts = trv_get_objects_hcn( ldhses, node_objid, class_vect,
NULL, graph_webhandler_insert, (void *)&webhandler_objid,
(void *)&webhandler_cnt,0,0,0);
if ( EVEN(sts) || webhandler_cnt == 0) {
return GE__NOWEBHANDLER;
}
if ( webhandler_cnt > 1) {
return GE__WEBHANDLERS;
}
// Get WebHandler data
// Get OpPlaceWeb data
sts = ldh_ObjidToName( ldhses, opplaceweb_oid, ldh_eName_Hierarchy, opplaceweb_name,
sizeof(opplaceweb_name), &size);
if (EVEN(sts)) return sts;
// Attribute FileName
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "FileName",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "FileName",
&value_p, &size);
if (EVEN(sts)) return sts;
if ( strcmp( value_p, "") == 0)
......@@ -181,21 +134,21 @@ int Graph::generate_web( ldh_tSesContext ldhses)
free( value_p);
// Attribute Title
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "Title",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "Title",
&value_p, &size);
if (EVEN(sts)) return sts;
strcpy( title, value_p);
free( value_p);
// Attribute Text
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "Text",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "Text",
&value_p, &size);
if (EVEN(sts)) return sts;
strcpy( text, value_p);
free( value_p);
// Attribute PwrHost
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "PwrHost",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "PwrHost",
&value_p, &size);
if (EVEN(sts)) return sts;
strcpy( pwrhost, value_p);
......@@ -203,49 +156,49 @@ int Graph::generate_web( ldh_tSesContext ldhses)
dcli_trim( pwrhost, pwrhost);
// Attribute EnableLogin
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "EnableLogin",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "EnableLogin",
&value_p, &size);
if (EVEN(sts)) return sts;
enable_login = *(pwr_tBoolean *)value_p;
free( value_p);
// Attribute EnableAlarmList
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "EnableAlarmList",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "EnableAlarmList",
&value_p, &size);
if (EVEN(sts)) return sts;
enable_alarmlist = *(pwr_tBoolean *)value_p;
free( value_p);
// Attribute EnableEventLog
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "EnableEventLog",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "EnableEventLog",
&value_p, &size);
if (EVEN(sts)) return sts;
enable_eventlog = *(pwr_tBoolean *)value_p;
free( value_p);
// Attribute EnableNavigator
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "EnableNavigator",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "EnableNavigator",
&value_p, &size);
if (EVEN(sts)) return sts;
enable_navigator = *(pwr_tBoolean *)value_p;
free( value_p);
// Attribute StyleSheet
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "StyleSheet",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "StyleSheet",
&value_p, &size);
if (EVEN(sts)) return sts;
strcpy( style_sheet, value_p);
free( value_p);
// Attribute StartURL
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "StartURL",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "StartURL",
&value_p, &size);
if (EVEN(sts)) return sts;
strcpy( start_URL, value_p);
free( value_p);
// Attribute LoadArchives
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "LoadArchives",
sts = ldh_GetObjectPar( ldhses, opplaceweb_oid, "RtBody", "LoadArchives",
&value_p, &size);
if (EVEN(sts)) return sts;
strcpy( load_archives, (char *)value_p);
......@@ -373,7 +326,7 @@ int Graph::generate_web( ldh_tSesContext ldhses)
}
// Get all WebGraph objects
sts = ldh_GetChild( ldhses, webhandler_objid, &webgraph_objid);
sts = ldh_GetChild( ldhses, opplaceweb_oid, &webgraph_objid);
while( ODD(sts)) {
sts = ldh_GetObjectClass( ldhses, webgraph_objid, &classid);
......@@ -444,7 +397,7 @@ graph_text << "'," << resize << "," << width+20 << "," << height+20
"" << endl;
// Get all WebLink objects
sts = ldh_GetChild( ldhses, webhandler_objid, &weblink_objid);
sts = ldh_GetChild( ldhses, opplaceweb_oid, &weblink_objid);
while( ODD(sts)) {
sts = ldh_GetObjectClass( ldhses, weblink_objid, &classid);
......@@ -528,7 +481,8 @@ graph_text << "'," << resize << "," << width+20 << "," << height+20
" <param name = \"code\" value=\"jpwr.jop.JopOpWindowApplet.class\" >" << endl <<
" <param name =\"archive\" value=\"" << arlist << ",pwrp_" << sname << "_web.jar\">" << endl <<
" <param name=\"persistState\" value=\"false\" />" << endl <<
" <param name=\"scriptable\" value=\"false\">" << endl;
" <param name=\"scriptable\" value=\"false\">" << endl <<
" <param name=\"pwrplace\" value=\"" << opplaceweb_name << "\">" << endl;
if ( strcmp( pwrhost, "") != 0)
fp_ow <<
" <param name=\"pwrhost\" value=\"" << pwrhost << "\">" << endl;
......@@ -541,7 +495,8 @@ graph_text << "'," << resize << "," << width+20 << "," << height+20
" <param name = code value=jpwr.jop.JopOpWindowApplet.class >" << endl <<
" <param name =\"archive\" value=\"" << arlist << ",pwrp_" << sname << "_web.jar\">" << endl <<
" <param name=\"type\" value=\"application/x-java-applet;version=1.3\">" << endl <<
" <param name=\"scriptable\" value=\"false\">" << endl;
" <param name=\"scriptable\" value=\"false\">" << endl <<
" <param name=\"pwrplace\" value=\"" << opplaceweb_name << "\">" << endl;
if ( strcmp( pwrhost, "") != 0)
fp_ow <<
" <param name=\"pwrhost\" value=\"" << pwrhost << "\">" << endl;
......
......@@ -439,7 +439,6 @@ procedure
ge_activate_subgraphs(integer);
ge_activate_export_java(integer);
ge_activate_export_java_as(integer);
ge_activate_generate_web(integer);
ge_activate_creanextpage(integer);
ge_activate_nextpage(integer);
ge_activate_prevpage(integer);
......@@ -764,18 +763,6 @@ object file_entry : XmCascadeButton
XmNactivateCallback = procedure ge_activate_export_java_as(ge_ctx);
};
};
XmPushButton
{
arguments
{
XmNlabelString = compound_string("Generate Web");
XmNfontList = menu_font;
};
callbacks
{
XmNactivateCallback = procedure ge_activate_generate_web(ge_ctx);
};
};
XmCascadeButton
{
arguments
......
......@@ -547,7 +547,9 @@ E 3.1.18 "TestOn"
E 3.1.19 "TestValue"
E 3.1.20 "Inverted"
E 3.1.21 "Test"
E 3.1.22 "Off/Test"
E 3.1.22 "Off / Test"
E 3.1.23 "Open Channel"
E 3.1.24 "Open Signal"
#
# Mode - PID
E 3.2.1 "Mode"
......
......@@ -545,6 +545,8 @@ E 3.1.19 "TestV
E 3.1.20 "Inverterad"
E 3.1.21 "Test"
E 3.1.22 "Frn/Test"
E 3.1.23 "ppna kanal"
E 3.1.24 "ppna signal"
#
# Mode - PID
E 3.2.1 "Mod"
......
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