MarkLogic: Path fields with namespaces - field

My documents have a namespace and I want to create a path field.
How do I specify the namespace while creating a path field ?

The Database section in the Admin ui has a page called Path Namespaces which can be found right next to Path Range Indexes. You can define your prefixes there. See also this section in the Admin guide:
Defining Namespace Prefixes Used in Path Range Indexes and Fields
Alternatively, you can define namespaces at Group or App Server level.
HTH!

Related

How to get name (uri) of all model files in project

In validator I would like to get uri of all model files.
I can get name only of current file (e.g myDsl1.mydsl) but I would like to get uri of other files too (e.g myDsl2.mydsl, myDsl3.mydsl).
Can this be done in validator or I should create new classes/methods for seeing this files?
You can access the Xtext index IResourceDescriptions via IResourceDescriptionsProvider. You can ask IResourceDescriptions for getAllResourceDescriptions which you may have to filter for project.
to use std visibility meachinsm check out IContainer.Manager with getVisibleContainers/getContainer and IContainer.getResourceDescriptions´. Check out DefaultGlobalScopeProvider` for sample usage.

How can one access a resource via node UUID in Sightly/HTL?

As of HTL 1.4, it is possible to access a resource if you know its path by using data-sly-use, e.g.: data-sly-use.item="/content/my_nodes/node1"
However, if one does not have the path to the resource, but only the node's jcr:uuid (automatically generated through use of mix:referenceable), is there any way that one can look up the resource with a similar HTL statement?
There is no such convenience, at the moment. However, the HTL specification does not exclude this and you should be able to write your own UseProvider implementation. You can have a look at the ResourceUseProvider for inspiration.

How to list the keys of given resource bundle (i.e. to say given . properties file) in flex

Is there any way in action script to list all the keys (not values) of given resource bundle.
My use case is to combine content of two different resource bundle. I wan to do this by creating a new resource bundle at runtime and add each key value pair from two different resource bundles into one. I would appreciate if anyone have idea if it can be done different way.
If you get the actual resource bundle (eg. IResourceBundle), you could iterate over the name keys in the content object I would think.

Storing a directory structure in database

In my rails app a user can have a directory structure which has folders and files in sub-folders. Which is the best way to store such data ??
Also, which database offers best way to do so?
You can store a directory tree in a single table using any SQL database, by making the table self-referential. A good example is the Windows Installer's Directory table, where you will see a structure like this:
Directory = primary key id field, typically an integer
Directory_Parent = "foreign key" id field, which points to the id of another Directory in the same table
Value = string containing the directory/folder name
Your file table would then have a foreign key referencing the Directory id. To find the full path, you must follow it up the chain and build up the path from the end (right), tacking each parent directory onto the front (left). For example, the file would point to Directory id '4' with the Value 'subfolder', then you fetch the parent's value 'folder', then the parents value again until you get to the root, creating a path like /root/folder/subfolder/filename.
If your database supports recursive queries (either Oracle's connect by or the standard recursive common table expressions) then a self referencing table is fine (it's easy to update and query).
If your DBMS does not support hierarchical queries, then Eimantas suggestion to use a preordered tree traversal scheme is probably the best way.
It's simple tree stored in sql. Either check the standard parent-child scheme or implement preordered tree traversal scheme (left-right).

Custom Action in Deployment Project - prompt user for values, and then extract them from custom actions?

I am building a Windows Service which will be deployed on four servers. My user wants to have the service read a configuration file from a common location, and load it OnStart.
I want the installation to prompt the user for the file path and file name to the configuration file when the service is installed, and then save that data in My.Settings.
I have figured out how to set the EDITA1 and EDITA2 variables in the Deployment project's UI, so that the user will be prompted for path and file name, but I don't know how to get those values out and into the settings of the service.
Help, please.
-Jennifer
Did you try passing it to the custom action using CustomActionData Property in the Custom Action property window. syntax is /param=[EDITA1]
Context.Parameters will contain a dictionary with 1 entry key being "param" (in my example above that's the key I gave it).
I'm having a problem with passing in parameters which contain spaces. the guidelines say:
For custom actions that are installation components (ProjectInstaller
classes), the CustomActionData property takes a format of /name=value.
Multiple values must be separated by a single space: /name1=value1
/name2=value2.
If the value has a space in it, it must be surrounded by
quotes: /name="a value".
Windows Installer properties can be passed using the bracketed syntax:
/name=[PROPERTYNAME].
For Windows Installer properties such as [TARGETDIR]
that return a directory, in addition to the brackets you must include quotes
and a trailing backslash: /name="[TARGETDIR]\".
When I try the "[EDITA1]\" for the file path I need.. I get the 'FileNotFound' error for "C..\Microsoft..." while my path didn't have Microsoft

Resources