Git Product home page Git Product logo

bimserver-javascript-api's People

Contributors

aothms avatar bastienmenis avatar giacomomanzoli avatar hlg avatar rubendel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bimserver-javascript-api's Issues

Bypass Websockets

Hi,
Is there equivalent for downloadViaWebsocket ?
Our server forbidden web sockets and I'm trying to bypass it by regular ajax call

Thanks
Dror

Convert to ES2015

I have forked the code and converted it to and ES2015 module. In addition to modernising the code, it should help with compatibility with NodeJS (see #7)

https://github.com/bastienmenis/BIMserver-JavaScript-API

@rubendel I am happy to create a pull request but can you review this first? I did not understand how you manage the version numbers, I had to replace '%VERSION%' with a number so that the package.json could be parsed.

I used rollup/babel for bundling as an UMD module. The UMD module has been tested with bimSurfer. The ES2015 module has been tested in an Angular app with Rollup as bundler (it should also work with Webpack)

Model.load missing query param

I've tried to use the Model but i've notice that if i call the load method:

const poid = project.oid;
const roid = project.lastRevisionId;
const schema = project.schema;

return new Promise((resolve, reject) => {
     client.getModel(poid, roid, schema, true, (loadedModel) => { 
          console.log("Model loaded!");                   
          resolve(loadedModel) 
     },'Test');
});

my callback functions doesn't get called and the BIMServer (v1.5.124) logs this error

18:27:19 ERROR [qtp1492822331-42]: Missing parameter: download -> query        

and looking at the source the param is missing. What should be the effect of the load method? To execute a standard pre-load query or it should take the query as a parameter?

othis.bimServerApi.call("ServiceInterface", "download", {
roids: [othis.roid],
serializerOid: serializer.oid,
sync: false
}, function (topicId) {

Module cannot be used in Node.js

The use of the window variable is not compatible with use in Node.js, e.g. complains

`/Users/marcgille/git/BIMsurfer/node_modules/bimserverapi/js/bimserverclient.js:20
if (typeof window.BimServerApiWebSocket == "undefined") {
^

ReferenceError: window is not defined
`

I would happy to help tweak the code towards state where it can be loaded into Node.js and also as a (browserified) browser version.

Let me know whether you are interested.

file is not defined

The bimserverclient.js has a bug at line 849,

file.type = schema.contentType;

There is no file variable defined in the scope.

Missing /bimserverapi.js after npm run build

After trying to build the javascript, i only got two files in build:
build/bimserverapi.umd.js
build/bimserverapi.umd.js.map

How do i get the needed build/bimserverapi.js to use for static import?

The combined minified library link on README is also broken.

How to get all the elements given the project oid and the element type oid

Hi,
not really an issue here, but I can't get this piece of code returning correctly the toReturn array, so I'm here to ask for help.

Let's say I want to get all the ifcwalls in a project with a particular ifcwalltype via javascript api.
I would like to know if there is a better way than my solution to archieve this and how can I get the
toReturn array back to the calling method, because now, probably due to timing issues, sometimes is empty, no matter how I return back the data.

var BimServerGetElementsWithType = function(projectid,typeoid) { //project oid, ifcwalltype oid
      var toReturn = new Array();

      Global.bimServerApi.call("Bimsie1ServiceInterface", "getProjectByPoid", {poid: projectid}, function(project) {
        Global.bimServerApi.call("Bimsie1LowLevelInterface", "getDataObjectByOid", {roid: project.lastRevisionId, oid: typeoid},
        function(data) {
          data.values.forEach(function(value){
            if (value.__type == "SListDataValue" && value.fieldName =="ObjectTypeOf") {
              value.values.forEach(function(listItem, index) {
                if (listItem.__type == "SReferenceDataValue" && listItem.typeName == "IfcRelDefinesByType") {

                  Global.bimServerApi.call("Bimsie1LowLevelInterface", "getDataObjectByOid", {roid: project.lastRevisionId, oid: listItem.oid},
                    function(data) {
                      data.values.forEach(function(value){
                        if (value.__type == "SListDataValue") {
                          value.values.forEach(function(listItem, index){
                            if (listItem.__type == "SReferenceDataValue") {

                              Global.bimServerApi.call("Bimsie1LowLevelInterface", "getDataObjectByOid", {roid: project.lastRevisionId, oid: listItem.oid},
                              function(data){
                                toReturn.push(data); // push all the walls with type "typeoid" into the array.
                              });
                            };
                          });
                        };
                      });
                    });
                  }
              });
            }
          });
        });
      });
    };

TIA for your time.

short build documentation

I would really like to test the typescript branch with different JS sources.
How to build a bimserver jar plugin out of this API?

Is there a short documentation or wiki pages available?

Websockets not working over mobile networks and on mobile browser

App is working perfectly fine on desktop, login OK, displaying projects Ok etc...
when I switch to an android device (not tested on IPhone), as soon as i click login button, login successful then websocket disconnects.

console_android
network_android

The interesting thing is that when i use wifi, everything works correctly on android, EVEN IF the wifi is provided by another mobile phone (portable hotspot).

Any idea on why this is happening and how to debug ?

Thanks !

Cannot read property 'isDone' of undefined

Hello,
I am having an issue with my installation of the BIMserver. it load ups just fine and allows me to check-in and ifc file. however when i go to view the model nothing appears. and when clicking on the head[1] of the tree i get the following error[2].
[1]
image

[2]
image

I have the following run configuration with all plugins installed and being loaded successfully.
image

ifc2x3tc1.js inverse not set properly ?

Hello

I was checking an object on BimView and I saw on my object a fields is set as an inverse but it isn't on buildingsmart-tech.org (cf screenshot)
Maybe it's a mistake ?
This file seems to have some other inconsistencies with the documentation provided by BuildingSmart I can point them out if you wish
best regards

Capture

Trying to connect with bimserver 1.5.53 with javascript-api newest version

Im trying to connect with my bimserver on my local computer. But is is not working. it says:
scenejs.js:42 GET http://localhost:8082/js/bimserverapi_BimServerApi.js?bust=0.0.23 404 (Not Found)

function connect(server, email, password) {
        var serveraddres = "http://localhost:8082";
        requirejs.config({
            baseUrl: serveraddres + "/js", // address should be the address of your bimserver, including optional port
            urlArgs: "bust=" + "0.0.23" // the version you use here will be used for caching
        });
        requirejs(["bimserverapi_BimServerApi", "bimserverapi_BimServerApiPromise"], function(BimServerApi, BimServerApiPromise) {
            if (address.endsWith("/")) {
                address = address.substring(0, address.length - 1);
            }
            if (BimServerApi != null) {
                var bimServerApi = new BimServerApi(address, notifier);
                bimServerApi.init(function(){// This function gets called on success, you can use bimServerApi now
                    o.bimServerApi = bimServerApi;
                    o.bimServerApi.login("email", "password", false, function(){
                        $(dialog).dialog('close');
                        o.viewer = new BIMSURFER.Viewer(o.bimServerApi, 'viewport');
                        resize();
                        o.viewer.loadScene(function(){
                            var clickSelect = o.viewer.getControl("BIMSURFER.Control.ClickSelect");
                            clickSelect.activate();
                            clickSelect.events.register('select', o.nodeSelected);
                            clickSelect.events.register('unselect', o.nodeUnselected);
                        });

                        showSelectProject();
                    });
                });
            } else {
                console.log("something went wrong with bimserverapi");
            }
        }, function (err) {
            console.log("can not connect ",err);

        });
    }

%Version% not defined in package.json

When I install the project by npm install, I have this error:

npm WARN Invalid version: "%VERSION%"

And I check the package.json, the vesion key has value "%Version%". I don't know which version it should be, so I didn't give a pull request.

build error

I had several problems with the command "npm run build", to solve them, I had:

  • to define a version number in the package.json (see #6)
  • to install rollup-plugin-json module
  • to suppress '{' in the import commands of rollup.config.js

"Version" 11 instead of 10, Unimplemented version error

Hello,
we have error while loading projects into browser using javascript API.
We have an "Unimplemented version" error.
Looking at the BimServerGeometryLoader.js code looks like :
(line 205)

            if (BIMSERVER_VERSION == "1.4") {
	            if (version != 4 && version != 5 && version != 6) {
	                console.error("Unimplemented version");
	                return false;
	            }
            } else {
	            if (version != 10) {
	                console.error("Unimplemented version");
	                return false;
	            }
            }

Unfortunately, I did not found what this "version" is about.
In our case, its value is 11 instead of 10.
We use apache-tomcat-8.5.16, jdk1.8.0_131, and bimserverwar-1.5.85.war.
It use to work fine on one Win2012 server, but on many other PCs (mostly Win7), we have this issue.
We could not figure out where does this come from. Would you please let us know what is it about ?
Regards,
Chris .

Model.load(..) fails if called with deep=true

Hi,

i've noticed that Model.load doesn't call the callback if called with deep=true.
i.e.:

const client = new bimserverapi.BimServerClient(SERVER_ADDRESS);
// ...
client.getModel(
                poid,
                roid,
                schema,
                true, // deep
                loadedModel => {
                    console.log("Model loaded!");
                },
                "TestModel"
            );

this is due to the missing query param in the download call:

othis.bimServerApi.call("ServiceInterface", "download", {
roids: [othis.roid],
serializerOid: serializer.oid,
sync: false
}, function (topicId) {

This is also confirmed by the BIMServer, which logs

12:06:45 ERROR [qtp669700766-34]: Missing parameter: download -> query      

when the above code is executed

Creating or modifying objects

There is a function called create in the Model class. It is not working at the moment because the generateGuid parameter is missing. I fixed this but I fail to understand what the function is supposed to do.

After calling create() followed by commit(), it looks like it does create an object but not the properties. Is this on purpose, or was this functionality never fully implemented?

I had a look at the LowLevelInterface in BIMServer, are the following steps the correct process to create objects?

  • startTransaction
  • createObject
  • iterate through properties and call addStringAttribute / addIntegerAttribute / etc.
  • commitTransaction

Safari - Can't find variable: require in bimserverclient.js

Hi, I am setting up a complete DEV environment for BIMserver+API+bimvie+BIMsurfer as explained in the great youtube video but on Mac OS.

BIMserver alone is working just fine in my DEV environment, but as soon as I try to add other projects to Eclipse, I am stuck with "Loading BIMviews..." on screen when trying to open bimvie using Safari.

I was stuck during a while before figuring out that this issue does not appear with Chrome on my Mac.
This must to be linked to Module resolution or loading.

Is there a way to fix this so that we can develop using Safari instead of Chrome on my Mac ?

Same issue also appear if I try to connect using Safari (iOS) or Chrome (Android).
Is there a way to fix this so that we can test the DEV environment directly from mobile devices (iOS/Android) ?

I am starting from GIT Labels:

  • BIMserver : 1.5.65
  • BIMserver-JavaScript-API : 0.0.108
  • bimvie.ws : 0.0.70
  • BIMsurfer : 0.0.31

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.