Perl objects declaration in MH and IA7

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Perl objects declaration in MH and IA7

Jeremy Huleux
Hello everyone !

I am a newbie in MisterHouse, and i am still discovering the project. It seems to be great, so i will start to give thanks to all contributors for their amazing work on this !!

(I am also a french people, so please, excuse me if my english is incorrect ... )

My problem is the following.
I have defined some classes that inherit Generic_Item in my Perl code. Every created object is able to exchange data with external hardware in mqtt. (The objects' states should reflect the hardware states).
The objects are created dynamically at startup (by calling "new MyClass"), according to some data stored in a database. This piece of code is enclosed between # noloop tags.
Everything is ok for this part, but now, i would like to display these objects in the IA7 web UI.
If i declare them using .mht files, they are directly integrated in the web interface, in the "Browse Items" section and all is ok. But by creating them directly in my code by calling "new MyClass", they are not.

I have been searching for a solution for some weeks.
I found the MH function :  &::store_object_data(), and tried to use it as follow :

# noloop = start
for each object found in database {
    my $module = new ZBA_Module(some arguments);
    &::store_object_data($module, "ZBA_Module", "some_web_name", "some_member_name");
}
# noloop = stop

The IA7 then creates a new section named "ZBA_Module", and this section is always empty (i got the message "no object found").
I understand this function stores the object in MH. The stored object are then restored (at least their states) at Startup/Reload. But i don't understand why the object is not displayed.
I think i just missed something on the subject....
Could anyone point me a direction to achieve it ?

I have also a last question that concerns the &::store_object_data() function.
What exactly are the two last arguments of the function (the web name and the member name) ? Are they used by the web UI to display informations ?

Thanks by advance
Jeremy

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: Perl objects declaration in MH and IA7

H Plato
Try this, take out the ‘my' and use the first column, so instead of

     my $module = new ZBA_Module();

use

$module = new ZBA_Module()

I haven’t run across &::store_object_data so I’m actually not sure what it does.

On May 10, 2016, at 4:35 PM, Jeremy Huleux <[hidden email]> wrote:

Hello everyone !

I am a newbie in MisterHouse, and i am still discovering the project. It seems to be great, so i will start to give thanks to all contributors for their amazing work on this !!

(I am also a french people, so please, excuse me if my english is incorrect ... )

My problem is the following.
I have defined some classes that inherit Generic_Item in my Perl code. Every created object is able to exchange data with external hardware in mqtt. (The objects' states should reflect the hardware states).
The objects are created dynamically at startup (by calling "new MyClass"), according to some data stored in a database. This piece of code is enclosed between # noloop tags.
Everything is ok for this part, but now, i would like to display these objects in the IA7 web UI.
If i declare them using .mht files, they are directly integrated in the web interface, in the "Browse Items" section and all is ok. But by creating them directly in my code by calling "new MyClass", they are not.

I have been searching for a solution for some weeks.
I found the MH function :  &::store_object_data(), and tried to use it as follow :

# noloop = start
for each object found in database {
    my $module = new ZBA_Module(some arguments);
    &::store_object_data($module, "ZBA_Module", "some_web_name", "some_member_name");
}
# noloop = stop

The IA7 then creates a new section named "ZBA_Module", and this section is always empty (i got the message "no object found").
I understand this function stores the object in MH. The stored object are then restored (at least their states) at Startup/Reload. But i don't understand why the object is not displayed.
I think i just missed something on the subject....
Could anyone point me a direction to achieve it ?

I have also a last question that concerns the &::store_object_data() function.
What exactly are the two last arguments of the function (the web name and the member name) ? Are they used by the web UI to display informations ?

Thanks by advance
Jeremy
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users



------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|

Re: Perl objects declaration in MH and IA7

Jeremy Huleux
Hi,
This works well ! Thank you very much H Plato :)


2016-05-11 1:06 GMT+02:00 H Plato <[hidden email]>:
Try this, take out the ‘my' and use the first column, so instead of

     my $module = new ZBA_Module();

use

$module = new ZBA_Module()

I haven’t run across &::store_object_data so I’m actually not sure what it does.

On May 10, 2016, at 4:35 PM, Jeremy Huleux <[hidden email]> wrote:

Hello everyone !

I am a newbie in MisterHouse, and i am still discovering the project. It seems to be great, so i will start to give thanks to all contributors for their amazing work on this !!

(I am also a french people, so please, excuse me if my english is incorrect ... )

My problem is the following.
I have defined some classes that inherit Generic_Item in my Perl code. Every created object is able to exchange data with external hardware in mqtt. (The objects' states should reflect the hardware states).
The objects are created dynamically at startup (by calling "new MyClass"), according to some data stored in a database. This piece of code is enclosed between # noloop tags.
Everything is ok for this part, but now, i would like to display these objects in the IA7 web UI.
If i declare them using .mht files, they are directly integrated in the web interface, in the "Browse Items" section and all is ok. But by creating them directly in my code by calling "new MyClass", they are not.

I have been searching for a solution for some weeks.
I found the MH function :  &::store_object_data(), and tried to use it as follow :

# noloop = start
for each object found in database {
    my $module = new ZBA_Module(some arguments);
    &::store_object_data($module, "ZBA_Module", "some_web_name", "some_member_name");
}
# noloop = stop

The IA7 then creates a new section named "ZBA_Module", and this section is always empty (i got the message "no object found").
I understand this function stores the object in MH. The stored object are then restored (at least their states) at Startup/Reload. But i don't understand why the object is not displayed.
I think i just missed something on the subject....
Could anyone point me a direction to achieve it ?

I have also a last question that concerns the &::store_object_data() function.
What exactly are the two last arguments of the function (the web name and the member name) ? Are they used by the web UI to display informations ?

Thanks by advance
Jeremy
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users




------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users