Using in a Spring project an admin site from other frameworks - spring

Spring Boot doesn't contain an admin site.
By an admin site I understand the staff only section of the site for admins and editors to creade, edit or delete information.
With Spring Boot you will have to create write the admin site by hand. It will take labour of several people (at least a frontender, and maybe an analyst and maybe a UX designer). And anywah, an admin site is a ton of JavaScript and business logic.
Anything simple is not convenient to use.
On the other side, there are web frameworkds that contain an admin site (either out of the bos or as a pluggable module). Examples, Django, Laravel, Ruby on Rails. Let it be Django.
Could you tell me whether it is prodent for small projects to combine Django and Spring, setting the same database for them. I underline once again that it is only for small projects.
So, Django and Spring work in the same database.
And their models correspond to each other.
In the project Django will be responsible for:
Creating tables in the database (including migrations).
Admin site (including validation of data input by our staff).
Spring is responsible for:
Business logic (interation with ordinary users, that is not our staff).
Saving data input by ordinary users in the database (including its validation).
There is another way possible where we create models in Spring, then create tables in the database and then:
python manage.py inspectdb cities > models.py
This way django will perform reverse engineering and create a model from an existing table.
I have tried this in practice. Definitely it is possible. And why not: it is just a database with two superstructures over it (Django project and Spring project).
Could you tell me whether this is reasonable or absolute nonsence?

Related

Multi domains for one project or multi domains for multi projects

I'm planning to make the graduate project about the e-commerce site using ASP.Net Core 2 MVC and SQL Server, but currently, I have some troubles:
Suppose I have two domain and sub-domain: domain.com and manage.domain.com. The domain.com will like the normal e-commerce site which allows customer go to browse, search, and buy the products. The manage.domain.com will only for staff to log in and do their stuff like manage staff, order, etc.
My questions are:
Is there possible to manage two domains on one MVC project or I have to split them up? If it is possible, then how can I manage it just in one MVC project?
If I have to split them up to two projects: one for e-commerce, one for staff, then should I create the WebAPI to connect as a data layer to communicate the projects with the same database as the suggestion of Sagar Shirke?
Are there any other approaches to my problems? Any comments and idea will be very very appreciated.
Thanks for reading my problems!
After thinking about this some more I think you are taking the wrong approach.
Why don't you look at using a premade framework with an admin template page to manage typical admin task (users, passwords, custom data, etc.) ?
Instead of using a subdomain like sub-domain: domain.com, you could use domain.com/admin.
Here is an link to ASP.NET Boilerplate templates. I would recommend you look at the simple todo task examples and see if this is concept is what you want. Using the free Module Zero admin page templates to develop quickly. I would make sure you do the tutorials and read the documentation.
This is a great tutorial on how to use subdomains.

Spring Boot Rest Multilanguage

I have an application, that uses Angular 2 for UI and Spring Boot Rest as a microservice. As a database, I have PostgreSQL.
I want this project to support multi-languages.
I heard that spring has something called i18n, but I don't know how to implement it.
One of my microservice is called categories, and what it does is CRUD operations. The default language is English, but I want to add french. So, if a call is like this:
get: http://localhost:8080/categories?lang=fr
I will get all the categories, where lang = 'fr'
Also, probably I will add a table called static_texts, where I will add words to translate, like: contact, menu, testimonials, etc. And for these words, when a user entered for the first time on site, angular will make a call to java to get all the static words, to save in a session, and to add those into the template.
Like this I see the multilanguage system, but, I don't understand how to implement it into my project. Do you have an example, because I couldn't find anything for what I need?
Thanks!
Spring Boot can manage any number of locales in an application flawlessly. Internationalization is a great way to increase users on a product so there are no limits in terms of how users use your product.
The first and simple solution is to implement a LocaleResolver and LocaleChangeInterceptor for managing some resource files for different languages. you can see this tutorial.
However, this approach depends on the access to the application’s resource files when adding a new supported language or modify the existing message files. In case an end-user is responsible for this job and obviously, this is not an optimal approach.
Hence, the second method shows how to move all of our localized messages to a database. This enables the end-user to add a new language or update existing localized messages at runtime with the help of i18n. In this tutorial you'll see how to use your table for translated texts

Advise needed - which Rapid Application Development Framework using PHP and MVC meets this specific need?

