How to activate Unique Constraint on the RavenDB serverside? - ravendb

I'm using version 3.5 and read the documentation here https://ravendb.net/docs/article-page/3.5/Csharp/server/bundles/unique-constraints#installation on how to install/activate it on the serverside.
But i dont understand any single step in this...
"Drop the Raven.Bundles.UniqueConstraints assembly in the Plugins directory". Where is the assembly and plugins directory?
"simply add Unique Constraints to Raven/ActiveBundles configuration in the global configuration file". Is it a string or what is it? And where is the global configuration file?
"or setup a new database with the unique constraints bundle turned on using API or the Studio". When i create a new database, it doesn't give me any option to turn on the unique constraints bundle, but it gives me options such as encryptions, replication etc...
Hope someone can help me out on this :-)
Thanks in advance!

Where is the plugins directory?
The docs on plugins shows that it's under ~/Plugins by default. That is, it should be a root folder under the RavenDB server directory. So, wherever you installed Raven server, you should create a Plugins directory under that.
Here's my working example:
it doesn't give me any option to turn on the unique constraints bundle
Put Raven.Bundles.UniqueConstraints.dll inside the Plugins folder. Restart your Raven server. Then, load up the Studio, and you'll see the option for Unique Constraints:

Related

Rapidoid custom config file is ignored

I'm very new to Rapidoid and I'm experiencing problem with initial configuration of the application. I'm using Rapidoid 5.5.5 with following Rapidoid modules defined in pom:
rapidoid-commons
rapidoid-http-server
rapidoid-web
Java 11 is used to run the application.
I've prepared a custom config-develop.yml file where I've changed value for port to use from default 8080 to 18888 and added some menu items in gui: section however when I start application none of my changes were used: generated log does not have any data about accepting/use of parameters from my file and configuration files are the files that are included into rapidoid-commons Maven artefact.
Also, the log shows that classpath used is limited to /target/classes folder (I'm using Maven as build tool). So, these are my questions:
What are the rules for merging configuration information when multiple config-*.yml files are present in search path?
How I can tell Rapidoid to ignore some configuration files?
Is it possible to specify explicit name for configuration file as part of initialisation process?
I'm happy to provide additional information if this will help to find an answer to the questions above.
With best regards,
Nick

How can I get to the root folder of another project in a .NET Core solution?

I need to read the settings file (appsettings.json) from another project in my solution. When I use:
Directory.GetCurrentDirectory()
From within the current project, I get the following path:
{projectRootFolder}\bin\Debug\netcoreapp3.0\
My question is: How can I get to the exact same folder in another project in the same solution? Or is there a better way to access the settings file from another project within the current solution?
If I understand the problem correctly there are two misconceptions:
It has little sense to access output directory of an another project as the structure has sense in compile time only. You will not have the same structure in run-time once the application is "published".
The Directory.GetCurrentDirectory() returns the current working directory. It is just a coincidence to be set to project output directory by Visual Studio. It can be totally different directory.
It is not clear to me what exactly you are trying to achieve. I recommend using the configuration system provided by .net core to access the configuration and add that other appsettings.json as another configuration provider.
If you really need to open the settings file then the project with the settings file (A) should mark the file as "Copy to Output Directory" and the project to open the file (B) should reference the project A. So the settings file will be copied to output of the project A too.
What you're attempting to do is not possible. There's no inherent way for ASP.NET Core to know where a totally different app running in a totally different process is located.
If you need to access appsettings.json from another project, then you would need to include it as a linked file in your project, and set it to copy to output. Then, you're accessing it actually from your project (which is all you can do), but the file itself is shared.
However, this is almost always a bad idea, and usually a sign that you're doing something wrong. If you truly do need to share the settings, then what you should be doing is putting them in a distributed config provider like Azure Key Vault or similar, where both projects can independently access the settings from a common store.

Xtext and update project created by wizard

Create a new DSL with Xtext a project with the prefix repository.
Does this project create an update site for the plug-in?
If it is the case must the project be configure and how is it deployed?
The answer is:
Yes it creates a repo.
No there is no config needed unless you want to change contents. Then update category.xml
There is no deployment. You can e.g. upload the (unpacked) zip on a webserver or send it to your users via a file server
(Could you give some more hints why you are asking)

How to get RavenDB to recognize a plugin?

I'm trying setup the Versioning bundle in RavenDB: http://ravendb.net/bundles/versioning
The installation instructions are pretty straight forward:
Simply place the Raven.Bundles.Versioning.dll in the Plugins
directory.
I've tried this do this by creating a "Plugins" directory under the Server directory (the Server directory contains the Raven.Server.exe), and dropping Raven.Client.Versioning.dll into that Plugins directory.
However, when I run RavenDB after that (either from the command line or as a service), it doesn't give me any indication that it has recognized the plugin, and when I save/edit new documents no versioning is being applied.
I've tried running with the default plugin directory settings (which supposedly automatically looks in the Plugins directory), and I've tried manually adding the PluginsDirectory setting to Raven.Server.exe.config, to no avail.
Has anyone been able to get plugins working, specifically the versioning bundle? Do you hae to do anything special?
Mike,
It is supposed to just work. Take a look at the statistics, you should see the versioning trigger registered there.
It is important to ensure that:
You are using the same version of the dlls
You restarts RavenDB after copying the directory
You don't reference another Raven/PluginsDirectory in the configuration
It is probably better to follow this up in the mailing list.
For Raven v2, you'll also add the bundle name to the the Raven/ActiveBundles property on a database document. The names should be semicolon-delimited.
For example, I have a database called MidwestAnimalRescue. To enable the Periodic Backup bundle and the Versioning bundle, my document will look like this:

How to delete a 'dead' remote project in Eclipse

I have a remote project in Eclipse which was created through RSE's 'Create Remote Project' function. Now I changed hosting service and there's no option to connect to former host. When I try to delete this remote project Eclipse asks me for former host's login and password which if entered are not recognized anyway.
How can I delete the project?
Note: My workspace folder contains 'RemoteSystemsTempFiles' folder and there are no files related to this project there.
Finally found it. I did the following:
deleted relevant folder in workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/
relaunched Eclipse
the project was still there but Eclipse let me 'legally' delete it with right-click
The answer is to brows to workspace.metadata.plugins\org.eclipse.rse.core\profiles\PRF.${hostname}
Then delete the directory with the name H.${profilename}
You might check into the "workspace/.metadata/.plugins" directory to find the RSE plugin's data storage area. It will probably have an xml file or something with the reference to your project. Back it up and delete the reference. Hopefully this will remove it from your view.
Sorry I cannot be more specific, this is just a suggestion that I am not able to try explicitly.
Good luck, and like I said, back up the files you change... just in case.
With my Kepler setup, I found this subdir in workspace that had a folder for each domain. I rm'd the outdated ones
<workspace path>/RemoteSystemsTempFiles/ABC.DOMAIN.COM
The solution that works for me - hide the project:
Go to "Project Explorer > Customize view", and uncheck "RSE internal projects".