<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Scripting control to Publishers]]></title><description><![CDATA[<p dir="auto">Hi, all<br />
I have a story to help. Scripting control to publishers. Want to write control scripts for publishers By enabling / disable the publisher<br />
such as<br />
1.Scripting control to Data sources.</p>
<pre><code>var d = 'DP_835f4865-3de8-47cc-9c7b-3121b7a65bf9'; //Change to your data source's XID
RuntimeManager.enableDataSource(d);
</code></pre>
<p dir="auto">2.Scripting control to Data point.</p>
<pre><code>var d = 'DP_835f4865-3de8-47cc-9c7b-3121b7a65bf9'; //Change to your data source's XID
RuntimeManager.enableDataPoint(d);
</code></pre>
<p dir="auto">I try to write like this and it is not available.</p>
<pre><code>var d = 'DP_835f4865-3de8-47cc-9c7b-3121b7a65bf9'; //Change to your data source's XID
RuntimeManager.enablePublishers(d);

error RuntimeManager.enablePublishers is not a function
</code></pre>
]]></description><link>https://forum.mango-os.com/topic/4067/scripting-control-to-publishers</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 09:45:44 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4067.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 17 Feb 2019 04:20:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Scripting control to Publishers on Mon, 18 Feb 2019 14:45:12 GMT]]></title><description><![CDATA[<p dir="auto">Hi JoHn-Beer,</p>
<p dir="auto">It does seem like those functions should exist for completeness. Currently there would be two ways to do this,</p>
<ol>
<li>Use the JsonEmport tool. You could export the publishers JSON, find the publisher you wished to toggle, change the 'enabled' property appropriately and reimport.</li>
<li>Go through the actual runtime manager, like</li>
</ol>
<pre><code>function enablePublisher(xid, enabled) {
  var publisher = com.serotonin.m2m2.db.dao.PublisherDao.getByXid(xid);
  publisher.enabled = enabled;
  com.serotonin.m2m2.Common.runtimeManager.savePublisher(publisher);
}
</code></pre>
<p dir="auto">And then call it as needed. I'll create a git issue about putting such a function into the script environments' RuntimeManager utility.</p>
]]></description><link>https://forum.mango-os.com/post/21374</link><guid isPermaLink="true">https://forum.mango-os.com/post/21374</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Mon, 18 Feb 2019 14:45:12 GMT</pubDate></item></channel></rss>