Cannot figure out how to use the OfficeExtension.Promise - es6-promise

Currently I am trying to use the OfficeExtension.Promise polyfill offered by Microsoft for developing Office Add-Ins. Unfortunately I am not able to get it to work thus far. From what I can tell these are only offered in the WordApi 1.2 and ExcelApi 1.2. Since I could not find separate node modules offering these api's I presume that these are included in the normal '#microsoft/office-js' node module. Additionally I have installed the office-js types as well.
Node modules
Import statements
So far I have tried importing the 'OfficeExtension' class/namespace in the following ways.
import {OfficeExtension} from '#microsoft/office-js'
import {OfficeExtension} from 'office-js'
import {OfficeExtension} from '#types/office-js'
Error
All of these result in an intellisense error stating that the module cannot be found.
Question
The concrete problem is that I do not know how to import the functionality in order to use the OfficeExtension.Promise polyfill. I could find no documentation that offers any help on this topic, so any advice or information would be greatly appreciated.

Unfortunately the error that is shown, actually states what is happening. 'office-js' does not export a module that can be used in a Typescript/React project. Office or OfficeExtension are global variables on the 'Window'. Therefore a /// tag or another script reference is needed, in order to import these variables.
Link

Related

Json Simple dependency Issue

So I have been trying to import JSON Simple (https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple/1.1.1)
I am also using Visual Studio Code. So I have added the dependency in my pom.xml file, but it still wont find my imports. Do I have to add soemthing to my module-info? (fixed a different issue for me) I tried requires com.json.simple; or requires com.googlecode.json.simple; but I get the cannot be resolved to a module error. Also my project is a javafx Application, that implements server socket networks (JSON exchage).
Im at a complete los here on what to do...
Thanks for your help.
So after a lot of trial and error, i have finally fixed it. Instead of vs code I used IntelliJ and added the dependencies there. Its impotant to note, that after every import I had to restart intelliJ also make sure to press the icon as mentioned in this tutorial https://www.jetbrains.com/help/idea/work-with-maven-dependencies.html#maven_import_dependency.

'refactor' move files in VSCode - es6

If I move ComponentFoo.js from folder X to folder Y, than a bunch of import statements break. Looking into this it seems there are many solutions for typescript, but what about js / es6? If I move a file in the editor, it should find all the import statements and update them to the new location. Is this possible?
Old post, but this might help some Googlers. This feature can be enabled and disabled in User Settings. For Javascript and Typescript, it's called "Updated Imports On File Move".
I had apparently disabled it and just figured the feature was broken :X
VS Code has built-in support for this for both javascript and typescript since VS Code 1.24.
For JavaScript specifically, you need to make sure VS code's language support can find all the references to the file so that imports referring symbols in that can be updated properly. Definitely create a jsconfig.json for your project, and also consider enabling semantic checking for JavaScript so that VS Code shows when imports are not being properly resolved
If your project is configured properly but files are not being updated, make sure you are running the latest VS Code insiders build and report an issue if it still doesn't work
for flutter developers you should move files one by one. vscode doesn't support multi file moving with refactor yet.
Just use IntelliJ. It handles all kinds of refactoring perfectly. I'm a huge fan of VS Code, but refacotoring is definetly not one of it's stengths. Some imports don't get detected, and the imports can get modified in a weird way. For example, I had an import like this:
import { myStore} from 'src/common/stores/myStore';
When moving the file of myStore.ts to a different folder, VS Code constructed this bull**it:
import { myStore} from 'src/common/composables/myStoreStore';
The line above is no typo!
Btw I'm using vetur, maybe thats causing it, I don't know ...

Using mysql JDBC in the OSGi framework

I have a huge problem with getting a connection to a Database within my OSGi Application. I searched for 3 days an couldn't find a good solution. Just not working and old stuff. I'm using Bndtools for creating my Bundles.
Can anyone please help I'am very desperate.
Thanks
The most probable cause of this error seems that the package of the class being used is not present in the Import-package directive of the bundle's manifest.mf.
In OSGi environment, each bundle has its own classloader. So, each class will be loaded only once during the application life span. Whenever a class is being used outside of a bundle, the package the class resides in needs to be present in the Export-package attribute of its jar's manifest.mf.
Any client bundle which requires this package/class, should add the entry in its Import-package attribute of its manifest.mf file.
If you are using maven, you can use maven-bundle-plugin. This plugin will take care of generating appropriate manifest import and export headers by scanning the dependencies present in your project's pom.xml.

