Skip to content

Commit

Permalink
Adding support for Slf4j Redpill-Linpro#4
Browse files Browse the repository at this point in the history
  • Loading branch information
bhagyas committed Oct 19, 2024
1 parent 62b8688 commit e3200eb
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ Authors

Marcus Svartmark - Redpill Linpro AB


Contributors
-------
Bhagya Silva - Loftux AB

Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.redpill.alfresco.numbering.decorator.Decorator;
import org.redpill.alfresco.numbering.storage.NumberingStorage;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

import org.slf4j.LoggerFactory;
/**
* This component handles numbering of objects
*
Expand All @@ -26,7 +26,7 @@
*/
public class NumberingComponentImpl implements NumberingComponent, InitializingBean {

private static final Logger LOG = Logger.getLogger(NumberingComponentImpl.class);
private static final Logger LOG = LoggerFactory.getLogger(NumberingComponentImpl.class);

protected Repository repositoryHelper;
protected NodeService nodeService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package org.redpill.alfresco.numbering.policy;

import java.io.Serializable;
import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.copy.CopyBehaviourCallback;
import org.alfresco.repo.copy.CopyDetails;
import org.alfresco.repo.copy.DefaultCopyBehaviourCallback;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy;
import org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
Expand All @@ -22,14 +19,18 @@
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.apache.log4j.Logger;
import org.redpill.alfresco.numbering.component.NumberingComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

import java.io.Serializable;
import java.util.Map;

public abstract class AbstractNumberingPolicy implements NumberingPolicy, OnAddAspectPolicy, OnMoveNodePolicy, InitializingBean {

private static final Logger LOG = Logger.getLogger(AbstractNumberingPolicy.class);
private static final Logger LOG = LoggerFactory.getLogger(AbstractNumberingPolicy.class);

protected PolicyComponent policyComponent;
protected NodeService nodeService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;

public class SampleNumberingPolicy extends AbstractNumberingPolicy implements InitializingBean {

private static final Logger LOG = Logger.getLogger(SampleNumberingPolicy.class);
private static final Logger LOG = LoggerFactory.getLogger(SampleNumberingPolicy.class);

@Override
protected boolean allowUpdate(final NodeRef nodeRef) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.service.cmr.attributes.AttributeService;
import org.alfresco.service.namespace.QName;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

Expand All @@ -16,7 +17,7 @@
*/
public class AttributeNumberingStorageImpl implements NumberingStorage, InitializingBean {

private static final Logger LOG = Logger.getLogger(AttributeNumberingStorageImpl.class);
private static final Logger LOG = LoggerFactory.getLogger(AttributeNumberingStorageImpl.class);

protected static long DEFAULT_LOCK_TTL = 30000L;
protected ThreadLocal<String> lockThreadLocal = new ThreadLocal<String>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package org.redpill.alfresco.numbering.storage;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.lock.JobLockService;
Expand All @@ -17,10 +13,16 @@
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* Store numbers using node service. This is well tested and cluster safe.
*
Expand All @@ -32,7 +34,7 @@ public class NodeNumberingStorageImpl implements NumberingStorage, InitializingB
protected static final String NUMBERING_FOLDER_NAME = "Numbering";
private static final QName NUMBERING_FOLDER_QNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, NUMBERING_FOLDER_NAME);
protected static final QName NUMBERING_PROPERTY = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "counterValue");
private static final Logger LOG = Logger.getLogger(NodeNumberingStorageImpl.class);
private static final Logger LOG = LoggerFactory.getLogger(NodeNumberingStorageImpl.class);

protected static long DEFAULT_LOCK_TTL = 30000L;
protected ThreadLocal<String> lockThreadLocal = new ThreadLocal<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.site.SiteInfo;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.redpill.alfresco.numbering.component.NumberingComponent;
Expand All @@ -24,7 +24,7 @@
*/
public class NumberingComponentIntegrationTest extends AbstractRepoIntegrationTest {

private static final Logger LOG = Logger.getLogger(NumberingComponentIntegrationTest.class);
private static final Logger LOG = LoggerFactory.getLogger(NumberingComponentIntegrationTest.class);

private static final String DEFAULT_USERNAME = "testuser_" + System.currentTimeMillis();

Expand Down

0 comments on commit e3200eb

Please sign in to comment.