Genexus Extensions SDK - How to develop extensions for Genexus Server? - sdk

I'm trying to develop .NET Framework Extensions for Genexus Server to listen to basic events like:
Lock Events
Commit Events
Update Events
EDIT
I have tried pasting packages that derives from AbstractPackage and implements IGxPackageBL from Genexus SDK inside GXServerInstance/VDir/BinGenexus/Packages folder and listen to LockEvents using the EventSubscription with ServerEvents.BeforeLockObject but the package doesn't seen to be initialized with Genexus Server. This Class comes from Genexus.Server.Common.ddl.
Here is what I tried so far:
I created the project from the "Genexus Package Visual Studio Template":
Package.cs
AssemblyInfo.cs
The Extension doesn't seen to be loaded, here is what the https://mygxserver/v16/extensions.aspx shows:
The GXServer.log file doesn't seen to be logging any errors, and shows that the extension was actually loaded, despite not working...
How can I setup an extension for Genexus Server (16)?
What DLLs From the server can I use to implement functionalities to my extension?

GeneXus Server extensions are developed the same way as GeneXus extensions, and have to be installed in the path that you mentioned. The distinction here is that GXserver only loads BL extensions.
You can classify extensions in two ways:
UI extensions: These extensions are loaded only in GeneXus IDE, and can add user interface components, such as tool windows, toolbars, menus, commands, editors, etc.
BL extensions: These extensions are loaded whenever the business logic layer is loaded. This is, besides when running GeneXus IDE, it also includes when running MSBuild tasks, or when GXserver service is loaded.
These kind of extensions commonly:
Add new object types
Add new parts to objects
Add new properties to objects
Implement services defined in SDK or other shared assemblies
In order for an extension to be considered a BL extension, it must comply with the following:
The Package class must extend AbstractPackage and implement IGxPackageBL. eg:
public class Package : AbstractPackage, IGxPackageBL
I noticed in the image provided, that the implementation of IGxPackageBL is missing. This interface doesn't define any new members to the package beside those already inherited from AbstractPackage, but the package loader checks for it anyway.
Inform in the PackageAttribute that the package is NOT a UI extension. eg:
[assembly : PackageAttribute(typeof(Package), IsUIPackage = false)]
After making these changes, and copying the package assembly inside the VDir\BinGenexus\Package folder, you can navigate to the extensions page (eg: https://mygxserver/v16/extensions.aspx) in your browser, and you should see your extension loaded.
As for the binaries you can use, the GXserver SDK is a work in progress. In v17 we started distributing a new folder with the SDK named BinServer which includes the binaries we are comfortable making part of the SDK, which at the moment contians Genexus.Server.Common.dll and GeneXus.Server.ExternalTool.dll.

Related

Can't access Xilinix SDK 2019.1 application templates

Title explains most of it. When I create a new application project in Xilinx SDK 2019.1 and get to the templates window, the only two available options are 'Empty Application' and 'Opencv Example Application'.
When I look in the /tools/Xilinx/SDK/2019.1/data/embeddedsw directory (which is the default SDK installation repository listed ) I can find many more templates under lib/sw_apps. Directories such as hello_world, and in particular zynq_fsbl which I am looking to use, are in there.
I would like to know how I can actually use these templates and why they are not showing up when creating a new application project.
Apparently the Target Software language of the application project must be C to access these templates. I was trying to use C++.

Can we have an app share server(API) and client code (iOS/Android/Web) using Flutter/Dart?

Since Flutter already has taken a shared library approach for Android and iOS apps; is it possible to extend this idea to add server (API) code using Dart and web content using Angular-Dart? I can see examples of server and client code being shared, and can see Android and iOS code being shared (Flutter) - are there any examples where business logic is shared between iOS, Android, web and API code? Something similar to kotlin-multiplatform?
Just move your code in another Dart package that
does not depend (directly or transitive) on
dart:ui (Flutter)
dart:html or Angular (browser)
dart:io (server or console)
Everything that needs a dependency to one of these needs to be abstracted and then injected (passed as argument) when you use the platform-independent code on a specific platform.
You actually can share code between server and Flutter that depends on dart:io but such a dependency would prevent code being used in the browser.
See also
https://www.youtube.com/watch?v=PLHln7wHgPE
In a project I'm working on I have built_value model classes and built_redux (actions, reducers, state) in the shared package and use it in Flutter and Angular.
The main pain point was Firebase where the whole Firebase API needed to be abstracted because Angular and Flutter use different Firebase packages.
It wasn't too difficult, but cumbersome.
There are attempts to create a package that provide such an abstraction out of the box, but I don't know about the progress.

ImageJ: How to use third-party plugins API?

In Eclipse, I'm using the already packed ij.jar instead of the source code. I added the ij.jar file as an external jar in Eclipse. Every plugin shipped in the original ij.jar works fine after I imported from ij.
Currently, I'm trying to use functions in the third-party plugin StackReg. Does anyone know how I can import the classes inside StackReg? I've tried to add StackReg_.jar as an external jar. However, this does not work.
From quickly looking at the source of StackReg plugin, I see that the classes are in the default package. In java, importing classes from default package to a named package is not possible without using reflection.
Possible solutions are:
Put your classes in the default package. Then you can use the classes in the default package without importing them. Note that using default package is bad practice in java.
Use reflection: https://stackoverflow.com/a/561183/1903534
Alter the StackReg plugin to not use the default package. But this might not be compatible with its license and your solution will not be compatible with the original jar.

How to handle project specific components in Delphi?

Let's say we have a team that works on many different projects. Each team member uses different set of visual/non-visual controls/components during it's development cycle. Since Delphi requires each component to be compiled and installed globally in the IDE, how to manage this situation while working with project which was started by the other team member?
It would be great if I could checkout the sources of a project from the version control and have the ability to compile it immediately. I don't care or sometimes don't know what visual or non-visual components are required for this project, I guess they all should be included in the project sources.
Maybe there are some tools which could read main project file or directory and compile/install all the needed components on project loading (and uninstall them when project is closed)?
How do you handle this issue in Delphi?
In our company, we have the same problem.
We solve this by forcing everyone to have all necessary library paths added to their delphi ide.
We are using an additional sdk/framwork repository which containins all components/sdks/frameworks of everyone .
We keep a single text file, listing all libs with its version, install infos, etc.
Everyone checks their wanted libraries, so we do not have double libraries or different versions.
Since we all work under Windows and since Delphi keeps its paths and (afaik) installed-components informations in the registry, we extracted these informations.
We store for each used delphi version a .reg file within the sdk repository trunk.
So, if someone changes a framework, he updates the informations for everyone in the .reg files and commits it.
now, if someone wants to setup their dev-machine, they check-out the sdk, adds the e.g. xe2.reg informations to their registry, then check out the project and ... tada. compiling.
We have not tried to extract the "installed components" packages. thats on our to-do list.
An alternative would be to keep a batch file for building and installing all sdk packages at once. But i do not know if installing components via commandline is possible in delphi.
Something like the JEDI installer would be nice. The installer detects installed Delphi versions and builds & installs everything nicely.
A freely configurable version would be nice, so add all sdks -> install on each version.. perfect.
Anyone who wants to compile a given project must first install any components that project is using. There is no getting around that, unless the project directly includes the components source code and instantiates the components in code instead of using a DFM. AFAIK, there is no IDE tool that will automated component (un)installation on a per-project basis for you.
It's very wise to constraint which components and libraries that will be used by your team. If each member decide which component they will use, your final executable or packages will grow a lot and you can have some incompatibilities between libraries.
Besides, you can have extra costs buying and updating libraries that are very similar. Remember that each time Delphi is updated, you should buy new licences from most of that libraries.
So the best approach is:
ask which libraries each developer are using and discuss with them the real need of each one;
catalog those library required and install them on the machine that you will compile your final code;

How to create simple Wix setup project

We have a client/server application which includes a Windows Service and a Winform client tool. I've managed to create a Wix project in Visual Studio (2010, using the wix 3.5 toolset). I'm using the "harvest" feature on the references instead of specifying every file, because there are many library projects involved.
Problems I'm trying to figure out:
How to include referenced DLLs? Some are in the GAC, some are in a relative path within the workspace. I assume I could list each file explicitly but it seems like there should be a way for Wix to autodetect them.
How to install the service while "harvest" is enabled. All the examples I've seen require adding an explicit element with KeyPath=true. However this doesn't work with the harvest=true setting.
I realize that the harvest functionality might be a convenience which is not feasible when there are more complex things going on. Should I give up on harvesting and just try to specify each file explicitly?
Most of the examples I've seen on Wix have been just snippets of xml files. Is there anywhere I can find complete real-world examples of installing services other non-trivial setup features?
Use WixEdit. http://wixedit.sourceforge.net/
It's very easy to import an entire folder using it.
Also, check out the great WiX tutorial here: http://www.tramontana.co.hu/wix/
5.4 Services Rendered
Services can be installed and started automatically.
http://wix.tramontana.co.hu/tutorial/net-and-net/services-rendered
For even more information, check out more WiX documentation here: http://wixtoolset.org/documentation/manual

Resources