Is it possible to add properties to multiple files after they have been uploaded to artifactory? - artifactory

As the title says. Due to a lack of understanding about how best to query files in artifactory I now have a situation where I have a few hundred files I need to add the same properties to.
Can this be done in bulk?
the folder structure looks like this:
repository
|
|- main folder
|
|- type
|
|- language1
|
|-sub-folder1
|-sub-folder2
|-file1
|-file2
...
...
...
Each sub-folder can have around 5 files, each language folder can have many sub-folders.

Sure it is.
You have two main options.
The first one is to use the Set Item Properties REST API on the relevant folder with the "recursiveProperties=1".
The second option, which I believe is better, will be to use the JFrog CLI to set properties on existing artifacts. This options will provide you with the ability to define a more complex logic on setting the properties.

Related

2sxc | Display multiple files with Adam upload

I can upload multiple files (documents in this case) at the same time very well. Is it possible to have a hyperlink field with multiple adam files dropped into it or even a plus ('+') icon to add another without having to drop on another app each time?
UPDATE:
Sorry I overlooked ADAM 1.2 (link below) feature to use hyperlink 'Library' for multi file selection.
https://2sxc.org/en/blog/post/introducing-adam-1-2-with-folders-metadata-and-c-sharp-api
I have been able multi select now but still having difficulty with using the file picker to create the folder structure I wish to achieve:
I read from link above:
You can create even another content-type - like Application Group Metadata - which you can use as folder-metadata. This allows the editor to tag each folder with additional information.
I do not fully understand how to use this 'folder-metadata' to achieve the same thing as the file manager allows me to do by specifying where each file is to be stored?

How to use bootstrap configurator along with GWTbootstrap3 (i.e. what is bootstrap.min.cache, and how is it generated?)

you can use the bootstrap configurator (http://getbootstrap.com/customize/) to configure your own bootstrap version (e.g. set the variables like #grid-float-breakpoint to configure the navbar collapse point). I want to use this feature within my project which is based on gwt using https://github.com/gwtbootstrap3/gwtbootstrap3based.
I managed to create my download my configured bootstrap.zip using the method above.
The zip contains (as expected):
\bootstrap\js
\bootstrap\css
\bootstrap\fonts
just as GWTBootstrap3 project
gwtbootstrap3-0.9.3\org\gwtbootstrap3\client\resource\js
gwtbootstrap3-0.9.3\org\gwtbootstrap3\client\resource\css
gwtbootstrap3-0.9.3\org\gwtbootstrap3\client\resource\fonts
So I tried to replace the bootstrap files out of css with the genereated bootstrap files.
But then I recognized that in the GWTBootstrap3 project there are files named *.cache.min.
How / when are these files generated? This is explained already here: GWT Caching Concept
So obviously we want to replace the bootstrap files to remain "cache"d.
Can you please forward me a step-by-step description of how to use bootstrap configurator along with the current GWTBootstrap3 project , i.e. what files need to be replaced?
What I already tried (with no success):
0.) Create a bootstrap.zip with the online configurator and download it
1.) Rename gwtbootstrap3-0.9.3.jar to gwtbootstrap3-0.9.3.zip
2.) Extract
3.) Replace bootstrap-3.3.6.min.cache.css with bootstrap.min.css (from the configurator) and replacing meaning the bootstrap.min.css is renamed to bootstrap-3.3.6.min.cache.css
4.) Put all files from bootstrap.zip into the respective directory and renaming it accordingly as explained in 3.) to effectively replacing the original file
5.) zip and rename it again to gwtbootstrap3-0.9.3.jar
6.) replace the lib in my project
But after doing so I continuously get the compiler errors:
Package org.gwtbootstrap3.client.ui cannot be found.
Any help greatly appreciated
Best regards
Hannes
I can provide an answer which should work for most of the configuration changes. First of all I had to learn that renaming gwtbootstrap3-0.9.3.jar to gwtbootstrap3-0.9.3.zip then unzip, rezip and rename to jar does NOT WORK!!!
So here is a step by step tutorial of how to configure your bootstrap and use it with gwtbootstrap3.0.9.3 . I am not sure this will work for future editions but it should work for bootstrap3.
Configure and download your new bootstrap
https://github.com/gwtbootstrap3/gwtbootstrap3based.
Unzip your new bootstrap, this will provide the subdirectories css,
fonts and js. So you will have something like bootstrap/css etc.
Now copy your "old" gwtboostrap3.0.9.3 jar to the base directory, so
that the bootstrap.zip and the jar lie in the same directory.
From the commandline issue jar xf gwtbootstrap3.0.9.3.jar which will
create the 2 directories META-INF and org in your directory
Move into org\gwtbootstrap3\client\resource\css
Copy the FILENAME (not the file!!!). In my gwtbootstrap version the
file is called "bootstrap-3.3.6.min.cache.css".
Rename the file bootstrap/css/bootstrap.min.css to
bootstrap/css/bootstrap-3.3.6.min.cache.css and REPLACE
org\gwtbootstrap3\client\resource\css\bootstrap-3.3.6.min.cache.css
with bootstrap/css/bootstrap-3.3.6.min.cache.css
Rename the file bootstrap\css\boostrap-theme.min.css to
boostrap\css\bootstrap-theme-3.3.6.min.cache.css and REPLACE
org\gwtbootstrap3\client\resource\css\bootstrap-theme-3.3.6.min.cache.css
with bootstrap\css\bootstrap-theme-3.3.6.min.cache.css
I left out the fonts directory because my changes did not change
anything with the fonts
Rename bootstrap\js\bootstrap.min.js to
bootstrap\js\bootstrap-3.3.6.min.cache.js and REPLACE
org\gwtbootstrap3\client\resource\js\bootstrap-3.3.6.min.cache.js
with bootstrap\js\bootstrap-3.3.6.min.cache.js
In the basedirectory (where the bootstrap directory lies) issue from
the commandline: "jar xf gwtbootstrap3.0.9.3.jar META-INF org". This
should produce your new gwtbootstrap3.0.9.3.jar lib
In your project replace the old gwtbootstrap3.0.9.3.jar with the new
lib.
In case you get lots of java errors telling you it cannot find the classes you mixed up the paths. Please let me know if this worked out for your. Perhaps someone can provide a shellscript to automate the whole process.
One tip: Customizing your bootstrap gives you more control, e.g. for handling the point at which the navbar becomes uncollapsed (at the configuration page look for the key called "#grid-float-breakpoint"). Don't forget to enter a value suitable for you (mine was 800px). Don't forget to add px at the end!!

