Symfony 3: How to create a private bundle - unit-testing

I have a private API and I am using GuzzleHttp bundle to make calls to it. Now I'm just creating a sub-folder in the src/MyCompany/ApiBundle/.. and I register it in the AppKernel.php and use it without errors.
Now I need to make this a separate bundle (in its own private repository) so I can use it inside different projects.. I followed many tutorials but always face problems as they are for Symfony 2.
Symfony has a tutorial (Generating a New Bundle Skeleton) on the docs but it doesn't talk about external bundles like in my case.
So how to create such bundle? be able to test it and make it in its own repository to be later integrated inside other projects using composer?

Your bundle should be separate project. Check some fos bundles
Also check Best Practices for Reusable Bundles
You may also like to check
Using private repositories with composer
Handling private packages with Satis or Toran Proxy

Related

Maintain a subset of Django app along with full app

I'm working on a Django project for a large organization, and the full app will be for internal, private use, while a subset of the view functions and templates will also need to be available publicly. Due to IT constraints, the public portion will be on a different server, and won't be able to use the same files (but it will be able to query the database on the private server).
Is there a way to maintain a subset of the app's files on a separate server?
For example, if the private version has view functions a, b, and c, the public version will only use c. And the public version will only need the relevant template files, etc.
Does Django have some way of accomplishing this? Or Git, somehow (maybe gitignore)? I'm just trying to save myself from having to manually copy all updates from the full version to the partial version.
This is the type of thing that Django's app structure is for. You could make the shared functionality a standalone pluggable app, managed as its own git repository. The projects that depend on it can include it in their requirements.txt and settings files. When you update the shared functionality, you increment the project version, and then update the requirements files.

How to override river-admin template?

Firstly , i would like to say that this package is amazing in the sense where there can be so much flexibility. Im relatively new to this package and im just trying to figure a way to fiddle around with the provided front end in the river-admin package. Could someone point me in the correct direction in doing so?
I am the author of both django-river and river-admin.
river-admin is an admin interface for django-river implemented as a Vue.js application backed by django-rest-framework.
One fact about it is that it was never meant to use the river-admin as an extension to your django app which means that it doesn't have to fit in how your own django app looks. You might think of it is like the UI of Apache Airflow or RabbitMQ admin interface and so on.
But if you think that the things you wanna add are something that can be used by all of its other users why not contribute to the repo. Otherwise, you can always fork the repo and do the custom changes that you can not do via the river-admin API, build the package by yourself.
Here is some information on how one can build and run stuff locally

Different IPs are for different apps

At first, I am learning Python and Django only... So I'm a noobie yet.
I need to build a microservice architecture to I could run each my service on a separate server machine. In the Django I need to create an environment, project and apps. So, can I run these apps after on different servers? If no, how can I make it with Django? Do I need to create a separate project for each service?
P.S. If my question is stupid, pls, explain where am I wrong. I am from Java Spring world where I was need to create just new app for each service.
Either approach will work.
If it makes sense for your services to share the same code base, you can create a single project and use separate apps for each service and separate settings files for each deployment. The settings file would activate the desired app by listing it in INSTALLED_APPS, and would include settings specific to that service.
Or, if you don't need the services to be coupled in that way, you could certainly make each one its own project.

Adding Functions and packages to Device managemnt Core and common

I created a package and org.wso2.carbon.device.mgt.core.log.mgt created some functions in it.
Added my new Build of Carbon Device core as a project dependency to
WSO2 MDM - Mobile Device Management Admin Services
precisely the Operations Class
Build the project and Deployed it.
On loading it failed with Error being
Caused by: java.lang.IncompatibleClassChangeError: Implementing class
Any Help will be greatly apreciated. My Goal
Create functions in Carbon device Core and Common following your Design. Call the functions in my webservice
Please follow the instruction given in the below webinar and the tutorial in order to create your feature as an OSJI bundle(Carbon component) and add it to the EMM server. This is the correct and advisable approach for include new functionalities to WSO2 products.
http://wso2.com/premium/webinars/creating-your-own-wso2-carbon-components http://wso2.com/library/tutorials/2014/03/how-to-write-a-wso2-carbon-component/
First of all you need to create the carbon component(in here your newly created package).
Then Create the feature accordingly.
Then need to add created feature to the pom.xml file of the
product-emm p2-profile-gen.
then makes it packs in the project target by adding a entry to the bin.xml of the product-emm
following attached tutorials gave you a better guidance and clear idea about how to create your own carbon component.
tutorial
http://wso2.com/library/tutorials/2014/03/how-to-write-a-wso2-carbon-component/

How to access classes in war from Wildfly module

I have a ear deployment which contain several war. A common library is needed by these wars so a custom module is created. This library would somehow load the classes in the war (using class.forName() may be)).
However, it seems that the module is not able to get access to the classes in the war and keep throwing ClassNotFoundException upon deployment.
Is there any configuration needed to expose the classes to be accessed by the module? I tried with those export=true settings on the module but get no luck with it.
The library I needed is DWR with spring FYI.