Hybris sap use Spring? - spring

I all,
I have experience with oracle atg and now i want to merge to hybris sap, so i have some questions about hybris.
For development, does hybris uses spring, that means when i develop an hybris application do i use spring ioc, spring mvc and spring security (#autowired, #controller, #service...) or just like atg the usage of spring is done in the background and when i use angular with hybris do i have to use spring (#RESTController) and for data access do i have to use hibernate or does it have his own methods? And do we have to use spring boot and spring data with it?

I haven't got knowledge about oracle ATG. Hybris is a platform which has a lot of module. Some modules developed with spring (xml based config), for example web services and customer ui (store front). Hybris has own ORM, so spring data not used. Hybris using a lot of technologies, some of them:
Spring
Apache Solr
ZK Framework
Apache Ant
Apache Tomcat
Junit
JQuery
Also we use a lot of languages for this technologies:
Html
Java
Javascript
Flex Query
Bean shell
Groovy
Jsp
Lucene
Cron
You can use other frameworks look like React for store front with developing custom controls. But hybris has a lot of out of the box functions for managing ui and customization on the fly. These functionalities may be not usable with different framework or it needs a lot of work.

I don't know about ATG, but in hybris there are many modules using which you can quickly setup a live production website within 4-6 months.
Front-End:
JSP, JSTL, EL
Javascript, HTML, CSS
Bootstrap
jQuery
Backend:
Java for handling and writing the logic
Spring Core, Spring MVC, Spring Security
Spring EL
Database:
More than 6 databases are supported:
- SAP
- HANA
- HSQLDB
- MySQL
- SQL Server
- Oracle
- PostgreSQL and many are added
For searching:
Hybris has its own search engine.
Lucene, Apache Solr
Now you can use Google cloud search as well.
For scripting:
beanshell
JavaScript
Groovy

Please keep an eye on the Hybris Commerce roadmap. Thin Angular.JS based UI is probably the future.
UI development is typically done in Hybris Commerce using the Hybris Commerce WCMS framework, and extending or creating new pages, widgets, etc. The stuff provided out-of-the-box in accelerators and extensions is very feature rich. Angular is already in there, if you know where to look.
Hybris Commerce also provides OCC (Omni Commerce Connect) REST API extension. REST endpoints are automatically generated at compile time. This is very mature, and has been the primary integration strategy for native mobile commerce apps and separate digital asset management (DAM) tools.
More ideas:
https://hybrismart.com/2016/09/03/angularjs-v-2-and-hybris/

The basis of Hybris is mostly spring mvc, so yes, you can use spring mvc annotations for mapping, mostly all the code in hybris is done using the spring standard, including autowiring, annotations and xml files.
Unlike ATG where you have formhandlers, droplets etc to deal with UI and backend connection, Hybris uses the facade design pattern. That is,
You have a facade layer that acts as a sort of barrier between your request handling logic and your service logic.
Therefore, variables used in the service layer (Model Objects) are not carried forward to the request handling layer and separate variables are used (Data Objects)
Regarding database, Hybris has its own ORM, and they are called as Models and items, the concept is similar to repositories in ATG. For example, to create a new item entry, add the same to an items.xml file, providing the name of the model, the table used for persisting and the various attributes (corresponding to the fields in the table). So when you run ant all for building your application, Hybris uses this mapping to create a model class for your item, this is basically a pojo class, that has getters and setters for all your attributes. So if you save a model object, you will be persisting the data in the database.
To query the data, there is a special query language called as flexible search,it is nearly same as sql but with a few syntax differences, so instead of querying tables, you query items, much like using RQL in ATG.
You can also access data using model objects.
Relations too can be created using items.
Hope this gives you a more clearer picture.

to Start with Hybris, you need to be good at java,jsp,html,css.
And framework such as Spring and Hibernate.
Last but not the least:you should good in any Query language,which helps you lot while coding in Hybris, because hybris have there own language called as Flexible Search Query.

Related

ABAC support for Spring Security or Apache Shiro

I'm trying to find any open-source or commercial implementation of Attribute-Based Access Control(ABAC) paradigm that will work together with Spring Security or Apache Shiro frameworks. Right now I can't find any of them.
I don't think I'm a first one who needs such kind of functionality - so could you please recommend frameworks that will support this ?
Also, can Permissions in Apache Shiro be considered as a particular case of ABAC paradigm implementation ?
jCasbin is a powerful and efficient open-source access control library for Java projects. It provides support for enforcing authorization based on various access control models. ABAC is one of the models that is supported by jCasbin.
ABAC: syntax sugar like a resource. The owner can be used to get the attribute for the resource.
In jCasbin, an access control model is abstracted into a CONF file based on the PERM metamodel (Policy, Effect, Request, Matches). So switching or upgrading the authorization mechanism for a project is just as simple as modifying a configuration. You can customize your own access control model by combining the available models. For example, you can get RBAC roles and ABAC attributes together inside one model and share one set of policy rules.
It supports Spring boot via plugin: jcasbinspring-boott-plugin
Also, there is another opensource project called EasyAback. (The original project documents are written in Russian and I translated them and moreover added some other documents and diagram link)
This github sample shows how ABAC can be implemented on top of spring-security framework using Spring Expression Language (SPEL). An excellent blog describes the sample code using a simple web app. Having come from an XACML background I found this project to be very familiar to XACML. It essentially maps XACML concepts to define policy's in JSON (instead of XACML / XML) and using a familiar spring-security API and framework.
Disclaimer: I work for Axiomatics
Axiomatics provides an Attribute Based Access Control (ABAC) implementation that integrates with different environments:
Native Spring Security integration
integration with other Java apps via our SDK and API
integration with API gateways e.g. Apigee
database security
We have had customers integrate with Apache Shiro . Apache Shiro are a simplified form of ABAC. They can be integrated with ABAC.
Axiomatics' implementation relies on XACML.
For an open source Java alternative, you can find several on the XACML Wikipedia page: AuthzForce, Apache OpenAZ, WSO2 Balana. For AuthzForce, you can find Java code samples of ABAC/XACML authorization filters using either an embedded Java PDP or a (remote) RESTful PDP.

CRUD generator for Struts 2 application

I have an already existing application built on Java 5 & Struts2 MVC framework having Oracle 11g DB.
Application has large number of tables which are often updated using insert queries or update statements
and I am looking to develop a CRUD application and avoid any manual script execution.
Number of tables are very large with dependency over each other, so I was looking for a java framework which can directly generate the code based on existing table structure, with the flexibility to allow upload excel with data and provide a bulk update features.
Tried with Spring Roo but want to know if there are more framework which can be used with existing Struts 2 MVC.
If you want to use CRUD application with Struts2 then you should look into Struts 2 CRUD Tutorial .
The application example from Struts Struts 2 CRUD Example
This example was created to be as simple as possible and as such, it does not use all of the advanced (integration) features such as Spring IoC, Hibernate Open-session-in-view, OS Sitemesh, annotations, etc .
You can also look at other Examples at GitHub.
About java code generation you can use Jboss Tools.
Hibernate Tools provides easy generation, testing and prototyping of your Hibernate or JPA mapped projects. Use it to Run queries, browse mappings and generate code for your data projects.
Consider Reverse Engineering section if you work on generating Java code.
Put Hibernate Tools Reference Guide to the desktop to read and help with any aspects of code-generation with Hibernate.
References:
Struts2 Builder Project
Easy CRUD with Struts 2 video
Basically what you want is :
Given an existing database, avoid coding manually the queries and the Java classes, and let instead {SMART_SOFTWARE} generates them for you.
Struts2 is a front-end MVC framework, it doesn't know anything specific about CRUD; while using Struts2, you are free to choose any persistence technology you like (JDBC, Hibernate, JPA, etc...).
Since the question involves Java EE, the standard is JPA.
If you're ok with using the Java Persistence API, then you're lucky! The software you're looking for is
Eclipse JPA Tools
It's able to map the DB and create the Java classes (JPA Entities) by reverse-engineering the tables.
Note: there are equivalent tools for NetBeans and other IDE, if you're into them.

Spring data alternatives

Currently We have an enterprise application that works with spring and JPA.
Today we are planning our next generation server.
We are debating whether to use spring-data in our project? It seems to increase productivity and development times.
Are there any alternatives to spring-data to consider? Why not using spring and JPA alone?
What do you suggest?
Bear in mind we are starting to develop from scratch so no constraints are available other than:
we use mysql and mongoDB
we code in java
we will develop client side code in GWT.
Currently we have a layered architecture.
We have a Service layer and a manager layer, which takes care for persisting and business logic. Whoever built that didn't see a good reason to insert the third DAO layer.
There are some technical benefits of Spring Data over Spring + JPA, which in a pure SQL environment, I think give Spring Data an advantage:
Spring Data uses the same CrudRepository interface for all implementations, so you'll have less effort to switch between JPA to MongoDB
Spring Data saves you writing the same methods again and again. You just add the method to the interface and it'll generate it for you (e.g. UserRepository.findByUsername())
You can save boilerplate on REST implementations for JPA, MongoDB and others (see http://projects.spring.io/spring-data-rest/)
If you wanted to experiment with other persistence or indexing services, then there are Spring Data implementations for both mature and newer technologies such as for Neo4j, Hadoop, Solr, ElasticSearch, fuzzydb.
Given that you use MySQL and MongoDB, I think Spring Data is a strong candidate, as it allows developers to code to a single data access API (Spring Data) instead of two (JPA and the MongoDB Java Client).
Regarding the existing architecture, it sounds as though your manager layer is implementing either a Rich Domain pattern, or Active Record.
Spring Data is in my view very well suited to Rich Domain when combined with injection of services using Spring's #Configurable.
Lastly, I'd say that Spring Data also gives a significant advantage when needing to implement services for things like Spring Security and Spring Social, which use MongoDB or others instead of SQL.
We did this in the fuzzydb sample webapp that can be found here. (Disclaimer: I'm the currently sole recent committer on fuzzydb, and haven't touched it for a number of years, but we did have a live service, www.fridgemountain.com, based on that code, but neglected to promote it)

Using multiple frameworks | DayCQ + Spring + Hibernate

We're in the process of redesigning a large application (web-portal). We are suppose to use existing database that they have used for their old application. Now we are planning to use CQ for hosting the pages and supporting authoring on those pages.
So as we have closed on CQ option, question comes to integrate CQ with some external frameworks like Spring (to use JDBCTemplate) or Hibernate framework to access data from database. I have following options:
Either integrate CQ with hibernate framework to leverage caching, transaction management, data object mapping etc. But catch is hibernate can only be use to access data not for other purposes like making RESTful calls that we require too.
Or integrate CQ with spring framework to leverage JDBCTemplate to access data and also spring can help me with caching, transaction management, making RESTful calls but catch is that using JDBCtemplate will cause following problems
a. LOC will increase and the code will be hard to maintain
b. Query strings are hard to maintain in case if change in table takes place
Or use both and leverage advantages of both frameworks wherever required.
Should I look forward to integrate CQ with both frameworks. If yes then question arises that what problem it will cause in terms of:
- Ease of Use
- Productivity
- Maintainability
- Stability
- Performance
- Ease of Troubleshooting
If it's data integration that you're after, CQ5 is based on Apache Sling which allows for accessing arbitrary data sources via its ResourceProvider mechanism. This was originally a read-only mechanism but read-write functionality was recently added.

How to generate Model layer, Persistence layer and service layer from a single configuration file

I am using hibernate to persist data on a MySql database.
Now I am already configuring what my business model is in the hibernate configuration file.
What I am looking for is, are there any tools that on building/deploying the application will generate the Model Layer (POJOs), Persistence Layer and the Service Layer (Business logic) for the controllers to communicate with the database server. In short I wish to generated all the basic essentials from a single configuration point.
Ant or Spring or combination of other frameworks, anything that can achieve the solution.
Any reference to an existence thread or a handful document would be highly appreciated.
Thanks in advance.
Your closest bet is Grails.
I'm not a fan of what you'd like to do. Code generation can result in a brittle system.
spring roo can be also good option to look at as your stack is based on spring framework.
Another option which can be used is MyEclipse IDE for Spring this supports code generation based on domain/table.

Resources