Hi everyone, i'm working with alfresco and i'm making a web page using alfresco , java and spring.
But, my problem now is, i'm trying to call an specific bean from a javascript file and the console show me that my bean is not defined.
For example,
file.post.js
var result = null;
result = TestFiltroImpl.getAllInformes();
module-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="TestFiltroImpl" parent="baseJavaScriptExtension"
class="cl.alemana.dataImpl.TestFiltroImpl">
<property name="extensionName">
<value>TestFiltroImpl</value>
</property>
<property name="serviceRegistry">
<ref bean="ServiceRegistry" />
</property>
</bean>
</beans>
TestFiltroImpl.java
package cl.alemana.dataImpl;
import java.util.List;
import org.alfresco.repo.processor.BaseProcessorExtension;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.namespace.NamespaceService;
import cl.alemana.data.Filtro;
import cl.alemana.data.TestFiltro;
public class TestFiltroImpl extends BaseProcessorExtension{
private ServiceRegistry serviceRegistry;
private NamespaceService namespaceService;
public ServiceRegistry getServiceRegistry() {
return serviceRegistry;
}
public void setServiceRegistry(ServiceRegistry serviceRegistry) {
this.serviceRegistry = serviceRegistry;
}
public List<Filtro> getAllInformes() throws Exception{
TestFiltro tf = new TestFiltro();
return tf.getAllInformes();
}
}
so, maybe exist an specific file.xml where i need declare my beans (and i don't know because i'm new using alfresco) ,
or i need save my module-context.xml file in a specific path in alfresco.
Please help.
Regards!
It seems your bean declaration is right.
How are you deploying your -context.xml file, and where exactly?
Post more information here in order for us to try to help you.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.