cancel
Showing results for 
Search instead for 
Did you mean: 

tenant admin webservices

msj4u
Champ in-the-making
Champ in-the-making
Hi,

I am using alfresco for storing the documents in the repository; using webservice client from my application.

Now I have to create the tenants from my application

SO

I want to utilize all or most of the functionality of tenant admin console (http://localhost:8080/alfresco/faces/jsp/admin/tenantadmin-console.jsp)


spending a day I cant find any thing related to web service but i did got following classes

- Alfresco/projects/repository/source/java/org/alfresco/repo/tenant/TenantAdminService.java
- Alfresco/projects/repository/source/java/org/alfresco/repo/tenant/MultiTAdminServiceImpl.java


Please advise.
10 REPLIES 10

mrogers
Star Contributor
Star Contributor
MT is not exposed via web services.

msj4u
Champ in-the-making
Champ in-the-making
Thanks

so can you guide me in a direction from where i should get some help ?

kaynezhang
World-Class Innovator
World-Class Innovator
You can use tenant admin webscript api
/alfresco/service/api/tenants/***

msj4u
Champ in-the-making
Champ in-the-making
hitting



Alfresco    Web Script Status 404 - Not Found

The Web Script /alfresco/service/api/tenants/*** has responded with a status of 404 - Not Found.

404 Description:   Requested resource is not available.

Message:   09240008 Script url /api/tenants/*** does not map to a Web Script.
   
Exception:   org.springframework.extensions.webscripts.WebScriptException - 09240008 Script url /api/tenants/*** does not map to a Web Script.
   
   org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:173)
   org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
   org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
   org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
   org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
   org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   java.lang.Thread.run(Thread.java:724)
   
Server:   Community v4.2.0 (@build-number@) schema 6,022
Time:   Oct 24, 2013 10:08:06 AM


but http://localhost:8080/alfresco/service/ did gave me the listing and that doesnt contains the tenant related stuff; so mrogers is right

kaynezhang
World-Class Innovator
World-Class Innovator
By /alfresco/service/api/tenants/*** I mean a bundle of webscript api
for examle
delete tenant

DELETE /alfresco/service/api/tenants/{tenantDomain}

Get Tenants

GET /alfresco/service/api/tenants


Create Tenant

POST /alfresco/service/api/tenants

Open your browser and visit http://localhost:8080/alfresco/service/index/all (input admin username and password if needed) ,and search  with keyword "Package: /org/alfresco/repository/tenant " you 'll get all tenant webscript api information.


msj4u
Champ in-the-making
Champ in-the-making
yes

hitting <blockcode>http://localhost:8080/alfresco/service/api/tenants</blockcode> should give me the listing of all tenants. correct ? but instead it gives me


The Web Script /alfresco/service/api/tenants has responded with a status of 404 - Not Found.

404 Description:   Requested resource is not available.

Message:   09240004 Script url /api/tenants does not map to a Web Script.
   
Exception:   org.springframework.extensions.webscripts.WebScriptException - 09240004 Script url /api/tenants does not map to a Web Script.


I think there is some other problem as well; source code that i checked out is of 4.2.c but hitting http://localhost:8080/alfresco/service/index/all gives Community v4.2.0 Smiley Sad

see following

<php>
$ wget –header="Authorization: Basic YWRtaW46YWRtaW4=" http://localhost:8080/alfresco/service/index/all
–2013-10-24 11:13:34–  http://localhost:8080/alfresco/service/index/all
Resolving localhost (localhost)… ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [text/html]
Saving to: `all'

    [ <=>                                                                                                                                            ] 751,863     –.-K/s   in 0.01s

2013-10-24 11:13:34 (56.7 MB/s) - `all' saved [751863]

$ cat all | grep tenant
            <span class="mainSubTitle">Get some node context (nodeRef, tenantDomain, siteId) for given shared_id</span>
$
</php>

msj4u
Champ in-the-making
Champ in-the-making
done

modified the source wrote and exposed the service

rafaelscg
Champ on-the-rise
Champ on-the-rise
Hi msj4u,

How you expose the Tenant service? Could you tell me.
i Have to do exactly what you describe here.

msj4u
Champ in-the-making
Champ in-the-making
if you know how to use/work apache axis 1.x; then you just have to download the code & follow the bread crumbs of the existing services exposed. i chose repository service to expose the tenant.

i made changes in remote-api and webservice-client projects

and bingo its workin