RM-2585. Super-basic CaveatSchemeService.

This checkin is so simple that no test code is yet needed.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/caveatmarkdatatype@114424 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2015-10-15 10:41:24 +00:00
parent b1dc644ebd
commit 29e74d6460
3 changed files with 134 additions and 0 deletions

View File

@@ -30,4 +30,48 @@
<constructor-arg ref="attributeService"/>
<constructor-arg ref="caveatDAO"/>
</bean>
<bean id="caveatSchemeService"
class="org.alfresco.module.org_alfresco_module_rm.caveat.scheme.CaveatSchemeServiceImpl"
parent="baseService">
<property name="caveatDAO" ref="caveatDAOFromJSON"/>
</bean>
<bean id="CaveatSchemeService" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>org.alfresco.module.org_alfresco_module_rm.caveat.scheme.CaveatSchemeService</value>
</property>
<property name="target">
<ref bean="caveatSchemeService"/>
</property>
<property name="interceptorNames">
<list>
<idref local="CaveatSchemeService_transaction"/>
<idref bean="exceptionTranslator"/>
<idref local="CaveatSchemeService_security"/>
</list>
</property>
</bean>
<bean id="CaveatSchemeService_transaction" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="*">${server.transaction.mode.default}</prop>
</props>
</property>
</bean>
<bean id="CaveatSchemeService_security" parent="baseSecurity">
<property name="objectDefinitionSource">
<value>
org.alfresco.module.org_alfresco_module_rm.caveat.scheme.CaveatSchemeService.existsCaveatGroup=ACL_ALLOW
org.alfresco.module.org_alfresco_module_rm.caveat.scheme.CaveatSchemeService.getCaveatGroup=ACL_ALLOW
org.alfresco.module.org_alfresco_module_rm.caveat.scheme.CaveatSchemeService.getCaveatGroups=ACL_ALLOW
org.alfresco.module.org_alfresco_module_rm.caveat.scheme.CaveatSchemeService.*=ACL_DENY
</value>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,40 @@
/*
* Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.caveat.scheme;
import java.util.Set;
public interface CaveatSchemeService
{
/**
* Indicates whether a named caveat group exists or not.
*/
boolean existsCaveatGroup(String id);
/**
* Gets a set of all the available caveat groups
*/
Set<CaveatGroup> getCaveatGroups();
/**
* Gets a caveat group by its unique id.
*/
CaveatGroup getCaveatGroup(String id);
}

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.caveat.scheme;
import org.alfresco.module.org_alfresco_module_rm.caveat.dao.CaveatDAOInterface;
import java.util.HashSet;
import java.util.Set;
public class CaveatSchemeServiceImpl implements CaveatSchemeService
{
private CaveatDAOInterface caveatDAO;
public void setCaveatDAO(CaveatDAOInterface caveatDAO)
{
this.caveatDAO = caveatDAO;
}
@Override public boolean existsCaveatGroup(String id)
{
return caveatDAO.getCaveatGroups().containsKey(id);
}
@Override public Set<CaveatGroup> getCaveatGroups()
{
return new HashSet<>(caveatDAO.getCaveatGroups().values());
}
@Override public CaveatGroup getCaveatGroup(String id)
{
return caveatDAO.getCaveatGroups().get(id);
}
}