Tobias Jeger pushed to branch master at cms-community / hippo-essentials

Commits:
c8e3a049 by Tobias Jeger at 2017-12-22T15:56:45+01:00
ESSENTIALS-1135 Remove obsolete (unused) data structures

- And turn remaining structures into simple data beans

- - - - -
6eb38f17 by Tobias Jeger at 2017-12-22T15:56:46+01:00
ESSENTIALS-1135 Introduce UserFeedback and refactor dynamic REST app

- Feedback to a user's action in the dashboard was "hidden" 
inside a
generic data structure in the response to (typically) POST requests,
the MessageRestful or a RestfulList<MessageRestful>. The front-end then
poked around in the response data and did a best guess at which
responses contain user feedback, to be displayed in the dashboard's
user feedback header. Introducing the UserFeedback makes this more
explicit and comprehensible. UserFeedback encapsulates potentially
multiple messages, and provides them to the front-end in a more explicit
manner.

- DynamicRestPointsApplication (which registers the plugins' /dynamic
REST endpoints) has been refactored to instantiate singletons for all
REST endpoints, which are then Spring-injected explicitly before being
registered with the JAXRS Application. Like this, Spring injection
doesn't leak into the plugin SDK API, and resource classes do no longer
need to extend from BaseResource.
Using singletons does mean that resource classes must be stateless /
thread-safe. All currently existing Plugin-based REST resource classes
meet this requirement without adjustment.

- - - - -
03477578 by Tobias Jeger at 2017-12-22T15:56:46+01:00
ESSENTIALS-1135 Rename ContentBeansService to ContentBeansServiceImpl

- - - - -
f501b9a1 by Tobias Jeger at 2017-12-22T15:56:46+01:00
ESSENTIALS-1135 Make ContentBeansService(Impl) injectable

ContentBeansService implemented an intricate logic for accumulating
user feedback messages (as BeanWriterLogEntry) in a dedicated magic
field of the PluginContext, only to rewrite them immediately in the
BeanWriterUtils. I refactored ContentBeansService to directly and
consistently add user feedback messages to the passed-in UserFeedback
instance.
Also, the PluginContext no longer needs to be provided in the
constructor, which made ownership and control of the context's life-
cycle unnecessarily complicated. Instead, the caller owns the context
and passes it in through the API.

ContentBeansService still is an overly complex and under unit-tested
class. While the new interface describes the current API, the API is
still too ugly to freeze, which is why I keep it in the implementation
module for now.

- - - - -
c9896261 by Tobias Jeger at 2017-12-22T15:56:46+01:00
ESSENTIALS-1135 Remove unused code

- - - - -
b07aa282 by Tobias Jeger at 2017-12-22T15:56:46+01:00
ESSENTIALS-1135 Refactor JCR low-level access into JcrService

This change removes the dependency on the JCR-related methods of the
GlobalUtils by making them available through the injectable JcrService.
As many of the unit tests (sub-classes of BaseRepositoryTest) depend
on a custom access to the repository, this change involves some serious
refactoring in the testing infrastructure, to make sure there is only
a single instance (singleton) of the JcrService used throughout the
Spring application. In the unit-test context, the TestJcrService plays
that role.

- - - - -
1621ac15 by Tobias Jeger at 2017-12-25T08:41:17+01:00
ESSENTIALS-1135 Create injectable Essentials ContentTypeService

to replace the old ContentTypeServiceUtils. Clean up HippoNodeUtils
(lots of unused code). Replace DocumentRestful (implementation) with
ContentType (API).

- - - - -
bb706f90 by Tobias Jeger at 2017-12-26T08:56:17+01:00
ESSENTIALS-1135 Embed Vendor info in PluginDescriptor

The separate Vendor bean was is only used in the context of a
PluginDescriptor. It therefore seems cleaner to keep it as an inner
class. I also noticed that the unit test for the [de-]serialization of
PluginDescriptor lived in the dashboard, while the descriptor lives in
the API. I moved the unit test into the API module, rearranging some
Maven dependencies.

