[HippoCMS-scm] [Git][cms-community/hippo-jackrabbit] Pushed new tag jackrabbit-2.12.5
Ate Douma pushed new tag jackrabbit-2.12.5 at cms-community / hippo-jackrabbit ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-jackrabbit][2.8] JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostic…
Ate Douma pushed to branch 2.8 at cms-community / hippo-jackrabbit Commits: 901a4fb4 by Julian Reschke at 2016-10-24T13:49:49+00:00 JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostics by not using ConcurrentHashMap as its not needed here anyway (ported to 2.8) git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.8@1766407 13f79535-47bb-0310-9956-ffa450edef68 - - - - - 1 changed file: - jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java Changes: = jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java = --- a/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java +++ b/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; import javax.jcr.NamespaceRegistry; import javax.jcr.PropertyType; @@ -603,8 +602,8 @@ public class NodeTypeRegistryImpl implements NodeTypeRegistry, EffectiveNodeType private class NodeTypeDefinitionMap implements Map{ // map of node type names and node type definitions -private final ConcurrentHashMap nodetypeDefinitions = -new ConcurrentHashMap (); +private Map nodetypeDefinitions = +new HashMap (); private Collection getValues() { return nodetypeDefinitions.values(); View it on GitLab: https://code.onehippo.org/cms-community/hippo-jackrabbit/commit/901a4fb43582c38942bed56954a8c8fffa653f4b ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-jackrabbit][trunk] 2 commits: JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostic…
Ate Douma pushed to branch trunk at cms-community / hippo-jackrabbit Commits: 1b6ba625 by Julian Reschke at 2016-10-24T12:11:56+00:00 JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostics by not using ConcurrentHashMap as its not needed here anyway git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1766398 13f79535-47bb-0310-9956-ffa450edef68 - - - - - 3aa270e4 by Julian Reschke at 2016-10-25T16:49:45+00:00 JCR-4033: Session leak in case of an exception inside the constructor of SessionImpl ack: Nicolas Filotto git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1766557 13f79535-47bb-0310-9956-ffa450edef68 - - - - - 2 changed files: - jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java - jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java Changes: = jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java = --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java @@ -219,7 +219,7 @@ public class SessionImpl extends AbstractSession * The stack trace knows who opened this session. It is logged * if the session is finalized, but Session.logout() was never called. */ -private Exception openStackTrace = new Exception("Stack Trace"); +private final Exception openStackTrace; /** * Protected constructor. @@ -267,14 +267,16 @@ public class SessionImpl extends AbstractSession this.sessionName = "session-" + count; } -namePathResolver = new DefaultNamePathResolver(this, this, true); -context.setItemStateManager(createSessionItemStateManager()); -context.setItemManager(createItemManager()); -context.setAccessManager(createAccessManager(subject)); -context.setObservationManager( -createObservationManager(wspConfig.getName())); +this.namePathResolver = new DefaultNamePathResolver(this, this, true); +this.context.setItemStateManager(createSessionItemStateManager()); +this.context.setItemManager(createItemManager()); +this.context.setAccessManager(createAccessManager(subject)); + this.context.setObservationManager(createObservationManager(wspConfig.getName())); -versionMgr = createVersionManager(); +this.versionMgr = createVersionManager(); + +// avoid building the stack trace when it won't be used anyway +this.openStackTrace = log.isWarnEnabled() ? new Exception("Stack Trace") : null; } /** @@ -1363,7 +1365,12 @@ public class SessionImpl extends AbstractSession @Override public void finalize() { if (isLive()) { -log.warn("Unclosed session detected. The session was opened here: ", openStackTrace); +if (openStackTrace != null) { +// Log a warning if and only if openStackTrace is not null +// indicating that the warn level is enabled and the session has +// been fully created +log.warn("Unclosed session detected. The session was opened here: ", openStackTrace); +} logout(); } } = jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java = --- a/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java +++ b/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; import javax.jcr.NamespaceRegistry; import javax.jcr.PropertyType; @@ -603,8 +602,8 @@ public class NodeTypeRegistryImpl implements NodeTypeRegistry, EffectiveNodeType private class NodeTypeDefinitionMap implements Map{ // map of node type names and node type definitions -private final ConcurrentHashMap nodetypeDefinitions = -new ConcurrentHashMap (); +private Map nodetypeDefinitions = +new HashMap (); private Collection getValues() { return nodetypeDefinitions.values(); View it on GitLab: https://code.onehippo.org/cms-community/hippo-jackrabbit/compare/facc45ddd989053da98187f591f82f1d06a21f12...3aa270e45140334fecc1e342771db56bafd4081b ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-jackrabbit][2.10] JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostic…
Ate Douma pushed to branch 2.10 at cms-community / hippo-jackrabbit Commits: cc6b9522 by Julian Reschke at 2016-10-24T13:28:42+00:00 JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostics by not using ConcurrentHashMap as its not needed here anyway (ported to 2.10) git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.10@1766405 13f79535-47bb-0310-9956-ffa450edef68 - - - - - 1 changed file: - jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java Changes: = jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java = --- a/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java +++ b/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; import javax.jcr.NamespaceRegistry; import javax.jcr.PropertyType; @@ -603,8 +602,8 @@ public class NodeTypeRegistryImpl implements NodeTypeRegistry, EffectiveNodeType private class NodeTypeDefinitionMap implements Map{ // map of node type names and node type definitions -private final ConcurrentHashMap nodetypeDefinitions = -new ConcurrentHashMap (); +private Map nodetypeDefinitions = +new HashMap (); private Collection getValues() { return nodetypeDefinitions.values(); View it on GitLab: https://code.onehippo.org/cms-community/hippo-jackrabbit/commit/cc6b952214f294dad8d4aacd0169a8b39b715e7f ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-jackrabbit][2.4] JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostic…
Ate Douma pushed to branch 2.4 at cms-community / hippo-jackrabbit Commits: 8ad57862 by Julian Reschke at 2016-10-24T15:04:34+00:00 JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostics by not using ConcurrentHashMap as its not needed here anyway (ported to 2.4) git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.4@1766418 13f79535-47bb-0310-9956-ffa450edef68 - - - - - 1 changed file: - jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java Changes: = jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java = --- a/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java +++ b/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; import javax.jcr.NamespaceRegistry; import javax.jcr.PropertyType; @@ -603,8 +602,8 @@ public class NodeTypeRegistryImpl implements NodeTypeRegistry, EffectiveNodeType private class NodeTypeDefinitionMap implements Map{ // map of node type names and node type definitions -private final ConcurrentHashMap nodetypeDefinitions = -new ConcurrentHashMap (); +private Map nodetypeDefinitions = +new HashMap (); private Collection getValues() { return nodetypeDefinitions.values(); View it on GitLab: https://code.onehippo.org/cms-community/hippo-jackrabbit/commit/8ad57862f0df52ebb3625ca2258ffa7722105657 ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-jackrabbit][2.6] JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostic…
Ate Douma pushed to branch 2.6 at cms-community / hippo-jackrabbit Commits: 645997ed by Julian Reschke at 2016-10-24T14:39:02+00:00 JCR-4047: NodeTypeRegistryImpl - work around (correct) animal sniffer diagnostics by not using ConcurrentHashMap as its not needed here anyway (ported to 2.6) git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.6@1766415 13f79535-47bb-0310-9956-ffa450edef68 - - - - - 1 changed file: - jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java Changes: = jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java = --- a/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java +++ b/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; import javax.jcr.NamespaceRegistry; import javax.jcr.PropertyType; @@ -603,8 +602,8 @@ public class NodeTypeRegistryImpl implements NodeTypeRegistry, EffectiveNodeType private class NodeTypeDefinitionMap implements Map{ // map of node type names and node type definitions -private final ConcurrentHashMap nodetypeDefinitions = -new ConcurrentHashMap (); +private Map nodetypeDefinitions = +new HashMap (); private Collection getValues() { return nodetypeDefinitions.values(); View it on GitLab: https://code.onehippo.org/cms-community/hippo-jackrabbit/commit/645997ed538ac978a0f45798cc08346f3c3a52ba ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-testsuite][release/2.2] HSTTWO-1003 Bump release version
Arent-Jan Banck pushed to branch release/2.2 at cms-community / hippo-testsuite Commits: a7ad6dff by Arent-Jan Banck at 2016-11-03T00:25:15+01:00 HSTTWO-1003 Bump release version - - - - - 1 changed file: - pom.xml Changes: = pom.xml = --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ org.onehippo.cms7 hippo-cms7-release -10.2.3-SNAPSHOT +10.2.4-SNAPSHOT View it on GitLab: https://code.onehippo.org/cms-community/hippo-testsuite/commit/a7ad6dffc8bc7eeeccb86fe1acb59d1cc12b02ee ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager] Deleted branch feature/visual-editing-psp1-CHANNELMGR-931
Mark Lenser deleted branch feature/visual-editing-psp1-CHANNELMGR-931 at cms-community / hippo-addon-channel-manager ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/visual-editing-psp1-CHANNELMGR-966] 2 commits: CHANNELMGR-966 Remove unused editability check
Tobias Jeger pushed to branch feature/visual-editing-psp1-CHANNELMGR-966 at cms-community / hippo-addon-channel-manager Commits: 69269e87 by Tobias Jeger at 2016-11-02T12:15:29+01:00 CHANNELMGR-966 Remove unused editability check - - - - - dc1b4d77 by Tobias Jeger at 2016-11-02T12:17:57+01:00 CHANNELMGR-966 Remove TODO These two constants are also defined in the CMS API. I considered moving them to the repository and sharing them, but the repository is currently unaware of these resource bundle groups and terminology, and changing the API would be a lot of hassle. I also dont want to depend on the CMS (API) in the content service, so I figured duplicating this here would be the least bad option. - - - - - 2 changed files: - content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/util/EditingUtils.java - content-service/src/main/java/org/onehippo/cms/channelmanager/content/documenttype/util/LocalizationUtils.java Changes: = content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/util/EditingUtils.java = --- a/content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/util/EditingUtils.java +++ b/content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/util/EditingUtils.java @@ -66,7 +66,7 @@ public class EditingUtils { final Session session = handle.getSession(); final Maphints = workflow.hints(); -if (isDocumentEditable(hints, session)) { +if (isActionAvailable(hints, HINT_OBTAIN_EDITABLE_INSTANCE)) { info.setState(EditingInfo.State.AVAILABLE); } else if (hints.containsKey(HINT_IN_USE_BY)) { info.setState(EditingInfo.State.UNAVAILABLE_HELD_BY_OTHER_USER); @@ -80,25 +80,6 @@ public class EditingUtils { return info; } -private static boolean isDocumentEditable(final Map hints, final Session session) { -if ((Boolean) hints.get(HINT_OBTAIN_EDITABLE_INSTANCE)) { -return true; -} - -// TODO: initial tests suggested that once the user has obtained the editable instance of a document, -// the hints would have set the obtainEditableInstance flag to false and the inUseBy flag to the -// current holder (self). Subsequent tests no longer observed this behaviour. Should we keep below -// extra check or not? -if (hints.containsKey(HINT_IN_USE_BY)) { -final String inUseBy = (String) hints.get(HINT_IN_USE_BY); -if (inUseBy.equals(session.getUserID())) { -return true; -} -} - -return false; -} - /** * Check if a document can be updated, given its workflow. * @@ -106,7 +87,7 @@ public class EditingUtils { * @return true if document can be updated, false otherwise */ public static boolean canUpdateDocument(final EditableWorkflow workflow) { -return isHintAvailable(workflow, HINT_COMMIT_EDITABLE_INSTANCE); +return isActionAvailable(workflow, HINT_COMMIT_EDITABLE_INSTANCE); } /** @@ -116,13 +97,13 @@ public class EditingUtils { * @return true if document can be updated, false otherwise */ public static boolean canDeleteDraft(final EditableWorkflow workflow) { -return isHintAvailable(workflow, HINT_DISPOSE_EDITABLE_INSTANCE); +return isActionAvailable(workflow, HINT_DISPOSE_EDITABLE_INSTANCE); } -private static boolean isHintAvailable(final EditableWorkflow workflow, final String hint) { +private static boolean isActionAvailable(final EditableWorkflow workflow, final String action) { try { Map hints = workflow.hints(); -return hints.containsKey(hint) && ((Boolean)hints.get(hint)); +return isActionAvailable(hints, action); } catch (WorkflowException | RemoteException | RepositoryException e) { log.warn("Failed reading hints from workflow", e); @@ -130,6 +111,10 @@ public class EditingUtils { return false; } +private static boolean isActionAvailable(final Map hints, final String action) { +return hints.containsKey(action) && ((Boolean)hints.get(action)); +} + /** * Create and populate a {@link UserInfo}, given a user's ID * @@ -146,8 +131,6 @@ public class EditingUtils { final String firstName = user.getFirstName(); final String lastName = user.getLastName(); -// TODO: Below logic was copied from the org.hippoecm.frontend.plugins.cms.admin.users.User.java -// (hippo-cms-perspectives). Move this logic into the repository's User class to be able to share it? StringBuilder sb = new
[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/visual-editing-psp1-CHANNELMGR-966] 2 commits: CHANNELMGR-966 Remove session refresh invocations
Tobias Jeger pushed to branch feature/visual-editing-psp1-CHANNELMGR-966 at cms-community / hippo-addon-channel-manager Commits: 217cbe5f by Tobias Jeger at 2016-11-02T11:43:13+01:00 CHANNELMGR-966 Remove session refresh invocations After discussing the current use of session.refresh() with Ate and Ard, we concluded that we can best document the session to be invocation scoped, i.e. the session is created before the invocation of a DocumentsService or DocumentTypesService method, and avoid the session.refresh() calls, as they consume quite some performance. - - - - - 5302ccf5 by Tobias Jeger at 2016-11-02T11:43:43+01:00 CHANNELMGR-966 Delete unused error code - - - - - 4 changed files: - content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsService.java - content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsServiceImpl.java - content-service/src/main/java/org/onehippo/cms/channelmanager/content/documenttype/DocumentTypesService.java - content-service/src/main/java/org/onehippo/cms/channelmanager/content/error/ErrorInfo.java Changes: = content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsService.java = --- a/content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsService.java +++ b/content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsService.java @@ -36,7 +36,7 @@ public interface DocumentsService { * If all goes well, the document's content is returned. * * @param uuidUUID of the requested document (handle) - * @param session user-authenticated JCR session for reading from the repository + * @param session user-authenticated, invocation-scoped JCR session * @returnJSON-serializable representation of the parts supported for exposing * @throws ErrorWithPayloadException *If creation of the draft failed @@ -48,7 +48,8 @@ public interface DocumentsService { * * @param uuid UUID of the document to be updated * @param document Document containing the to-be-persisted content - * @param session user-authenticated JCR session for writing to the repository + * @param session user-authenticated, invocation-scoped JCR session. + * In case of a bad request, changes may be pending. * @throws ErrorWithPayloadException * If updating the draft failed */ @@ -58,7 +59,7 @@ public interface DocumentsService { * Delete the draft version of a document, such that it is available for others to edit. * * @param uuidUUID of the document for which to delete the draft - * @param session user-authenticated JCR session for writing to the repository + * @param session user-authenticated, invocation-scoped JCR session * @throws ErrorWithPayloadException *If deleting the draft failed */ @@ -68,7 +69,7 @@ public interface DocumentsService { * Read the published variant of a document * * @param uuidUUID of the requested document (handle) - * @param session user-authenticated JCR session for reading from the repository + * @param session user-authenticated, invocation-scoped JCR session * @returnJSON-serializable representation of the parts supported for exposing * @throws ErrorWithPayloadException *If retrieval of the live document failed = content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsServiceImpl.java = --- a/content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsServiceImpl.java +++ b/content-service/src/main/java/org/onehippo/cms/channelmanager/content/document/DocumentsServiceImpl.java @@ -97,7 +97,6 @@ public class DocumentsServiceImpl implements DocumentsService { if (writeFields(document, draft, docType)) { persistChangesAndKeepEditing(session, workflow); } else { -cancelPendingChanges(session); throw new BadRequestException(); // TODO: report per-field errors? } } @@ -114,7 +113,6 @@ public class DocumentsServiceImpl implements DocumentsService { try { workflow.disposeEditableInstance(); -session.refresh(false); // TODO: should we use 'true' instead? } catch (WorkflowException | RepositoryException | RemoteException e) { log.warn("Failed to dispose of editable instance", e); throw new InternalServerErrorException(); @@ -181,14 +179,6 @@ public class DocumentsServiceImpl implements DocumentsService { return errors == 0; } -private void cancelPendingChanges(final Session
[HippoCMS-scm] [Git][cms-community/hippo-site-toolkit] Deleted branch feature/HSTTWO-3851
Tobias Jeger deleted branch feature/HSTTWO-3851 at cms-community / hippo-site-toolkit ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-site-toolkit][master] 3 commits: HSTTWO-3851 Channel exposes customized viewport width map
Tobias Jeger pushed to branch master at cms-community / hippo-site-toolkit Commits: 65cfa83c by Tobias Jeger at 2016-11-02T09:53:00+01:00 HSTTWO-3851 Channel exposes customized viewport width map - - - - - cc0c839a by Tobias Jeger at 2016-11-02T10:44:54+01:00 HSTTWO-3851 Guard viewport map parsing against too large numbers - - - - - 54d28c11 by Tobias Jeger at 2016-11-02T11:25:34+01:00 HSTTWO-3851 Reintegrate feature/HSTTWO-3851 - - - - - 1 changed file: - api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java Changes: = api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java = --- a/api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java +++ b/api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java @@ -23,10 +23,17 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Channel implements Serializable { +private static final Logger log = LoggerFactory.getLogger(Channel.class); private static final long serialVersionUID = 1L; +private static final Pattern VIEWPORT_PATTERN = Pattern.compile("^([^:]+):(\\d+)(px)?$"); public static final String DEFAULT_DEVICE = "default"; @@ -60,6 +67,7 @@ public class Channel implements Serializable { private Set changedBySet = new HashSet<>(); private String defaultDevice = DEFAULT_DEVICE; private List devices = Collections.emptyList(); +private MapviewportMap = new HashMap<>(); private boolean isPreview; private String channelNodeLockedBy; private String lastModifiedBy; @@ -116,6 +124,7 @@ public class Channel implements Serializable { changedBySet = channel.changedBySet; defaultDevice = channel.defaultDevice; devices = channel.devices; +viewportMap = channel.viewportMap; isPreview = channel.isPreview(); channelNodeLockedBy = channel.channelNodeLockedBy; lastModifiedBy = channel.lastModifiedBy; @@ -362,6 +371,25 @@ public class Channel implements Serializable { public void setDevices(List devices) { this.devices = devices; + +populateViewportMap(); +} + +private void populateViewportMap() { +for (String device : devices) { +final Matcher m = VIEWPORT_PATTERN.matcher(device); +if (m.matches()) { +try { +viewportMap.put(m.group(1), Integer.valueOf(m.group(2))); +} catch (NumberFormatException e) { +log.warn("Failed to parse Integer {}", m.group(2), e); +} +} +} +} + +public Map getViewportMap() { +return viewportMap; } public void setPreview(final boolean preview) { View it on GitLab: https://code.onehippo.org/cms-community/hippo-site-toolkit/compare/4bd450ee1af9f21a20b78ecc0723cc3e200a31b2...54d28c113a1b1d7ef00d412cecfc51ddc22a56b2 ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-site-toolkit] Deleted branch bugfix/HSTTWO-3853
Ard Schrijvers deleted branch bugfix/HSTTWO-3853 at cms-community / hippo-site-toolkit ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-site-toolkit][master] HSTTWO-3853 Make sure JcrHippoRepository#initHippoRepository is never concurrently executed
Ard Schrijvers pushed to branch master at cms-community / hippo-site-toolkit Commits: 4bd450ee by Ard Schrijvers at 2016-11-01T17:09:43+01:00 HSTTWO-3853 Make sure JcrHippoRepository#initHippoRepository is never concurrently executed - - - - - 2 changed files: - components/core/src/main/resources/org/hippoecm/hst/site/container/SpringComponentManager-observation.xml - components/session-pool/src/main/java/org/hippoecm/hst/core/jcr/pool/JcrHippoRepository.java Changes: = components/core/src/main/resources/org/hippoecm/hst/site/container/SpringComponentManager-observation.xml = --- a/components/core/src/main/resources/org/hippoecm/hst/site/container/SpringComponentManager-observation.xml +++ b/components/core/src/main/resources/org/hippoecm/hst/site/container/SpringComponentManager-observation.xml @@ -43,7 +43,7 @@ - + = components/session-pool/src/main/java/org/hippoecm/hst/core/jcr/pool/JcrHippoRepository.java = --- a/components/session-pool/src/main/java/org/hippoecm/hst/core/jcr/pool/JcrHippoRepository.java +++ b/components/session-pool/src/main/java/org/hippoecm/hst/core/jcr/pool/JcrHippoRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2015 Hippo B.V. (http://www.onehippo.com) + * Copyright 2008-2016 Hippo B.V. (http://www.onehippo.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,36 +97,38 @@ public class JcrHippoRepository implements Repository { this.hstJmvEnabledUsers = hstJmvEnabledUsers; } -private synchronized void initHippoRepository() throws RepositoryException { -if (repositoryInitialized) { -return; -} +private void initHippoRepository() throws RepositoryException { +synchronized (JcrHippoRepository.class) { +if (repositoryInitialized) { +return; +} -try { -log.info("Trying to get hippo repository from {}.", repositoryURI); - -if (StringUtils.isEmpty(repositoryURI)) { -hippoRepository = HippoRepositoryFactory.getHippoRepository(); -} else if (repositoryURI.startsWith("java:")) { -InitialContext ctx = new InitialContext(); -Object repositoryObject = ctx.lookup(repositoryURI); - -if (repositoryObject instanceof Repository) { -jcrDelegateeRepository = (Repository) repositoryObject; -} else if (repositoryObject instanceof HippoRepository) { -hippoRepository = (HippoRepository) repositoryObject; +try { +log.info("Trying to get hippo repository from {}.", repositoryURI); + +if (StringUtils.isEmpty(repositoryURI)) { +hippoRepository = HippoRepositoryFactory.getHippoRepository(); +} else if (repositoryURI.startsWith("java:")) { +InitialContext ctx = new InitialContext(); +Object repositoryObject = ctx.lookup(repositoryURI); + +if (repositoryObject instanceof Repository) { +jcrDelegateeRepository = (Repository)repositoryObject; +} else if (repositoryObject instanceof HippoRepository) { +hippoRepository = (HippoRepository)repositoryObject; +} else { +throw new RepositoryException("Unknown repository object from " + repositoryURI + ": " + repositoryObject); +} } else { -throw new RepositoryException("Unknown repository object from " + repositoryURI + ": " + repositoryObject); +hippoRepository = HippoRepositoryFactory.getHippoRepository(repositoryURI); } -} else { -hippoRepository = HippoRepositoryFactory.getHippoRepository(repositoryURI); -} -log.info("Has retrieved hippo repository from {}.", repositoryURI); -} catch (Exception e) { -throw new RepositoryException(e); -} finally { -repositoryInitialized = (jcrDelegateeRepository != null || hippoRepository != null); +log.info("Has retrieved hippo repository from {}.", repositoryURI); +} catch (Exception e) { +throw new RepositoryException(e); +} finally { +repositoryInitialized = (jcrDelegateeRepository != null || hippoRepository != null); +} } } View it on GitLab: https://code.onehippo.org/cms-community/hippo-site-toolkit/commit/4bd450ee1af9f21a20b78ecc0723cc3e200a31b2 ___ Hippocms-svn mailing list
[HippoCMS-scm] [Git][cms-community/hippo-site-toolkit][feature/HSTTWO-3851] HSTTWO-3851 Guard viewport map parsing against too large numbers
Tobias Jeger pushed to branch feature/HSTTWO-3851 at cms-community / hippo-site-toolkit Commits: cc0c839a by Tobias Jeger at 2016-11-02T10:44:54+01:00 HSTTWO-3851 Guard viewport map parsing against too large numbers - - - - - 1 changed file: - api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java Changes: = api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java = --- a/api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java +++ b/api/src/main/java/org/hippoecm/hst/configuration/channel/Channel.java @@ -26,8 +26,12 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class Channel implements Serializable { +private static final Logger log = LoggerFactory.getLogger(Channel.class); private static final long serialVersionUID = 1L; private static final Pattern VIEWPORT_PATTERN = Pattern.compile("^([^:]+):(\\d+)(px)?$"); @@ -375,7 +379,11 @@ public class Channel implements Serializable { for (String device : devices) { final Matcher m = VIEWPORT_PATTERN.matcher(device); if (m.matches()) { -viewportMap.put(m.group(1), Integer.valueOf(m.group(2))); +try { +viewportMap.put(m.group(1), Integer.valueOf(m.group(2))); +} catch (NumberFormatException e) { +log.warn("Failed to parse Integer {}", m.group(2), e); +} } } } View it on GitLab: https://code.onehippo.org/cms-community/hippo-site-toolkit/commit/cc0c839ad2b08ad14caa4420647212059fe1b161 ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn
[HippoCMS-scm] [Git][cms-community/hippo-site-toolkit] Pushed new branch feature/HSTTWO-3851
Tobias Jeger pushed new branch feature/HSTTWO-3851 at cms-community / hippo-site-toolkit ___ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn