Include custom library in plugin?  

This sub-forum is for discussing and reporting bugs on any content that is not available by default in Panotour, so this concerns custom HTML templates, extra plugins (both Kolor-provided and third-party), etc...

Ce sous-forum a été créé pour discuter et/ou rapporter des bugs sur tout contenu qui n'est pas disponible par défaut dans Panotour, donc cela concerne les templates HTML customisés, plugins supplémentaires, etc...
no avatar
connor
New member
 
Topic author
Posts: 6
Likes: 0 post
Liked in: 1 post
Joined: Thu Oct 27, 2016 4:41 am
Info

Include custom library in plugin?

by connor » Tue Dec 20, 2016 1:10 am

Hi folks,
I'm trying to make a plugin that includes a custom library that I have built, but just once regardless of how many times it's requested in the plugin. I believe that I should be able to use either <depends> or <libraries>.

However, when I try to use either, it doesn't include my custom content.

My plugin folder structure looks like this:
Code: Select all
Documents -> PanotourPro 2 -> plugins ->
- plugin1
   - plug_info.xml
   - ...
- plugin2
   - plug_info.xml
   - ...
- plugin3
   - plug_info.xml
   - ...
- plugintoinclude
   - plugintemplatefile.tmpl


I've tried using the following kinds of requests:
Code: Select all
<depends>
    <template url="../plugintoinclude/plugintemplatefile.tmpl" />
</depends>

Code: Select all
<libraries>
    <file url="../plugintoinclude/plugintemplatefile" />
</libraries>

Code: Select all
<depends>
    <template url="../plugintoinclude/plugintemplatefile" />
</depends>

Code: Select all
<libraries>
    <file url="plugintemplatefile" />
</libraries>


Can anyone clarify the correct way to use this tag to import my own custom plugin? I've seen several uses of KOLORRES:, but given that mine is not part of the Kolor package, naturally that won't work.

For what it may be worth, I'm trying to add the same "<events>" and an "<action>" to each plugin, to ensure that it is included into the plugin if any plugin requires it. Is this where my problem may lie?

Thanks,
Connor

User avatar
360-compunics-com-ni
Member
 
Posts: 418
Likes: 15 posts
Liked in: 163 posts
Joined: Wed Dec 17, 2014 12:37 am
Location: León, Nicaragua
Info

Re: Include custom library in plugin?

by 360-compunics-com-ni » Tue Dec 20, 2016 6:35 am

Hi connor,

i don't know if this is a correct way of doing it, but the following setup works for me.
I'm not aware of any negative side-effects, maybe we get some clarification from the Kolor-team :)

plugins/YourPlugin/plug_info.xml:
Code: Select all
  <templates>
    <template url="template.tmpl" />
    <template url="include_template.tmpl" />
    <template url="includes/another_template.tmpl" />
  </templates>

actions/include_template.tmpl:
Code: Select all
<events name="Include_Events"  keep="true"
   onTourStart="showlog();"
   onnewpano="trace_new_pano(); call_another_action();"
/>
<action name="trace_new_pano">
   trace('msg from includefile, pano=', get(xml.scene) );
</action>

actions/includes/another_template.tmpl:
Code: Select all
<action name="call_another_action">
   trace('msg from 2nd includefile, group=', get(scene[get(xml.scene)].group) );
</action>

The trick is to put the "include_template.tmpl"-file into the "actions"-folder, not in any of the plugin-folders you may have.
There is no need to specify the correct path to the file, as the software looks into this directory anyway.

EDIT:
I just verified that this also works, maybe a good idea to document the use of a custom library:
plugins/YourPlugin/plug_info.xml:
Code: Select all
  <templates>
    <template url="template.tmpl" />
    <template url="include_template.tmpl" />
    <template url="LIBRARY:ServiciosCompunics:includes/another_template.tmpl" />
  </templates>
Out now: DeviceCheck for PTP plugins! https://www.kolor.com/forum/viewtopic.php?f=40&t=37446

Want to know how clients use your tours? Google Analytics Track Events plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=34442

Add actions to your hotspots: Hotspot Actionlist plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=35829

no avatar
connor
New member
 
Topic author
Posts: 6
Likes: 0 post
Liked in: 1 post
Joined: Thu Oct 27, 2016 4:41 am
Info

Re: Include custom library in plugin?

by connor » Wed Dec 21, 2016 12:11 am

Thanks for that 360-compunics-com-ni, that should help a lot.

Could you possibly provide some clarification in regards to how you built the title for the library URL?
How did you get the title `ServiciosCompunics` in there? Where is that used?

Cheers

User avatar
360-compunics-com-ni
Member
 
Posts: 418
Likes: 15 posts
Liked in: 163 posts
Joined: Wed Dec 17, 2014 12:37 am
Location: León, Nicaragua
Info

Re: Include custom library in plugin?

by 360-compunics-com-ni » Wed Dec 21, 2016 1:18 am

As far as i understand this, the library "title" is just a label, i did not use it in my plugin.. in other words, i just put it there to promote my business :/
Out now: DeviceCheck for PTP plugins! https://www.kolor.com/forum/viewtopic.php?f=40&t=37446

Want to know how clients use your tours? Google Analytics Track Events plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=34442

Add actions to your hotspots: Hotspot Actionlist plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=35829

no avatar
connor
New member
 
Topic author
Posts: 6
Likes: 0 post
Liked in: 1 post
Joined: Thu Oct 27, 2016 4:41 am
Info

Re: Include custom library in plugin?

by connor » Wed Dec 21, 2016 1:19 am

Ah, right. I've seen different labels around, like yours, and wasn't sure if it was encoded somewhere. Just so I know that I don't have to add it in somewhere. :)

Thanks!


Who is online

Users browsing this forum: No registered users and 1 guest