How to specify relative path in local.properties? - sap-commerce-cloud

I have to specify the path to the Solr configset in my local.properties.I tried the absolute path in my file which worked fine, then replaced it with ${HYBRIS_CONFIG_DIR} which also works fine.
However my worry is that when this code goes to the Cloud environment where configuration is loaded by manifest.json which refers to the local.properties to be used and the solr folder is in same directory(same as local.properties).How do I give a relative path which works for both local as well as Cloud?

You can create your own key for your custom path like below. These are defined in platform OOB.
HYBRIS_BIN_DIR=${platformhome}/../../bin
HYBRIS_CONFIG_DIR=${platformhome}/../../config
HYBRIS_DATA_DIR=${platformhome}/../../data
HYBRIS_LOG_DIR=${platformhome}/../../log
HYBRIS_TEMP_DIR=${platformhome}/../../temp/hybris

Hybris Platform takes care of relative path
The above-mentioned path is generally used by the build callbacks.

Related

Robot Framework cannot create folder via Create Folder keyword

I observe very strange situation my Robot Framework script cannot create folder via Create Directory keyword. Code is very simple
Create Directory folder_name
According to log step ends with success but actually folder is not created.
I use Robot Framework 3.2.2 on latest version of xubuntu. I suppose that something wrong with access to file system from script. But I cannot fond out where
Please use double slashes (//)
to separate the folders forming the path argument
("folder_name", as you've named it).
This notation is for Windows.
The idea can be explored from here on.

Access different type of preset target location in Luigi

I have a luigi pipeline. There is a file where Google Cloud is set as a target location:
https://github.com/macarthur-lab/hail-elasticsearch-pipelines/blob/d6e9dedbce929c04c294c54095663ba94a4de3f0/luigi_pipeline/lib/hail_tasks.py#L37
Now, there is run_vep() method that calls other ones ultimately ending up calling the following, different run_vep():
https://github.com/macarthur-lab/hail-elasticsearch-pipelines/blob/d6e9dedbce929c04c294c54095663ba94a4de3f0/hail_scripts/v02/utils/hail_utils.py#L103
There we are using Google Cloud path to access the files, but I want now to access local files instead. Is there a way to change where luigi looks for files temporarily? The thing is that I have two locations for where luigi should get the files and need both of them to be accessible instead of just one or the other. How could this issue be handled in luigi?
It turns out that their function hl.vep() actually expects config that should have local paths and not hadoop ones. After specifying the local paths, things worked for me. Still it would be interesting to know how to access this or that file system directly for which source code of hl.vep() may be useful too.

How to make gradle.properties machine independent

I'm working on 2 different machines (home vs. work) and transfer the code via GitHub, which works nice, but I just ran into a machine dependency when I added this code to the gradle.properties file to fix a vexing OAuth issue for google sheets:
org.gradle.java.home=C:\Program Files\Java\jdk1.8.0_131
org.gradle.java.home=C:\Program Files\Java\jdk1.8.0_77
Now I have to toggle between the 2 lines to get Gradle to compile. Need to check if I still need it (since I got the keystore files etc. sorted out), but I also wonder whether there is an easy solution to make this work (e.g. something like ifdef).
Obviously, I could just change the directory name in one of the machines I guess, but still curious how to solve this within Studio.
Lets start with a quote from the Gradle docs:
org.gradle.java.home
Specifies the Java home for the Gradle build process. The value can be set to either a jdk or jre location, however, depending on what your build does, jdk is safer. A reasonable default is used if the setting is unspecified.
So, by default, you should not need this project property (thats what they are called in Gradle).
However, there can be reasons, that you need to specify the Java directory. For this specific project property, you can follow Ray Tayeks advice and use the JAVA_HOME environment variable (on both systems). But there is also another approach, which can be used for any project property (and also for so-called system properties):
gradle.properties files can be located at different locations of the file system. Your files are located in the project directory and, therefor, they are included in your VCS. You can use them / it for project-related properties. An additional location is in the Gradle user home directory, which is by default the .gradle folder in your personal folder. This folder is not under version control, so simply define the property there.
try removing the line from the properties file. if that fails, try setting JAVA_HOME on each machine.
there are a lot of related questions.
you might try asking on the gradle forums.

Change mimosa web package build directory

I am trying to change the directory of Mimosa's "dist" folder. It is currently set via the node package "mimosa-web-package", and there is a config file in there. However, I do not want this config to be overridden if I update my node modules.
I have looked on Mimosa's page to see if there is an option to change, however I cannot work out how they are linked.
Anybody encountered this issue?
Thanks!
Set this to whatever you want in your mimosa.config file:
webPackage.outPath: __dirname + "/nameOfBuildDir"
Looks like you found the answer, but hopefully this helps...
mimosa-web-package has its documentation on its GitHub page instead of the website because it isn't a "default" module that comes packaged with Mimosa. The config for mimosa-web-package is what controls that particular setting, and yep, its outPath that you want to change. It is set to dist by default.
webPackage.outPath: "nameOfBuildDir" should also work in the case you mention above.

How can I open a local file with a local program through my browser?

On my webpage, I have placed a link to a local file (e.g. "text.docx" on my local HD). I would like to double click on this link, and have a third party software which is installed locally on my PC (e.g. Microsoft Word) open it.
I would like to be able to do this with Firefox and Google Chrome. Obviously, I am a newbie to web programming.. can somebody show me the way? I have looked around and had the impression that I need to write and add an extension, maybe?
Thanks for your time. Jakob
This is only possible if you know either the absolute path to the file or the relative path from whatever working directory your browser runs from. You the create a link with
href="file://relative/path/to/file/text.docx"
or
href="file:///absolute/path/to/file/text.docx"
and any modern browser will query the system database for the mimetype of the file depending on its extension, thus prompting to open the correct application.
EDIT
I inawarently introduced a unixism in the previous code: Distinction bewteen absolute and realtive paths as above works well on current *nix desktops, but in Windows an absolute path will most likely look like
href="file://C:/drive/absolute/path/to/test.docx"
Mind the 2 (not 3) slashes a the beginning, and the forward (not backward) slashes.
As far as I know, you can't link to local files from a website. If you upload it to where your files are, you could then be able to download it.
I was able to execute code locally, using Firefox, by adding an extension which used the XPCOM interface. One such extension was "commandrun", and may be found here: https://github.com/aabeling/commandrun .

Resources