@phildunlap In that case, could you elaborate a bit more on what I do have to add to the vanilla module in order to get a drop down box or a text field and such?
Posts made by jwang
-
RE: Basic Module Development Questions
-
RE: Basic Module Development Questions
@terrypacker Thanks, that fixed it for me!
Also, from what I understand so far, modules are defined by the features in this folder: https://github.com/infiniteautomation/ma-core-public/tree/main/Core/src/com/serotonin/m2m2/module. How can I add these features to that vanilla module? Is there a package I have to put them in, or are there dependencies I need to change in the pom file, ect? For example, say I wanted to use the Script Source Definition (I believe this gives the black scripting box like in the scripting data source, but correct me if I'm wrong!). How would I add that particular element to the vanilla module?
To add some context, the end goal of this module I'm building is essentially a more refined version of the HTTP Retriever data source, dedicated to only a specific site with a specific API protocol. I want to be able to add/select certain parameters for an HTTP GET request (likely as a drop down box of some sort), and then automatically parse the resulting JSON file.
-
RE: Basic Module Development Questions
@terrypacker It seems like both of these pom.xml files have the same issue where I'm getting an error that says "Could not find artifact com.infiniteautomation.mango:mango-api:jar:3.6.0-SNAPSHOT in ias-snapshots (https://maven.mangoautomation.net/repository/ias-snapshot/)."
I've added in the snippet of code into the project and ran it as a Maven build. Is there something else I should be doing to fix this? -
RE: Issue with HTTPBuilder
@phildunlap
Hi Phil,I tried printing out the headers and the content in the error function, and the header says "Server=nginx/1.14.0" while the content says '"message":"Not found: 400 Bad Request: The browser' so it doesn't look like there's any content at all.
I also encoded the parameters into the URL itself so that I could see the actual page that would result if we copy and paste the link into the browser: http://api-dev.hiqsolar.net/api/v1/inverters/data?gw_serial=2589&start_date=2019-07-15&fields=kwh&group=period&res=10m&inv_serial=16675
There's clearly data on the page, even without the headers involved, so I'm still not sure why the HTTP Builder isn't picking up that data from the URL. I've also tried Jared's recommendation by adding "Accept: application/json" as a header and that hasn't fixed it either. Do you happen to have any other ideas?
-
Issue with HTTPBuilder
Hi, I'm currently trying to use the HttpBuilder in the scripting data source to get some data in JSON format, but I'm getting the error "Request got bad response: 400 in at line 35 at column number 8." I've tested the exact same URL and headers in Postman and had no problem retrieving the data, so I'm not quite sure what's going wrong here. This is what I've done so far: [phil removed image]
-
RE: Basic Module Development Questions
@Jared-Wiltshire Hey Jared, thanks for sharing the link. I think I got my settings.xml file in order now! Do you know how would I go about modifying the pom.xml file? So far I've copied the folder for the Virtual Data Source to use as a base, so what parts of the pom file would I have to modify? What are my next steps here?
-
Basic Module Development Questions
Hi, I have some questions about how to build a module. So far, I've downloaded Eclipse for Java EE Developers and JDK. I've also cloned the git repositories from https://github.com/infiniteautomation/ma-modules-public and https://github.com/infiniteautomation/ma-core-public. I've been going into the Virtual Data Source folder and right clicking on the pox.xml file, and running it as Maven build. From what I understand, I'm supposed to configure the settings by linking the settings.xml file, but I don't see the file in the Virtual Data Source folder. There's also errors in the other folders that I've cloned. I'm a little confused on where to go from here.