we are a parents initiative who runs a small kindergarden / child nursery and we set out to build a basic web based documentation and reporting application for our nursery.
After spending a week doing research on the various PHP MVC frameworks, I have a few questions that I could not answer myself - even after having a closer look (installed on local machine) at CakePHP, Symfony, CodeIgniter, YII and Joomla.
The goal is to build a web application where site managers, staff and parents (roles) can log in to do simple tasks, depending on their role (hence I need a RBAC). Site managers will for example be able to add staff to the database, staff will be able to add children and do some documenation on children (select a child and enter details on special needs etc.). Parents should be able to update information about who is picking up the child, or inform the staff if a child will not come in at a certain date.
Now, since this is all basic CRUD with only a few tables underneath, tables connected via some foreign key constraints, I would like the framework to generate CRUD skeletons for me.
And since I need to manage roles and limit access to certain pages, I would like a basic user management out of the box.
Plus, PHP and MySQL and MVC are set - otherwise I would have used Oracle Apex as I have some experience with that.
So, I looked at a vast amount of PHP frameworks and found the following to be promising:
CodeIgniter (with Bonfire plugin)
Symfony2
YII framework with GII
CakePHP
Joomla
BUT none of the frameworks I looked at seemed to fit my need:
creating CRUD skeleton pages based on my ERD with foreign keys (MySQL InnoDB) / Scaffolding
offering a basic user management out of the box with up to date security measures in place (passwords stored using phpass or salted hashes & md5, user registration, defining roles and limiting tasks to roles/users).
If somebody could suggest a PHP Framework that comes with those two requirements build in, I would be very happy to hear about it. THANK YOU very much in advance!!
(I really liked CodeIgniter because it was simple to set up and lightweight, I liked the Bonfire user management plugin but was disappointed when I found out they sacked scaffolding in the lasted release
And I liked Joomla for its user management, but found it quite hard to get started on component development, plus no scaffolding).
You should check FuelPHP and its ORM, Oil and Auth packages. It's really great. If you liked CodeIgniter, you'll probably love Fuel.
http://www.fuelphp.com

Getting own EF 4.1 Code First classes to work with .NET Membership

I am working on a simple web application that is built with EF 4.1 Code First and MVC3. My Domain Model sits in a project outside the MVC3 project.
I have gotten to the stage where my web application is more or less complete. However right now, my application doesn't have any form of authorization or authentication. So a regular user can get to Actions and Controllers that only an Admin is suppose to have access to.
My question is, how do I get my web application to work with the .NET Membership ? Because I am aware that the .NET Membership has many database tables of its own !
My knowledge is fairly limited, thus any clear, easy to follow responses would be greatly appreciated.
After the Membership is set up, I know my way around applying Authentication and Authorization to Actions and Controllers.
Thank You.
Go into your C:\Windows\Microsoft.NET\Framework\v2.xx or v4.xx\ and execute aspnet_regsql, this will launch a wizard that allows you to choose your database and it will add the stored procs and tables to allow membership to function.
Then you run the ASP.NET configuration wizard (the little toolbox icon at the top of your solution explorer) and then configure your roles and accounts. See this page and skip to the Configuring the website for membership and roles section.
ASP.Net membership is actually kinda interesting and frustrating to an extent. To you run a tool called aspnet_regsql.exe found in your Windows\Microsoft.net\Framework folder which generates all of the necessary tables to get it running. Next move onto your Web.config file. If you started with your basic ASP.NET MVC 3 template then you should have a <connectionStrings> entry under the name "ApplicationServices". Change that to your database connection string. This is what the membership provider uses to hook everything up. If you look through the rest of the config file there should be sections for <authentication>, <membership>, <profile>, and <roleManager>. These deal with the various sections and settings that the ASP.Net user management is broken into.
At this point everything should be hooked up. If you select your project in the solution explorer, a little red hammer icon should appear. This is the ASP.NET configuration manager. You can use this to set up different profiles and manage different users.
Now this stuff won't be connected to your EF4.1 code first stuff at all. Instead, you can interact with your membership provider through static classes Membership and Roles. If you take a look at the AccountController on a default ASP.Net MVC 3 Internet application template it will give you a good idea how it works.
After working with this stuff for several months, I found it much easier to basically write your own. Tying things together eventually becomes a huge pain and there is a whole lot of extras that the membership provider gives you that is unnecessary for small applications.

Joomla CMS and Spring Framework

I want to create a Web application by combining Joomla CMS with Spring Framework. What would be the best way to build/use a single sign-on for both?. All the pages on the website will be serviced by Joomla CMS, but those that require authentication/authorization will be done with Spring Framework. The later will retrieve widgets from Joomla CMS to ensure the same User Interface.
I would appreciate any suggestion or pointer to information about this topic
Thanks
Peter
You can overload Joomla User plug-in, save/edit/delete/login/etc. This will hep you understand user event that you will need to implement, http://docs.joomla.org/Reference:User_Events_for_Plugin_System. Also look at the following file plugins/user/example.php
In my opinion, mixing 2 different languages PHP and Java in 1 project is a little extreme. I would keep the projects separate and created my own Joomla/Spring Field API. Then would make API call in Joomla components/modules/plug-ins to integrate with Spring Framework.
Another thing, do not modify Joomla's native code to achieve what you want (I mean don't rewrite base classes that Joomla uses). Instead create your own library in the /libraries/ directory and extend the classes. If you decide to adopt API, you might want to have some API object in your model. Create your own base model /libraries/your_lib/application/component/ then when you are creating a model in the component change the import code to jimport('your_lib.application.component.model')
IOPLEX sell a Java library (Jespa) to provide single signon using Windows NTLM credentials, they also have a Joomla plugin. Could be appropriate if you're authenticating against ActiveDirectory and have Windows clients.
i think using web service will give the chance to not touch the basic code of joomla because joomla give you hand to make an xmlrpc , and you have to keep in mind the session controle the best think is to let joomla manage session and creating a user plugin to make a specifique action in the login and logout event. hope will help.

Resources