Suggestions for developing WebInterface (using Tomcat)? - html

I am working with TS-7500 (ARM 9) board running Debian Linux (Linux ts7500 2.6.24.4). It is connected to a couple of sensors and is running driver code to talk to these sensors.
Every time the C program starts, it reads a couple of config-parameters from a config-file and starts sensors with those values.
So the task at hand is : presenting a web interface to show/edit these config-parameters to user. The task of the web interface can be summarized in four steps :
Read config-parameters from the config-file and show the current configuration
Allow user to change the configuration
Capture and save the changes to same config-file
These config-parameters could be presented as drop-down menu items or radio-buttons. And I have a linux background script which restarts the C prg when config-file is modified.
I know TS-7500 runs Tomcat. Now please suggest a good way to handle this problem. I have heard about using Servlet and JSPs (am not very familiar with those actually). Which one of them is suitable to generate HTML pages dynamically ? (as I see everytime I need to generate a new HTML page by selecting the current configuration while displaying the page).
Sorry for being very elaborate !
EDIT : Beeps ! No reply ? Come on guyz, is the question not clear ? Or no one has ever faced a similar problem (design problem) ??

The solution would be to use a PHP in addition with Apache web server ! PHP script could be used to
Read the config file and capturing the parameters
Generate a HTML form (by pre-selecting the dropdown menus and radio buttons from the already read parameters)
And capturing the new edits and saving them to config file.
PHP script must be placed in /var/www/ directory of the embedded board. Then from any system, it could be accessed just by keying the IP address of the board and the script name using a simple web browser.

Related

JUnit5: How do I configure a TestExecutionListener to run last?

I have created a TestExecutionListener that wants to persist additional data in the XML files created by the LegacyXmlReportGeneratingListener (you know, the TEST-testClassName.xml ones in /build/test-reports/test).
I have registered the TestExecutionListener via /META-INF/services/org.junit.platform.launcher.TestExecutionListener.
Everything works fine so far, except the fact, that the LegacyXmlReportGeneratingListener runs afterwards and overwrites my changes. Or on a freshly built system, my listener can't - of course - even find the XMLs.
How can I tell my custom listener to run last or at least after the report generating listeners?
Thanks in advance

UI Testing (casperjs) with good known status of data (mysql database)

I'm using CasperJS for automated UI tests. I've done the basic UI testing and validation with some random data, kind of POC. I've set up this automation using bash script which kicks to start the web server, load MySQL data from SQL file, start CasperJS test cases, stop the web server, check the log files.
Now, I want to start the testing with some good known status of data which are stored in MySQL. So that I can test the list data and form data with detailed field information with some known database status. How should I know the status of data in the database at a moment?
1) Should I use pre-populated JSON dumped file which has status and details about all data?
2) Should I use web service API? (web service APIs are being used to show/save/delete data from the web page)
Let's take an example. I've 5 users in Users table. Now when I open the home page it shows 5 users with some rough details. When I click on any record from the list of users, it shows a form with detailed information about that user. The webpage is requesting to the web application to get the detail about a user with the help of user_id to show the detailed user data in a form. Now I want to check that all the data in that form is populated correctly. So at the next step, what would be the preferred way, should I read content from JSON dumped file or should I use web service API (like webpage does).
Searching this problem online, I also found MYSQL HTTP plugin. Should I consider this as well? and How safe it is to use? (I know from the docs that this plugin is not for the production, it is just for testing purpose only. :) )
For the main question in cases like this I would change the database connection string to your testing database (this is a clone).
In your case use your bash script to change the connection string (file copy?) automatically before you run the tests. And when completed change back.
Your testing database is a direct clone of your dev/live databsae but with ONLY the test data you want. Downside is you need to keep the schema in sync with DEV/LIVE.
Also another point to take into considertion is if your testing changes state (post). If so your testing data might be out of sync. One way is get around this is to drop foreign keys, truncate the data and load in a dump file.
HTH

SAP HANA: not able to call xsjs file in HTML

I had an SAP UI5 application project in which one of the pages is product.html and a xsjs file getProductCat.xsjs.
Now I made some changes in HTMl page from notepad. When I try to open in HANA's web browser the changes are there but it is not able to connect to xsjs file. However, if I try to open through browser it connects to xsjs but the changes are not there, it seems it's opening the old file.
As I am new to SAP UI5 so I think I am missing some basic step.
Go to HANA client installation folder, run the following command line to get the help for HANA content activation:
C:\Program Files\sap\hdbclient>regi help activate
Action:
activate
What:
inactiveObjects (all inactive objects in the current workspace)
package (all objects in a package)
packages (all objects in a package and its sub-packages)
trackedPackages (all objects in all tracked packages and their sub-packages)
object (specific objects)
Call "regi help activate <WHAT>" for more information.
after you changed the xsjs file, did you activate it? You need to setup your workspace for the xs app. Did you?
Actually, this is not sapui5 question. This is a HANA XS application related question.
-D

New LightSwitch Project

I have started a new Lightswitch project using a SQL database that was created with Lightswitch. When I publish and install the new Desktop project everything goes fine with no errors in publishing, installing or loading the new application. The first and only screen appears. I can click on different records and the data shows up and I can edit the data. However, if I use the list search function all of the fields get Red x'd.
The original application works the way it supposed to work.
I have tried with and without IIS: Published with (local) and (IIS) and get the same results with both methods.
The connecection string options for the new app are not the same as the original in that System Admin and Sytem user connecection strings are not offered so it is difficult to know if I replicating a working setup or not.
In Mananagement Studio I am awash in security, permissions, roles, and login selecitons. It seems clear that this is permission level problem but I have no idea on where to start trouble shooting.
see:
Diagnosing Problems in a Deployed 3-Tier LightSwitch Application
http://blogs.msdn.com/b/lightswitch/archive/2011/09/20/diagnosing-problems-in-a-deployed-lightswitch-application-eric-erhardt.aspx
How many string properties are in the table that you're displaying? Is there a large number of properties that don't need to be included in the search?
This forum post discusses the same issue as you're encountering: Search returns error "Unable to load data" with a Red X
Have you checked your connection string setup? I do have those issues back when I was using SQL Express on development and using SQL Server Enterprise as my target database server.

Sourcegear Vault: How do I get an automated list of checked out files?

Question:
How can I get a list of all checked out files per user in Sourcegear Vault?
Use of this functionality:
From time to time we have developers leaving files checked out and although this results in drastic punishment (they owe a coffee to the person who needed the checked out file) we are still left with files checked out and work held up.
We would like to display a list of all current number of files checked out by each developer. This way they can check if they have anything checked out before they go home or out the office.
In the Vault Client app, use the Search tab at the bottom of the window.
Select Search By: "Checked Out By" to see a list of all files checked out by a specific user, or by any user.
You can choose to search a specific sub-folder, or from the root, recursively or not.
To automate this, use the Vault Command-Line client (vault.exe)
vault -host myhost.mydomain -user something -password something -repository myrepo listcheckouts
Will give you a list, in XML, of all checked-out files and their users. You can transform the results, or use the command-line client's source code (provided as an example with the Vault .NET API) as a starting point to write your own version.
The various clients and APIs can be grabbed from http://sourcegear.com/vault/downloads.html - didn't want to link to a specific version that would be outdated after the next release.