Flare and ActionScript error

I am trying to compile this sample program but I am brand new to Flare and ActionScript. Here is the DependencyGraph example that I am trying to compile: http://flare.prefuse.org/apps/dependency_graph.
The error I am receiving right now is:
Access of unidentified property App
Are there certain packages or project files that I will need to import or add to the source code in order to fix this?
Looks like you need to grab this class as well:
http://flare.prefuse.org/src/flare.apps/src/flare/apps/App.as aside from that it looks like the imports are all coming from packages in flare and should be included in the flare swc file.
Edit
Okay so starting from scratch I was able to get Flex 3.4 SDK playing nicely with the flare demos:
Download zip http://sourceforge.net/projects/prefuse/files/flare/alpha-20090124/prefuse.flare-alpha-20090124.zip/download
extracted flare.apps to my desktop and build/flare.swc to my desktop
In FlashBuilder/Eclipse import a project (existing project) select the flare.apps folder on the desktop.
replace the existing library reference to bin/flare.swc with the one from the desktop. When I imported the project it had in the project properties->ActionScript Build Path I selected the bin/flare.swc entry it had and hit remove, then hit add swc and browsed for the one extracted to my desktop from the flare.zip.
Compile/Run
That all worked great with Flex 3.4 (Flare is out-dated if you haven't noticed). Upping my SDK to 4.6 I had to replace JSON (ambiguous due to a new one in the default package) with com.adobe.serialization.json.JSON. With Flex 3.4, did you see any errors relating to JSON? I don't have 3.4 on my system so I am using 3.6 right now and see many errors regarding the ambiguity of JSON. With regard to 3.4 I had no JSON errors, think the Class may have been introduced around when 3.6 was put out so that makes sense too... the issue is if you import JSON from some package but then it also has JSON in the default package, it doesn't know which one you want to use, if you use the fully qualified class name wherever you were using the shortened version it will remove the ambiguity so where you had JSON.decode just replace with com.adobe.serialization.json.JSON.decode, believe the one in the default package is the new one and doesn't match up to the old one's interface (method names) 100%.
After building with 4.6 it's a mixed bag... I see the loading bar and all the lines between dependencies but not seeing the labels themselves, my guess is something to do with the change in the font/text rendering engine between versions is making a difference though I'm not sure immediately how to resolve that. No errors compiling/running though.
Edit 2 good deal just had to add this to the font embed for it to work in 4.6
,embedAsCFF='false'
[Embed(source="verdana.TTF", fontName="VerdanaCust",embedAsCFF='false')]
Let me know if you try out these steps and still have issues, or if this helps you resolve your problems.
Edit 3
Also added you on my gmail alternatively can chat on SO directly to keep any relevant information connected to this QA

Flex, ActionScript - StringUtil

I am trying to edit an already existing Flex project, and I see a warning on the line
"import com.Adobe.utils.StringUtil;" and the warning it shows is
Multiple markers at this line:
-mx
-The import utils could not be found.
-The import StringUtil could not be found.
so what could be the problem?
Well I was wondering what is the difference between import com.Adobe.utils.StringUtil; and import mx.utils.StringUtil;
com.adobe.utils.StringUtil and mx.utils.StringUtil are different classes. From the manual of mx.utils.StringUtil:
The StringUtil utility class is an all-static class with methods for working with String objects within Flex.
Mark that within Flex part.
And com.adobe.utils.StringUtil is part of Adobe's as3corelib which is a pure AS3 library and offers different methods. You need to add the as3corelib's StringUtil to remove the warning.
com.adobe.utils.StringUtil is from the as3corelib -- https://github.com/mikechambers/as3corelib
If this is not included in your project, then flex can't find it. You can either include it or change all imports to use the mx path. However, there might be a specific reason the as3corelib was included in the old project, so be aware of that.