A few times there were requests to add data to the movie, episode or actors card that just aren't available on the Card. One Example: Add Actor Age to the Movie Card. Since it's not practical to add many new variables to a HTML Card, I had an idea to retrieve the data on demand (via javascript) for the HTML Cards.
This is the idea (I know this wouldn't be simple addition to XMM):
Add a very simply HTML (local) Server to XMM itself, that answers simple url requests with a very basic html page.
The very basic would be on configurable Port. This Port must be available on all HTML Cards in the program via for example the variable: _XMM_SERVERPORT_
With this javascript could connect via http://localhost:_XMM_SERVERPORT_/ to the server. Without any additional request page the server should simply identify himself. For the rest of the post I will use port 8085 as an example (http://localhost:8085/)
With for example a simple html page like this:
<html>
<head>
<title>XMM - Server</title>
</head>
<body>
<div>This is the XMM - Server.</div>
<version>7.2.1.2</version>
</body>
</html>
With this basic response javascript could test if the server is available and which version is running.
If a request cant be executed (http://localhost:8085/thiscantbeexecuted) a simple Error Page should be sent:
<html>
<head>
<title>XMM - Server (Error)</title>
</head>
<body>
<div>This was a Bad Request.</div>
<version>7.2.1.2</version>
</body>
</html>
Now to request itself. The basic schema are the following:
http://localhost:8085/movieid=12345&field=title
http://localhost:8085/actorid=12345&field=name
http://localhost:8085/episodeid=12345&field=title
http://localhost:8085/boxsetid=12345&field=title
A Example Response would be:
<html>
<head>
<title>XMM - Server</title>
</head>
<body>
<div id="title">Transformers: Dark of the Moon</div>
<version>7.2.1.2</version>
</body>
</html>
The reason to add the fieldname as a id in the div field is that there should be also the possibility to request multiple fields at once. Example:
http://localhost:8085/movieid=12345&field=title&field=year&field=covername&field=covercount
Response would be:
<html>
<head>
<title>XMM - Server</title>
</head>
<body>
<div id="title">Transformers: Dark of the Moon</div>
<div id="year">2011</div>
<div id="covername">C:/xmmdatabase/standard_cover/851-Transformers-3--2011-.jpg</div>
<div id="covercount">13</div>
<version>7.2.1.2</version>
</body>
</html>
Since with this simple html server javascript could request any information from database the would be many new possibilities to create HTML Cards. All request can be done in background and wouldn't decrease the loading speed of the html cards itself.
Of course there are even more possibilities to enhance this function in the future.