DataVisualization Extension loading error - autodesk-forge

I am following the documentation, and when I try to load the DataViz extension,
const ext = await viewer.loadExtension("Autodesk.DataVisualization")
browser gives me this error:
Extension not found: Autodesk.DataVisualization. Has it been registered(1)?
Same error comes when I try to load it via NOP_VIEWER.
Extension works when I use DataViz reference app. So, I am assuming this has to be locally loaded into my project. I searched entire Reference App project but I couldn't locate the extension code.
Could someone assist me to solve this problem.
Thank you.
Bandu

Add in the viewer the Beta Reference:
<script
src="https://autodeskviewer.com/viewers/7.39.1/extensions/DataVisualization/DataVisualization.min.js"></script>

Related

Use Forge Viewer SceneBuilder Extension to report an error "addMesh()" is not a function

I saw a case of using SceneBuilder Extension on Forge COMMUNITY BLOG here.
But when I tried to implement this case, I ran into a trouble.
I loaded SimpleCustomGeometry Extension into my program. When I run the program, the following error occurred:
Unhandled Rejection (TypeError): _this2.modelBuilder.addMesh is not a function.
Can anyone help me? thank you very much!
Here are some of my operating environments:
The version of SceneBuilder Extension is LMV v7.3.0
The computer system used is Windows 10
The source code of the SimpleCustomGeometryExt doesn't seem to contain any _this2. Have you modified the extension code in any way? I have just tried loading the extension in a simple Forge app myself, and there are no issues.
Also, feel free to check out this blog post to get more details and code snippets related to the SceneBuilder extension: https://forge.autodesk.com/blog/custom-models-forge-viewer.

Forge Extension when deployed live is not loading due to uncaught Promise

I have an Autodek Forge Extension called HandleSelectionExtensionthat is conducting some server requests causing it to load slower than the ForgeViewer. The code is effectively a mirror of this tutorial https://learnforge.autodesk.io/#/viewer/extensions/selection
As a result, when hosted online the Extension fails to load giving the following error
ExtensionManager.js:234 Uncaught (in promise) Extension not found: HandleSelectionExtension. Has it been registered(1)?
Note that the Extension works fine when locally hosted. The extension also works if I load a separate page of the domain, such as https://sde4demo.herokuapp.com/data and then click the back button
Is there a way of allowing the extension to fully load before launching the viewer?
Live Demo Here: https://sde4demo.herokuapp.com/
Make sure the extension script is loaded (make sure it precedes your code block that depends on it) before you register the extension and only attempt to load the extension either through loadOptions or viewer.loadExtension after you registered the extension explicitly.
I've tried your live demo but didn't see any error or the extension being loaded?
Having the extension load before the viewer solves the problem
<script src="my-awesome-extension.js"></script>
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.min.js"></script>
Note that this is contradictory to the Forge API Guide which states that extensions must be defined after core viewer classes https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/viewer_basics/extensions/
<!-- THIS IS INCORRECT AND CAN CAUSE ASNYC LOADING ISSUES -->
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.min.js"></script>
<script src="my-awesome-extension.js"></script>

Cordova File Download and open it using cordova

Please forgive my ignorance, Any advice/directional assistance would be greatly appreciated.
I have a small app that reads data from an API with json requests.
One of the actions the app needs to do is to download a given PDF and open it either in the app, or in the OS default viewer.
I have followed several guides, but I think I am not including all needed files or something. The guides don't speak of including files of any type, but I still get errors.
In this link for example I followed the steps, but I am getting an error when I add these two lines in to the script at the bottom of the page:
var fileTransfer = new FileTransfer();
console.log(FileTransfer);
When running that I get the error Uncaught ReferenceError: FileTransfer is not defined at employee_documents.html:102
I am sure that either i am not including the files correctly in netbeans or I am missing something simple...
Any advise would be greatly appreciated.
To answer the question specifically. In order to solve the error, you need to run the cordova app using the CLI. In that way, the plugins installed from your cordova will be used otherwise if you're only running it via refresh or something similar it will produce an error like this.
In other words, type this command in your CLI:
cordova run browser
You can change this to your preferred platform (android, ios)

Getting exception "Unknown Error" after bundling the application(exe)

We are using the evaluation version of JXBrowser for some charting application. We wanted to showcase a demo to our client just to check the overall performance of charts with JXBrowser. But we encountered some unexpected issue while we were trying to build an "EXE".
The issue:
We created a build and the passed the URL from the classpath(webView.getBrowser().loadURL(getClass().getResource("/chartiq/stx-advanced.html").toExternalForm());); the build successfully generated and if we run the build we are getting exception "Unknown Error" but its working fine in the IDE(Eclipse).
Afterwards, we tried to host the html pages at some server and we were able to get the html rendered in the application.
Question:
1. Is the aforementioned issue related to evaluation version?
2. If above question is not the case, is there any fix for that? As we have crawled the web and find nothing related to this.
For the reference I attached the screen shot showing the full exception stacktrace.
Any help will be appreciated.
Thanks,
Nikhil
The reason of this issue is that JxBrowser doesn't support loading resources from JAR files. Chromium engine used in JxBrowser cannot load the /chartiq/stx-advanced.html file located inside JAR archive. You need to extract the file and load the extracted file.
FYI: we have already started working on the functionality that allows loading HTML files and other resources from JAR archives. An updated build with this functionality will be available in December.

Application Cache Error event: Manifest fetch failed (404)

I have a simple html website containing one css and js doc and some images. I need to make this work offline.I use html 5 offline cache for this purpose.
On deploying and browsing i see that the website doesnt cache.Console shows an error :
Application Cache Error event: Manifest fetch failed (404)
Following are the details :
Directory structure :
Manifest file :
Whats wrong?
The file name must be manifest.appcache ; it should not contain names of files other than images/javascript/css/html files. Any other types will result in error in fetching files.
The rule applied to offline caching is ~ 'catch all or none'.
If you are caching mobile data on iPhone, please check the filename since, according to Apple Docs it must be cache.manifest:
Storing Data on the Client
It's already 2019 and I had the very same error message =)
For me renaming the file as manifest.appcache made it work.
In any case, digging further about this error, I found the AppCache API is deprecated (I'm new to these APIs, since I started studying about PWA recently) and no longer recommended (Use CacheStorage + ServiceWorkers instead)
https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache
Hope this info can help others on the same path =)
Did you try example.manifest.php? instead of .txt?