overwrite existing api configuration OROCommerce - orocommerce

I want to fetch orders with the internal status for my orocommerce store,
so I found api.yml file in OroOrderBundle for managing that entity:
api:
entities:
...
#vendor/oro/commerce/src/Oro/Bundle/OrderBundle/Resources/config/oro/api.yml:31
Extend\Entity\EV_Order_Internal_Status:
actions: false
But I can not find a way to overwrite the existing api configuration for this entity
I already created OrderBundle in src and the other code of bundle is working, but that api.yml is also loading but does not overwrite the existing configuration.

All the API configuration files are merged across bundles, you can override and extend the config from another api.yml file in your custom bundle

Related

blogdown how to ingore an Rmd file that was built previously

I am using blogdown to build my site.
For a recent post, I wanted to keep a variable (config) out of the .Rmd post itself, because config contained sensitive authentication information. If I set config globally, but not in the .Rmd file itself, calling blogdown::serve_site() failed because config was not defined in the new session serve_site() creates when rendering the markdown files.
To accomplish what I wanted, I manually rendered the .Rmd source file with config defined in the global environment by calling rmarkdown::render("path/to/post.Rmd"), as suggested in how-to-use-objects-from-global-environment-in-rstudio-markdown. This successfully built the .Rmd file and produced the correct html output.
Now, though, I am unable to use blogdown::serve_site() to automatically build new posts on my site. It continually fails on the post that does not contain the required config variable. Is there a way to ignore the offending post? Or alternatively, a better way to do this?
Just like how you set global R options for blogdown (see Section 1.4 of the blogdown book), you can create config in .Rprofile under the root directory of your website project. The R code in .Rprofile will be executed before each Rmd post is rendered.

Dropwizard serve external images directory

I have a dropwizard API app and I want one endpoint where I can run the call and also upload and image, these images have to be saved in a directory and then served through the same application context.
Is it possible with dropwizard? I can only find static assets bundles.
There is similar question already: Can DropWizard serve assets from outside the jar file?
The above module is mentioned in the third party modules list of dropwizard. There is also official modules list. These two lists are hard to find maybe because the main documentation doesn't reference them.
There is also dropwizard-file-assets which seems new. I don't know which module will work best for your case. Both are based on dropwizard's AssetServlet
If you don't like them you could use it as example how to implement your own. I suspect that the resource caching part may not be appropriate for your use case if someone replace the same resource name with new content: https://github.com/dirkraft/dropwizard-file-assets/blob/master/src/main/java/com/github/dirkraft/dropwizard/fileassets/FileAssetServlet.java#L129-L141
Edit: This is simple project that I've made using dropwizard-configurable-assets-bundle. Follow the instructions in the README.md. I think it is doing exactly what you want: put some files in a directory somewhere on the file system (outside the project source code) and serve them if they exist.

Managing Dependencies in SailsJS

How can I manage dependencies in a Sails.JS based project. There is a really neat feature which automatically links assets from the assets folder into the relevant templates, however, to get these files, e.g Angular, Bootstrap, Material-Design etc. I like to run bower / npm install. But then the resources are in the bower_compnents file and can't be linked to. How can I work around this to get file installed by package managers to be included in Sails.JS's default mechanism?
You have the option to change the location of the bower components with a .bower.rc file.
Example .bower.rc
{
"directory": "assets/components/"
}
It is not a good idea to automatically link components, there are many .js/.css files that must not included together (eg. lib_name.js and lib_name.min.js).
You have to include them manually like this (tasks/pipeline.js)
var jsFilesToInject = [
'components/lodash/lodash.js',
'components/moment/moment.js',
'components/moment/locale/el.js',
'components/angular-moment/angular-moment.js',
'components/re-tree/re-tree.min.js',
'components/ng-device-detector/ng-device-detector.js',
// Load sails.io before everything else
'js/dependencies/extend.js',
'js/dependencies/sails.io.js',
// Dependencies
//'js/dependencies/**/*.js',
'js/my-app-bootstrap.js',
// load my controllers
'js/angular/**/*.js',
'js/my-app.js',
];

How can I install a yii extension, making it available to my whole web application?

Recently I decided to study php and I discovered yii framework. At first glance it seemed very easy to work with it but now I am struggling to configure my web application for installing an extension to work with Enums. I downloaded this extension from their web site and I put it within extensions folder. The issue is that I am not able to call the subclasses that I created in my code. I created a few classes that extend from this superclass (extension).
Which configuration I must do to make this extension class, available to my web application code?
As I said I just put that extension class in my extensions folder and I am just instantiating them, inside controller's methods. When I run the code I see the same error message no matter any configuration I make:
include (xxx.php): failed to open stream: No such file or directory
If anyone does want to know more about this extension this is the page that shows some information about that.
http://www.yiiframework.com/extension/enum/
in config/main.php you should add your extension details in the components array, something like:
return array(
// 'preload'=>array('xyz',...),
'components'=>array(
'xyz'=>array(
'class'=>'ext.xyz.XyzClass',
'property1'=>'value1',
'property2'=>'value2',
),
// other component configurations
),
);
where xyz is an extension
or just put it in the extensions folder and import it by Yii::import('application.extensions.extensionname.*');

Custom Clickstart with Templates and Github

We are using Cloudbees dev#cloud service, and are looking to create a number of application based off of an archetype stored in Github. I would like to create a custom ClickStart in order to streamline the process.
We are currently forking the archetype, then using a Folder Template that I have created to provision a build pipeline for the application.
While I have been able to create a simple ClickStart, I would like to create one that:
Forks or copies the clickstart source into a Github repository, and not cloudbees forge. The GitHub API supports this.
Point to my folder template using the Jenkins XML API. Currently, not all attributes of a folder template are represented in the rendered XML.
Target a specific folder to create my new folder job under.
The ClickStart API and JSON doesn't seem that well documented, and I have gotten about as far as I can go with trial-and-error.
Is what I am looking to accomplish possible with the current state of the Clickstart API?
Forks or copies the clickstart source into a Github repository
I do not believe this is possible today. Certainly it has been proposed.
not all attributes of a folder template are represented in the rendered XML
Such as what? The config.xml of a folder, just like that of a job, should be definitive. (It does not include definitions of child items.)
Target a specific folder
Also not possible today that I know of. (Though the user of the ClickStart could always move the result into a subfolder after the fact.)