- - - - -
546bd055 by Tobias Jeger at 2017-12-26T16:19:57+01:00
ESSENTIALS-1135 Add import of interpolated resource to JcrService

Importing a classpath XML file (after {{moustache}} interpolation) into
the JCR repository is a frequently-seen pattern in Essentials plugins.
By adding support for this pattern to the JcrService, the direct
dependency of a plugin on the TemplateUtils is removed, without having
to expose them through the API.

All in all, the Content Blocks plugin now no longer depends on the
plugin-sdk implementation module. Hurray!

- - - - -
fb2a43d4 by Tobias Jeger at 2017-12-27T16:26:20+01:00
ESSENTIALS-1135 Add unit test for JcrService

I noticed that the BaseRepositoryTest-derived unit tests of the SDK
implementation module were quite slow, because they reinitialized
a new repository for every test case, including importing 10+ namespaces.
By refactoring the MemoryRepository class in order to only instantiate
a new repository once, and resetting its nodes only if a new test case
uses a Session, I managed to speed these tests up by a factor of ~5.

- - - - -
a56b31f4 by Tobias Jeger at 2017-12-28T11:23:42+01:00
ESSENTIALS-1135 Add unit test for ContentTypeService

And fix the logic to retrieve a content type's display name.

- - - - -
20f7cee8 by Tobias Jeger at 2017-12-28T12:09:30+01:00
ESSENTIALS-1135 Better documentation and unit testing

- - - - -
40b3b77d by Tobias Jeger at 2018-01-11T19:25:00+01:00
ESSENTIALS-1135 Reintegrate 'feature/ESSENTIALS-1135'

- - - - -


30 changed files:

- dashboard-dependencies/pom.xml
- dashboard/src/main/java/org/onehippo/cms7/essentials/WebUtils.java
- dashboard/src/main/java/org/onehippo/cms7/essentials/plugin/PluginStore.java
- 
dashboard/src/main/java/org/onehippo/cms7/essentials/rest/DocumentResource.java
- − dashboard/src/main/java/org/onehippo/cms7/essentials/rest/JcrResource.java
- − dashboard/src/main/java/org/onehippo/cms7/essentials/rest/NodeResource.java
- dashboard/src/main/java/org/onehippo/cms7/essentials/rest/PluginResource.java
- 
dashboard/src/main/java/org/onehippo/cms7/essentials/rest/picker/JcrBrowserResource.java
- 
dashboard/src/main/java/org/onehippo/cms7/essentials/servlet/DynamicRestPointsApplication.java
- dashboard/src/main/resources/applicationContext.xml
- dashboard/src/main/webapp/js/app.js
- plugin-sdk/api/pom.xml
- 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/ctx/PluginContext.java
- + 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/model/ContentType.java
- 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/model/PluginDescriptor.java
- + 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/model/UserFeedback.java
- − 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/model/Vendor.java
- + 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/service/ContentTypeService.java
- 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/service/ContextXmlService.java
- + 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/service/JcrService.java
- 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/service/LoggingService.java
- 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/service/MavenAssemblyService.java
- 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/service/MavenCargoService.java
- 
plugin-sdk/api/src/main/java/org/onehippo/cms7/essentials/dashboard/service/ProjectService.java
- 
dashboard/src/test/java/org/onehippo/cms7/essentials/rest/model/PluginDescriptorTest.java
 → 
plugin-sdk/api/src/test/java/org/onehippo/cms7/essentials/dashboard/model/PluginDescriptorTest.java
- plugin-sdk/implementation/pom.xml
- 
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/ctx/DefaultPluginContext.java
- 
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/instruction/CndInstruction.java
- 
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/instruction/NodeFolderInstruction.java
- 
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/instruction/TranslationsInstruction.java


The diff was not included because it is too large.


View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-essentials/compare/40190f3e6d9434b2fd153e7cb2860885aa28662d...40b3b77dcf4df1db952da3a7d678b9e30669a1e5

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-essentials/compare/40190f3e6d9434b2fd153e7cb2860885aa28662d...40b3b77dcf4df1db952da3a7d678b9e30669a1e5
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to