Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

  • 0 Votes
    8 Posts
    4k Views
    A
    This is the part that is new (mbus) Arne
  • Call to set event active when state is not active

    3
    0 Votes
    3 Posts
    2k Views
    M
    Hi Craig, Is this version 1.8.0? Can you turn on the submission of exception messages to Serotonin (in the settings page)? I've seen this message before, and have some instrumentation in the code to track down the cause.
  • Metadatasource rename update

    3
    0 Votes
    3 Posts
    3k Views
    M
    You need to refresh the page.
  • Supported Browser Firefox on Linux

    3
    0 Votes
    3 Posts
    3k Views
    M
    Sure
  • Error exporting new datasource

    17
    0 Votes
    17 Posts
    9k Views
    M
    I use axis because i know it better, and it has ANT support (which i couldn't find in less than 5 minutes for JAX). But if someone else is doing the work it doesn't matter to me.
  • Include openv4j in mango

    5
    0 Votes
    5 Posts
    4k Views
    M
    I can work with patches or real source. Doesn't much matter. Also, if you've added message_de properties please provide the en equivalents (because you don't want to trust my - i.e. Google's - de to en translations). Anytime is fine. Or are you asking when i'll get it done?
  • Alignment of Labels

    3
    0 Votes
    3 Posts
    3k Views
    M
    Because i like how it looks?
  • Save/Dirty improvements

    2
    0 Votes
    2 Posts
    2k Views
    A
    Hi, if I save a changed data point I will see the Message "Point details saved". So if I change something afterwards, the message will not vanish - this is at least irritating end error prone. Solution add a isDirty() on each page that the developer of that page can decide if the values are save in the database. Maybe I could give it a try for datapoints. Arne
  • Page load times and performance

    5
    0 Votes
    5 Posts
    4k Views
    M
    Oh, i also added audio and graphics to cached directories.
  • Import Errors

    7
    0 Votes
    7 Posts
    4k Views
    M
    Sweet. Thanks for the update.
  • How to report bugs?

    6
    0 Votes
    6 Posts
    3k Views
    A
    I have some projects hosted on sf - it is OK for me (they seem to offer git as well) But I have no problems with others .... Arne
  • Directory Structure

    6
    0 Votes
    6 Posts
    4k Views
    S
    Thank you very much!
  • Static rendering (without DWR) for mobile UI

    5
    0 Votes
    5 Posts
    4k Views
    M
    Please see http://mango.serotoninsoftware.com/forum/posts/list/0/207.page#947
  • IP Sensor Appliance

    8
    0 Votes
    8 Posts
    5k Views
    C
    I'd like to take on new projects and clients but i've got existing one to finish first! maverick will be better off with the mango master
  • Nullpointer in vmstat when exiting

    3
    0 Votes
    3 Posts
    2k Views
    M
    Hi Craig, I already have a fix for this in for the next version. I did this: while (true) { String line = in.readLine(); if (line == null) { if (terminated) break; else throw new IOException("no data"); } readParts(line.split("\\s+")); readError(); }
  • Usercomments in reports

    4
    0 Votes
    4 Posts
    3k Views
    C
    I have added the table: create table reportInstanceUserComments ( reportinstanceId int not null, typeId int not null, typeKey int not null, ts bigint not null, userid int not null, commentText varchar(1024) not null) alter table reportinstanceusercomments add constraint reportInstanceUserCommentsFk1 foreign key (reportInstanceId) references reportInstances(id) on delete cascade; And then in ReportDao.java, code to select comments from the userComments table and add to reportInstanceUserComments + //Insert the reportInstanceUserComments + if (instance.getIncludeUserComments() != ReportVO.USER_COMMENTS_NONE ) { + String ucSQL = "insert into reportInstanceUserComments "+ + " (reportInstanceId,typeId, typeKey, ts, userId, commentText)"+ + " select "+ instance.getId() +", uc.commentType, uc.typeKey, uc.ts, uc.userId, uc.commentText "+ + " from userComments uc "; + + + if (instance.isFromInception() && instance.isToNow()) + ejt.update(ucSQL, new Object[] {}); + else if (instance.isFromInception()) + ejt.update(ucSQL +" where uc.ts<? ", + new Object[] {instance.getReportEndTime()}); + else if (instance.isToNow()) + ejt.update(ucSQL +" where uc.ts>=? ", + new Object[] {instance.getReportStartTime()}); + else + ejt.update(ucSQL +" where uc.ts>=? and uc.ts<? ", + new Object[] {instance.getReportStartTime(), instance.getReportEndTime()}); + + ejt.update(ucSQL + " join reportInstanceData rid on uc.typeKey=rid.pointValueId where uc.commentType=" + UserComment.TYPE_POINT_VALUE); + ejt.update(ucSQL + " join reportInstanceEvents rie on uc.typeKey=rie.eventId where uc.commentType=" + UserComment.TYPE_EVENT); + + + } + // If the report had undefined start or end times, update them with values from the data. if (instance.isFromInception() || instance.isToNow()) { and then to select the comments from the reportInstanceUserComments table for inclusion when the report is being displayed: public List<EventInstance> getReportInstanceEvents(int instanceId) { - return query(EVENT_SELECT, new Object[] {instanceId}, new EventDao.EventInstanceRowMapper()); - } + List<EventInstance> results = query(EVENT_SELECT, new Object[] {instanceId}, new EventDao.EventInstanceRowMapper()); + attachEventRelationalInfo(results, instanceId); + return results; + } + + private void attachEventRelationalInfo(List<EventInstance> list, int instanceId) { + for (EventInstance e : list) + attachEventRelationalInfo(e, instanceId); + } + + private void attachEventRelationalInfo(EventInstance event, int instanceId) { + event.setEventComments(query( + ReportUserCommentRowMapper.USER_COMMENT_SELECT + + " and typeId=" + UserComment.TYPE_EVENT + + " and typeKey=?", new Object[] {instanceId, event.getId()}, new UserCommentRowMapper())); + } + + public List<ReportUserComment> getReportInstanceUserComments(int instanceId) { + return query( + ReportUserCommentRowMapper.USER_COMMENT_SELECT + + " order by ts asc", new Object[] {instanceId}, new ReportUserCommentRowMapper()); + } + + class ReportUserCommentRowMapper implements GenericRowMapper<ReportUserComment> { + public static final String USER_COMMENT_SELECT = + "select distinct uc.userId, u.username, uc.ts, uc.commentText, uc.typeId, uc.typeKey "+ + "from reportInstanceUserComments uc join users u on uc.userId = u.id "+ + "where reportInstanceId=? "; + + public ReportUserComment mapRow(ResultSet rs, int rowNum) throws SQLException { + ReportUserComment c = new ReportUserComment(); + c.setUserId(rs.getInt(1)); + c.setUsername(rs.getString(2)); + c.setTs(rs.getLong(3)); + c.setComment(rs.getString(4)); + c.setTypeId(rs.getInt(5)); + c.setTypeKey(rs.getInt(6)); + + if (c.getTypeId() == UserComment.TYPE_POINT) { + DataPointDao dpdao = new DataPointDao(); + DataPointVO dp = dpdao.getDataPoint(c.getTypeKey()); + c.setTarget(dp.getName()); + } + if (c.getTypeId() == UserComment.TYPE_EVENT) { + EventDao edao = new EventDao(); + EventInstance e = edao.getEventInstance(c.getTypeKey()); + LocalizableMessage message = e.getMessage(); + ResourceBundle bundle = Common.getBundle(); + String eventMessage = message.getLocalizedMessage(bundle); + c.setTarget(eventMessage); + } + + if (c.getTypeId() == UserComment.TYPE_CHAT) { + c.setTarget("User Log"); + } + + if (c.getTypeId() == UserComment.TYPE_POINT_VALUE) { + PointValueDao pvDao = new PointValueDao(); + PointValueTime pvt = pvDao.getPointValue(c.getTypeKey()); + DataPointVO pointVO = pvDao.getPointVO(c.getTypeKey()); + if (pointVO != null) { + String pointName = pointVO.getExtendedName(); + String renderedValue = pointVO.getTextRenderer().getText(pvt, TextRenderer.HINT_FULL); + c.setTarget(pointName + ": " + renderedValue + " at " + DateFunctions.getTime(pvt.getTime())); + } else { + c.setTarget(pvt.getValue().toString() + " at " +DateFunctions.getTime(pvt.getTime())); + } + } + return c; + } + } + and a class to represent comments in the report +public class ReportUserComment extends UserComment{ + + + private int typeId; + private int typeKey; + private String target; + + public int getTypeId() { + return typeId; + } + + public void setTypeId(int typeId) { + this.typeId = typeId; + } + + public int getTypeKey() { + return typeKey; + } + + public void setTypeKey(int typeKey) { + this.typeKey = typeKey; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + +} Seems to be working well enough, comments made in the chat, on events, on points, or on pointvalues are included in reports. The complete patch is http://216.235.5.146/apache2-default/reportscope-2009-09-20.zip
  • Custom data sources

    10
    0 Votes
    10 Posts
    11k Views
    M
    Possibly, at least for the Mango side of the code.
  • Noob question... API for polling values in the Mango database

    3
    0 Votes
    3 Posts
    2k Views
    M
    Hi Al, If your instance uses a MySQL database this is possible by having PHP access the database directly. You'll just need to know a bit about the database structure to correctly form your query. With derby - because it is a single-user database - you can't go direct. There is the HTTP data publisher, which sends data somewhere else, but you already know about that. There are also remote views, but they display values by manipulating the DOM with Javascript, so that likely won't work for you either. I'm assuming that you want to get these values into another system for some reason, rather than just having them display on a web page somewhere. Is that the case?
  • Updating dojo

    14
    0 Votes
    14 Posts
    8k Views
    C
    it's a pretty low priority for me as long as I can get the Dojo AOL CDN working properly. It is odd that the newest versions of dojo aren't on par for features with 0.4. I've only heard good things about jquery though.
  • Hosting static content seperately

    3
    0 Votes
    3 Posts
    2k Views
    M
    tag:img is used as a convenience where possible (although it was added after the fact so there may be possible uses where it isn't). I guess the right thing to do would be to add the static content prefix as an application context value (set in a property file) that would be inserted into URLs as necessary. This could be done for the audio, images, and resources directories. There are probably 500-600 code modifications to make. :shock: