cancel
Showing results for 
Search instead for 
Did you mean: 

Open Search API's availability

sergio
Champ in-the-making
Champ in-the-making
Hi all.

Here I come back!

Is there any avaliability of Java API's for executing queries against federated repositories and, more in general, against repositories implemented as Open Source servers?

I need to query multiple instances of Alfresco, getting data from them and then aggregate results in a standard and unique way.

After downloading the alfresco-community-sdk-2.0.0 I navigated a little through new Java API's and I found something new and interesting about the Open Source standard, in particular inside the web-client-src.zip file I can find the OpenSearchElementReader.java and others. Are these useful classes for implementing federated searching inside an application?

Whar about the web-service-apis?

Many thanks to all.

All the best.

Sergio
7 REPLIES 7

kevinr
Star Contributor
Star Contributor
There is more information on the Alfresco REST APIs here:
http://wiki.alfresco.com/wiki/REST
http://wiki.alfresco.com/wiki/OpenSearch

The first cut of the API is available in 2.0, but in 2.1 it will be expanded.

Thanks,

Kevin

sergio
Champ in-the-making
Champ in-the-making
Thanks Kevin, a further clarification about REST.

If I try to get the list of all APIs writing the URL http://pulcino:8081/alfresco/service/index

an exception occurs, the following:

org.alfresco.web.api.APIException: Failed to process format 'html'
caused by:
org.alfresco.service.cmr.repository.TemplateException: Error during processing of the template 'Expression service.defaultFormat is undefined on line 21, column 175 in Services_view_html.ftl.'. Please contact your system administrator.
caused by:
freemarker.core.InvalidReferenceException: Expression service.defaultFormat is undefined on line 21, column 175 in Services_view_html.ftl.

Details:

org.alfresco.web.api.APIException: Failed to process format 'html'
at org.alfresco.web.api.services.APIServiceTemplateImpl.execute(APIServiceTemplateImpl.java:86)
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:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.alfresco.web.api.ServiceLogger.invoke(ServiceLogger.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy93.execute(Unknown Source)
at org.alfresco.web.api.APIServlet.service(APIServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.alfresco.service.cmr.repository.TemplateException: Error during processing of the template 'Expression service.defaultFormat is undefined on line 21, column 175 in Services_view_html.ftl.'. Please contact your system administrator.
at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:216)
at org.alfresco.web.api.services.APIServiceImpl.renderTemplate(APIServiceImpl.java:229)
at org.alfresco.web.api.services.APIServiceTemplateImpl.renderTemplate(APIServiceTemplateImpl.java:119)
at org.alfresco.web.api.services.APIServiceTemplateImpl.execute(APIServiceTemplateImpl.java:82)
… 27 more
Caused by: freemarker.core.InvalidReferenceException: Expression service.defaultFormat is undefined on line 21, column 175 in Services_view_html.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.getStringValue(Expression.java:118)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:172)
at freemarker.core.Environment.visit(Environment.java:351)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:212)
… 30 more

So I am not able to get the list of all APIs.

Any suggestion?

davidc
Star Contributor
Star Contributor
The OpenSearch APIs are just HTTP requests.  They respond with ATOM/RSS.  So, you can any Java library for ATOM/RSS feed processing such as ROME.

The /service/index exception may be a bug in v2.0.  This area has been revamped in v2.1, with the introduction of Web Scripts - http://wiki.alfresco.com/wiki/Web_Scripts

sergio
Champ in-the-making
Champ in-the-making
Once again, thanks for replying.

Maybe, you answer is the most interesting one for me because I was searching some simple Java APIs for managing OpenSearch HTTP requests. I took a look at OpenSearch web site where a list of APIs are available for managing ATOM and RSS feeds such as Drupal, Lucene and others. I will take a look at ROME, too.

Many thanks for your suggestion.

My interest in your OpenSearch adoption comes from our project needs (http://www.gebbalab.com) to federate many Alfresco repositories customized for managing clinical and genomic data and metadata. Our main purpose consists of creating a "like GRID platform" in order to share and exchange both clinical and genomic data among many labs and health care providers.

In the past I collaborated with Roy Wetherall from your Alfresco team in order to create a new type of metadata extractor that now it is ready to use. I will complete the extension documentation on wiki soon.

Only one other question for you of fundamental importance for me: what about the federated search user authorities?

Let me explain better the problem.

I have two instance of Alfresco 2.0, let say ALF_01 and ALF_02.
Each Alfresco repository is configured for two different labs for managing microarray data, so the structure is the same for each repo.
For ALF_01 I have a user USER_01 and for ALF_02 I have a user USER_02. So users are different for the two repositories.

USER_01 needs to execute a distribuited search against ALF_01 and ALF_02 but not as a GUEST user. Is it possible using the default installation  of each Alfresco repositories? I think that USER_01 is not allowed to execute searches against ALF_02 because it is not a registrered user for that Alfresco installation, is he? In your opinion, what is the best way to approach this kind of problem?

Any suggestion from you will be very appreciated.

Looking forward to hearing from you soon,


Sergio

davidc
Star Contributor
Star Contributor
If USER01 is not registered in ALF02, then USER01 will not be able to see any docs in ALF02.  Basically, permissions will not have been granted.  Of course, if they login as guest, they can see everything granted to guest.

In v2.0, you have to authenticate against each repo you wish to search.

Potentially, you could share a single user directory (e.g. LDAP) amongst several repos.  You'd still have to ensure appropriate permissions are set in each repo.

sergio
Champ in-the-making
Champ in-the-making
Many thanks David.

I am going to explore better the your suggestion about sharing a single user directory such as LDAP.

All the best,

Sergio

alfuserkumar
Champ in-the-making
Champ in-the-making
Hi,

Does Alfresco (ECM or WCM) support Federated repositories?
I came to know that Alfresco supports Federated Search: http://www.alfresco.com/products/docs/releases/2.0/ecm/ but whereas I am specifically interested to know more about Federated repositories:

I came to know that the Federated Repository has not been implemented yet as per the WIKI document here: http://wiki.alfresco.com/wiki/Alfresco_Repository_Architecture  Option #5, but not sure about recent releases!

Any updates/comments are greatly appreciated.

Thanks,
Kumar