Automatic toctree update

I'm not sure if this is possible. But I'm hoping to put multiple .rst files in a directory, and during compilation. I want these files to automatically be inserted in the toctree. How can I go about this?
You can use the glob option which enables wildcards. Like this:
.. toctree::
:glob:
*
This adds all other *.rst files in the same directory to the toctree.
Reference: "Use “globbing” in toctree directives"

Asset management - maintaining reference to relative assets after concatenation and versioning

I know that L5 and Elixir are still under development, but I'm excited to start thinking about ways to reorganize my code. I think my question has more to do with asset management, in the context of L5 and Elixir.
Want to clarify how concatenation and versioning should be handled (in my case I'm using Elixir's styles() and version()). The issue I'm having is that the new file after concat/version will be located in a new folder, breaking any references to assets from the original css or js files.
For example, an original CSS file that has background-image: url('../img.png') will no longer work. I've tried a couple of things, but both are not ideal especially in the case of vendor plugins:
Move required assets over one-by-one (using mix.copy() for each folder of assets), to the new build path (ie. the build path used by Elixir's versioning).
Manually edit the paths in each asset file to refer to an absolute path
Although both of these options will make things work, I feel as though I may be missing something. It also becomes quite impractical when working with javascript plugins (ex. ones that come with their own images, fonts, stylesheets, etc).
Is there a more practical way of managing relative paths when concatenating and versioning?
Here is the solution for Laravel Elixir after you build for versioning.
For copy command you need reference it as full path.
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Less
| file for our application, as well as publishing vendor resources.
|
*/
elixir(function(mix) {
mix.version('themes/default/assets/css/styles.css')
.copy('public/themes/default/assets/img/', 'public/build/themes/default/assets/img/');
});
EDIT:
I just submitted a pull request to Elixir, so you can just do:
mix.version(
['css/style.css', 'css/vendor/style.css'], //files to be versioned
['fonts', 'css/vendor/icons'] //dependent files/dirs to be copied
);
OLD ANSWER:
Actually, if you use mix.copy(...) alone, you just can't use gulp watch and you'll need to recompile your entire stack in order to get this working.
You can achieve the same results with the solution below and don't need to recompile everything, because it'll just work when you change a versioned file:
var shell = require('gulp-shell');
gulp.task('cp', shell.task(['cp -R public/fonts public/build/',
'cp -R path/to/vendor/dir public/build/vendor/',
'... etc ...']));
elixir(function(mix) {
...
//register a watcher to run 'cp' when you rebuild
mix.task('cp','public/build/**/*.(js|css)');
}
They are relative paths - so keep the relative relationship.
Just move the images over to the public/build/ directory as part of the gulp command, after the visioning.

Grunt task to concat JS pr folder

I'm trying to solve a problem with Grunt, where I wan't to concat multiple JS files together and name them after their parent directory.
project/
build/
news/
news.js
cart/
cart.js
../
....js
src/
news/
news-ajax.js
news-post.js
news-animation.js
cart/
user.js
cart-ajax.js
cart-animation.js
../
..script-1.js
..script-2.js
I was wondering if there is any way to do that with. I don't care about the order. I know RequireJS would be good for this. But these are individual modules that will be used on different pages. It's for something like a webshop. Where we have files for checkout, product list, news and so forth.
If anyone can point me in a direction it would be great.
---- Edit
I it seams the related posts is better then the search i found these links in the related posts but not in the search:
Using grunt to concat many files from many dirs into single renamed file in new directory
Dynamic mapping for destinations in grunt.js

Resources