{"id":23974640,"url":"https://github.com/hal/dmr.js","last_synced_at":"2025-06-10T13:05:02.822Z","repository":{"id":7909561,"uuid":"9292496","full_name":"hal/dmr.js","owner":"hal","description":"DMR in plain JS","archived":false,"fork":false,"pushed_at":"2013-08-08T06:24:58.000Z","size":164,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-24T16:39:28.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-08T09:03:19.000Z","updated_at":"2016-01-24T16:18:52.000Z","dependencies_parsed_at":"2022-09-08T14:12:43.422Z","dependency_job_id":null,"html_url":"https://github.com/hal/dmr.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hal%2Fdmr.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hal%2Fdmr.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hal%2Fdmr.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hal%2Fdmr.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hal","download_url":"https://codeload.github.com/hal/dmr.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hal%2Fdmr.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259080991,"owners_count":22802399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-07T05:47:59.039Z","updated_at":"2025-06-10T13:05:02.784Z","avatar_url":"https://github.com/hal.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# dmr.js\n\nJavaScript library to execute operations on the JBoss AS7 DMR API.\nFor an introduction to DMR please refer to the [JBoss Wiki](https://docs.jboss.org/author/display/AS7/Detyped+management+and+the+jboss-dmr+library)\n\n## Prerequistes\n\n- node.js\n- npm\n- maven\n- JDK 7\n\n## General Usage\n\n### Import the dmr.js library\n\n```\n\u003chtml\u003e\n\u003cscript type=\"text/javascript\" language=\"javascript\" src=\"dmr.js/dmr.js.nocache.js\"\u003e\u003c/script\u003e\n[...]\n\u003c/html\u003e\n```\n\n### DMR Invocation from JavaScript\n\n```javascript\n\n\u003cscript\u003e\n// access EC2 demo instance\nhttp = new XMLHttpRequest();\nhttp.withCredentials = true;\nhttp.open(\"POST\", \"http://as7-preview.dyndns.org:9990/management\", true);\n\n// async response handler\nhttp.onreadystatechange =function()\n{\n    if (http.readyState==4 \u0026\u0026 http.status==200)\n    {\n        // decode response\n        response = dmr.ModelNode.fromBase64(http.responseText);\n        alert(response.get(\"result\").asString());\n    }\n}\n\n// content type headers for DMR API\nhttp.setRequestHeader(\"Content-type\",\"application/dmr-encoded\");\nhttp.setRequestHeader(\"Accept\",\"application/dmr-encoded\");\n\n// create an operation\nop = new dmr.ModelNode();\nop.get(\"operation\").set(\"read-attribute\");\nop.get(\"address\").setEmptyList();\nop.get(\"name\").set(\"release-version\");\n\n// send as base64 encoded\nhttp.send(op.toBase64String());\n\n\u003c/script\u003e\n```\n\n## Running the demo\n\n```\ncd scripts\nnpm install\n```\n\n### Build the JS module\n\n```\nmvn clean install\n```\n\n### Serve the files\n\n```\nnode scripts/server.js\n```\n\n### Point your browser to\n\n[http://localhost:9000/App.html](http://localhost:9000/App.html)\n\n\n## Known Issues\n\n### CORS Problems\n\n- It requires a patched AS7 instance if not running on the same host.\n- Some browsers require extra steps to get the authentication working, but Firefox should work out of the box.\n\nFor a good summary of all the challenges see [Harald's Post](http://hpehl.info/independent-jboss-admin-console.html)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhal%2Fdmr.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhal%2Fdmr.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhal%2Fdmr.js/lists"}