How do I include the resources from a qooxdoo library - qooxdoo

I have created a custom library with resources. It is an editor component that uses the ace editor. So I created the library/app and it works fine. However, when I try to use it in another app by adding a "libraries" entry to the config.json file of the app, it doesn't include the ace files in the resources folder from the custom library. How do I get those files included?

I think you just need to add an #asset hint to your application class, pointing to an asset in the library.
So, for example, if your library's namespace is mycustomlib, you have to add #asset(mycustomlib/*) in your application class.

Related

How to create custom function in excel add-in using office JS in already existing react project

I am new to a custom function. I already have a react project. I want to use one custom function in that project. I have read the document about it. It has two options either you can create a react js project or you can create custom function project.
can anyone guide me on "how to create a custom function in react project"?
Yadav, here is one option:
Generate a new add-in project using the yo office "Excel Custom Functions using a Shared Runtime" template.
Compare the following files with what you already have in your add-in project to identify the changes you need to make to add custom functions to your project: manifest.xaml, package.json, webpack.config.js.
Copy new files that identified in step 2 from the project you made in step 1 to your add-in project.
Make the changes identified in step 2.
Office add-ins that combine two kind of features - custom functions and, for example, react web app are run all of its code in a single shared runtime. A shared runtime isn't a type of runtime. It refers to a browser-type runtime that's being shared by features of the add-in that would otherwise each have their own runtime. Specifically, you have the option of configuring the add-in's task pane and function commands to share a runtime. In an Excel add-in, you can configure custom functions to share the runtime of a task pane or function command or both. When you do this, the custom functions are running in a browser-type runtime, instead of a JavaScript-only runtime as it otherwise would.
See Configure your add-in to use a shared runtime for information about the benefits and limitations of sharing runtimes and instructions for configuring the add-in to use a shared runtime. In brief, the JavaScript-only runtime uses less memory and starts up faster, but has fewer features.

In a codenameone project - How can I get images programmatically from the project resources folder?

CodenameOne changed the project structure after the maven dependence manager passed to be used as the new standard for dependence management.
Now exists a new folder called resources at the same level as the java folder. (in project structure)
I put my images inside the /resources/images.
How can I get these images programmatically?
I tried some java common approaches without success.
Don't put the images in a folder under resources. Put them directly in common/src/main/resources then access them using /imagename.png as you always have.

Use of cn1libs in cn1libs?

Is it possible? I couldn't find anything concerning this in the documentation. When I try to refresh cn1libs (which I downloaded over the CN1 preferences) in my cn1lib project it is stated that it's not relevant for this kind of project, although I would like to write a utility library based on other cn1libs.
There is no official support for dependency hierarchies in cn1libs because we don't want to create a "dependency hell". However, the extension manager does allow you to declare dependencies and you can use other cn1libs.
If you have a cn1lib you need to use you can just add it to the build classpath of the cn1lib you are currently building. In NetBeans this can be done from the GUI but can be done in other IDE's via the netbeans properties file. You can then use the other cn1lib, just make sure to include both cn1libs in the user project or you will get a dynamic link error.
See this https://www.codenameone.com/blog/tip-nest-cn1libs-cross-dependencies.html

Add project references in Xamarin's Shared Project

I am using Xamarin to develop iOS and Android application.I have creates one shared project which is common for both platforms.
As I am using database its common and put in shared project.I need to encrypt database, so need to add native sqlite library reference in shared project so that I can modify that code.
My question is : I have not found any way to add reference of other project/library in shared project.
Is that bug or expected behavior?
Any explanations are appreciated.
Thanks.
There are no 'References' from the usual sense of adding a project reference from a Shared Project.
There is definitely scope for a Shared Project to be opened up further than it currently is, however its not, and this is by design, currently, although limiting in some ways.
In short, Shared Projects have no generated outputs. It is from other projects that reference the Shared Project(s) that compilable outputs are generated - based on any conditional compilation symbols that you may have specified.
In order for you to add sqlite library references you need to use NuGet in order to add packages to your solution.
These NuGet packages will then also install and create your platform specific library references appropriate for each platform you are targeting.
If you take a look on your platform specific projects, you will see the References treeview node expand when you add a NuGet package and install it into those projects with the library outputs appropriate for the package.
You can then code in the Shared Project against these NuGet packages that are referenced in your projects.
Update 1:-
If you've added the package from NuGet, most things should line-up perfectly in general unless there is any platform specific stuff included.
If there is functionality that is specific to a particular platform; or for a library that is only added directly to a platform-specific project, then you can use conditional #if statements in the Shared Project to access these platform-specific differences.
Update 2:-
Example:-
1) You have a Shared Project and Android, iOS and WindowsPhone platform-specific projects that reference this Shared Project.
2) Create another new WindowsPhone Class Library Project.
3) Add the following class to it:-
public class MyWindowsPhoneClass1
{
public string SayHello()
{
return "Hello";
}
}
4) In your WindowsPhone platform specific project, add a Reference (in this case it will be a Solution reference as it is part of the same solution) to the new WindowsPhone Class Library Project you created in Step 2.
5) Enter the following code into some function in the Shared Project:-
PhoneClassLibrary1.MyWindowsPhoneClass1 o;
o = new PhoneClassLibrary1.MyWindowsPhoneClass1();
string strResponse = o.SayHello();
and compile.
You will notice you will get compilation errors for iOS and Android, as PhoneClassLibrary1 could not be found.
However....
If you now change the code to:-
#if WINDOWS_PHONE
PhoneClassLibrary1.MyWindowsPhoneClass1 o;
o = new PhoneClassLibrary1.MyWindowsPhoneClass1();
string strResponse = o.SayHello();
#endif
You will see that your project now compiles on ALL 3 platforms due to the use of conditional #if statements.
There is no concept of adding reference to Shared Project in Xamarin.
Shared Project is just a centralised project to shared codebase (like Model and ViewModel) between multiple projects (Android and iOS projects).
Solution:
Add the reference to the Android / iOS project and it will be automatically be accessible from the Shared Project.
References and components are not supported by Shared Projects. So, if you have no platform-specific project, a Shared Project is of no use, as you won't be able to abstract any of the needed references and/or components for your applications.
A Shared Project depends on you referencing it on any other platform-specific project, so you'll be able to use all references and components this platform-specific project uses.
To reference the Shared Project on any platform-specific application, right click the References folder of that application and select Edit References..., select the tab Projects and check the box of your Shared Project. After that, you can use any reference of that application on you Shared Project.

Updating DotNetNuke image library

Have written simple file picker control for my dotnetnuke site, because the one that ships with dnn doesn't really do what I need. The file picker uses System.IO for collecting directory information and uploading files to the portals root and subfolders. These images can then be inserted where ever I need them. The problem is images uploaded in this manner don't seem appear appear in the file manager or image manager used by the html/text module.
Is there anyway I can register these files with dnn when I upload them so they will also appear in the html/text image manager?
What would be even better is if there is a way to use the image manager that is built in the html module, outside the module although am not looking to buy a pre-made module.
Any thoughts?
You would want to use the DNN API for uploading files.
As for using the built in Image Manager that you find in the HTML module, that is part of the Telerik Rad Editor. You might be able to dig through the source for the Rad Editor Provider and figure out how to include just that portion into an outside module, though that might technically require a valid Telerik license to do.

Resources