04-19-2011 10:05 AM
…
private FileFolderService fileFolderService;
private NodeService nodeService;
public static StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
@Override
public void afterPropertiesSet() throws Exception {
try {
AuthenticationUtil.runAs(new RunAsWork<String>() {
@SuppressWarnings("synthetic-access")
public String doWork() throws Exception {
List<StoreRef> stores = nodeService.getStores(); //can't get nothing
return "";
}
}, "admin");
} catch (Exception e) {…}
14:57:10,762 ERROR [cz.xxx.web.bean.DeadlineBean] java.lang.UnsupportedOperationException: Can not find {http://www.alfresco.org/model/system/1.0}base.ReadProperties
at org.alfresco.repo.security.permissions.impl.model.PermissionModel.getPermissionReference(PermissionModel.java:1250)
at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.getPermissionReference(PermissionServiceImpl.java:926)
at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.hasPermission(PermissionServiceImpl.java:946)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy22.hasPermission(Unknown Source)
at org.alfresco.repo.security.permissions.impl.acegi.ACLEntryVoter.vote(ACLEntryVoter.java:431)
at net.sf.acegisecurity.vote.AffirmativeBased.decide(AffirmativeBased.java:69)
at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:394)
at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:43)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:135)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy10.getRootNode(Unknown Source)
at cz.xxx.web.bean.DeadlineBean.afterPropertiesSet(DeadlineBean.java:99)
…
04-19-2011 10:35 AM
04-20-2011 05:35 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Registration of new models –>
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/fakturyModel.xml</value>
</list>
</property>
</bean>
<bean id="DeadlineBean" class="cz.xxx.web.bean.DeadlineBean">
<property name="contentService">
<ref bean="ContentService" />
</property>
<property name="authenticationService">
<ref bean="AuthenticationService" />
</property>
<property name="nodeService">
<ref bean="NodeService" />
</property>
<property name="fileFolderService">
<ref bean="FileFolderService" />
</property>
</bean>
</beans>
package cz.xxx.web.bean;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.web.bean.BrowseBean;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.InitializingBean;
public class DeadlineBean implements InitializingBean{
private Map<String, String> deadline_firmy=new HashMap<String,String>();
private FileFolderService fileFolderService;
private NodeService nodeService;
private AuthenticationService authenticationService;
private ContentService contentService;
private static Logger logger = Logger.getLogger(DeadlineBean.class);
public static StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
public DeadlineBean() {
deadline_firmy.put("TITLE1", "3"); //test code, in future
deadline_firmy.put("TITLE2", "1");//the map will be filled from xml
if (logger.isDebugEnabled()) {
logger.debug("TEST start");
}
}
public void setFileFolderService(FileFolderService fileFolderService) {
this.fileFolderService = fileFolderService;
}
public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}
public void setDeadline_firmy(Map<String,String> deadline_firmy) {
this.deadline_firmy = deadline_firmy;
}
public Map<String,String> getDeadline_firmy() {
return deadline_firmy;
}
public void setAuthenticationService(AuthenticationService authenticationService) {
this.authenticationService = authenticationService;
}
public void setContentService(ContentService contentService) {
this.contentService = contentService;
}
@Override
public void afterPropertiesSet() throws Exception {
try {
if (logger.isDebugEnabled()) {
logger.debug(SPACES_STORE.toString());
}
AuthenticationUtil.runAs(new RunAsWork<String>() {
@SuppressWarnings("synthetic-access")
public String doWork() throws Exception {
List<StoreRef> stores = nodeService.getStores();
return "";
}
}, "admin");
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.error("error" + e.toString());
StringWriter sWriter = new StringWriter();
e.printStackTrace(new PrintWriter(sWriter));
logger.error(sWriter.getBuffer().toString());
}
}
if (logger.isDebugEnabled()) {
logger.debug("TEST after");
}
}
}
<m:deadlineImg id="col10-deadline" value="/alfresco/images/icons/button_red.png" deadlineTime='#{DeadlineBean.deadline_firmy[r.title]}' startDeadline="#{r.properties['sg_fa:deadline']}" style="padding-left: 3px"/>
04-27-2011 06:28 AM
10-28-2011 06:44 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.