Quantcast
Channel: Alfresco Forums - Alfresco API
Viewing all 252 articles
Browse latest View live

Can not connect to a repository

$
0
0

Hello,
I am very new in Alfresco and CMIS.
II tried the firs example of creating a session to a repository.
I created a maven project and I have just a main java class in which I try to create the session.
The problem is that when I try to connect to any repository I got a connection failure.
I have tried
- http://localhost:8181/opencmis/atom/
- http://localhost:8080/alfresco/cmisatom
Even in the case of public Alfresco repository http://cmis.alfresco.com/cmisatom it failes again.
The only case that instead of connection error I got an Unauthorized error is the case of http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom

You will find my code below:
// default factory implementation
SessionFactory factory = SessionFactoryImpl.newInstance();
Map parameter = new HashMap();

// user credentials
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");

// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://cmis.alfresco.com/cmisatom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.REPOSITORY_ID, "97b8bac9-52dd-4667-9d0d-70d0032fddb0");

// create session
Session session = factory.createSession(parameter);

Maybe my question is too trivial but I am really confused.
Thank you in advance
Kind regards,
N3k


Alfresco 5.0.d site creation - error.loggedOut

$
0
0

Hi guys,

I am working on Alfresco shared site creation. I want to use REST API, but I keep stumbling on various problems. The first and main issue is which interface to use??? I am reading forums and googling for 2 days and I found like 4 interfaces and none of them works properly:

    /wcservice/api/sites - doesn't work at all
    /s/api/sites - doesn't work at all
    /alfresco/service/api - works, but only creates site and nothing else
    /share/service/modules/create-site - should be the one to use

So I started to discover secrets of shared site creation. First mystery was to find what the json body looks like. I found this, but I am not sure if it is correct:

{"sitePreset":"site-dashboard","shortName":"Sandbox","title":"Sandbox site","description":"This is a Sandbox site.","visibility":"PRIVATE","isVisible":"false","id":"SANDBOX"}

This kind of worked, but I received error json with message error.loggedOut.
Ok, no problem, I will just log in here /alfresco/service/api/login, ok I have the ticket ,,, and what??? Where should I put the ticket? It is very unclear and nowhere to be found. Someone says put it to json like this:

{"sitePreset":"site-dashboard","shortName":"Sandbox","title":"Sandbox site","description":"This is a Sandbox site.","visibility":"PRIVATE","ticket":"TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df"}

It does not work! Then some says "put it as parameter alf_ticket, ticket or alfTicket" like this:

    /share/service/modules/create-site?ticket=TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df
or
    /share/service/modules/create-site?alf_ticket=TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df
or
    /share/service/modules/create-site?alfTicket=TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df

This does not work either and I keep getting this error json:

{"status":{"code":401,"name":"Unauthorized","description":"The request requires HTTP authentication."},"message":"error.loggedOut","exception":"","callstack":[],"server":"Spring WebScripts - v5.0.0 (Release) schema 1 000","time":"3.9.2015 10:42:27"}

Could someone please tell me how to create shared site or point me somewhere atleast?

Thanks
Roman

5.0.d

getting You do not have the appropriate permissions to perform this operation.

$
0
0

Hii
I m able to upload the file in a particular folder from a specific user in alfresco directly through alfresco web pages , BUt whenever I m try to upload the file in same folder through webservices I m getting warning "You do not have the appropriate permissions to perform this operation." and 0 kb file has uploaded. Can ay body help me what is the issue.

4.0

CMIS Upload Performance

$
0
0

I have a performance problem when uploading a batch of files via CMIS. In several posts, I read that an option to improve the time it would disable indexing on imports through the flag below:

index.tracking.disableInTransactionIndexing=true

However I am in doubt where I do it. I found this flag in two places:
\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\repository.properties
\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\subsystems\Search\luceneindex-recovery.properties

However in ohter post it was mentioned the inclusion of the flag in the file:
alfresco.global.properties.

Where should I change in my case? Can someone explain how does this flag workin each of these locations?

Alfresco installation Windows 8
version 4.2.f

4.2.f
<cmis>

Frederico Americano Linhares

If this post was helpful, please click "mark comment as useful"

Changes in Alfresco 5 API's

$
0
0

Could anyone please let me know regarding which API's have been changed from Alfresco 4.2.f to 5.0.d, and if so, what is actual difference in both versions.
I had look over Alfresco Wiki and forum as well, but couldn't get the required details.

I have verified /alfresco/service/index/uri/ on both versions and it seems like many of web scripts API have been removed in Alfresco 5.

Thanks for your help in advance.

5.0.d

How to delete documents with cm:indexControl aspect ???

$
0
0

Hi all,

I have a very big repository (Alfresco Ent v4.2) where a lot of documents have cm:indexControl aspect with cm:isIndexed=false. These documents were created using WebDcrive client and these represent temporary documents (MS Office temporary documents...).

Now we have to clean repository from these temporary documents (documents with specific extension) but the problem is because we can not fetch document via query because these are not indexed. I tried with Lucene queries and also with Transactional metadata queries but nothing of these returned these documents.

Does anybody have idea how we can find all these documents and remove them form repository?

Thank you in advance...

4.2

How to create site via REST API

$
0
0

Hello guys,

I am trying to create a site via REST API and I am not able to create it because of 401 Unauthorized - error.loggedOut.
Is here somebody who can tell me how to create site?

Here is my way:

1. Log in to get a ticket

POST /alfresco/service/api/login HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: f6d43cb0-7788-9d22-f17e-635ea8d49e6e
 
{"username":"admin","password":"enboxadmin"}

RESULT
{
"data":{
"ticket":"TICKET_253acd23d357b2405c446bf4ce662d0cc568a480"
}
}

2.Create site

POST /share/service/modules/create-site?alf_ticket=TICKET_253acd23d357b2405c446bf4ce662d0cc568a480 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: 77ab4770-730c-cacf-de98-6d1b80d74466
 
{
"sitePreset":"site-dashboard",
"shortName":"Sandbox",
"title":"Sandbox site",
"description":"This is a sample site.",
"visibility":"PRIVATE"
}

RESULT
{
"status":{
"code":401,
"name":"Unauthorized",
"description":"The request requires HTTP authentication."
},
"message":"error.loggedOut",
"exception":"",
"callstack":[],
"server":"Spring WebScripts - v5.0.0 (Release) schema 1 000",
"time":"8.9.2015 5:06:04"
}

Is this the correct procedure how to create site in share?

Thanks

-Roman

5.0.d

Export repository content from other CMS and import to Alfresco

$
0
0

Hello,
Is it possible to export all repository content from an other CMS in a way/ format and import it to the Alfresco?

Thank you in advance,
Kind regards,
N3k


CONTAINS keyword usage in CMIS queries

$
0
0

Hello,

I have CONTAINS keyword usage question. I am using Alfresco 5.0.d and trying to query my custom type objects via CMIS like this:
SELECT * FROM custom:type WHERE CONTAINS('test')

I tested this query via OpenCMIS Workbench. I expected to get all custom:type entries where at least one of my custom attributes has the text 'test'. But I guess I misunderstood how CONTAINS keyword works with CMIS - I get no results.

I found this earlier post which describes similar problem:
http://forums.alfresco.com/forum/developer-discussions/alfresco-api/cmis-contains-not-finding-documents-expected-03142011-1523
And I thought that this was fixed in version 3.4.3.. but it appears it is not the case.

I also tried this (same results as before):
SELECT * FROM custom:type WHERE CONTAINS('TEXT:test')
and this (I get an exception):
SELECT * FROM custom:type WHERE CONTAINS('ALL:test')
The latter query resulted in an error in workbench ("runtime: 08091542 Request failed 500 /solr4/alfresco/cmis...") and in alfresco logs:

ERROR [solr.core.SolrCore][http-bio-8443-exec-3] java.lang.UnsupportedOperationException
at org.alfresco.solr.query.Solr4QueryParser.createAllQuery(Solr4QueryParser.java:1005)
at org.alfresco.solr.query.Solr4QueryParser.getFieldQuery(Solr4QueryParser.java:615)
at org.alfresco.solr.query.Lucene4QueryParserAdaptor.getFieldQuery(Lucene4QueryParserAdaptor.java:67)
at org.alfresco.solr.query.Lucene4QueryParserAdaptor.getFieldQuery(Lucene4QueryParserAdaptor.java:48)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneFTSTerm.addComponent(LuceneFTSTerm.java:68)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneFunctionalConstraint.addComponent(LuceneFunctionalConstraint.java:57)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQuery.buildQuery(LuceneQuery.java:105)
at org.alfresco.solr.AlfrescoSolrDataModel.getCMISQuery(AlfrescoSolrDataModel.java:2004)
at org.alfresco.solr.query.CmisQParserPlugin$CmisQParser.parse(CmisQParserPlugin.java:189)
at org.apache.solr.search.QParser.getQuery(QParser.java:141)

So the questions at hand are:
How should CONTAINS keyword work?
Is it possible to achieve my requirement (search in all attributes, without specifying all of them in the query)?

Charlie

5.0.d

CMIS upload file with template

$
0
0

Hi,
I'd like to upload a text file in the shared folder via CMIS applying an existent alfresco template, is it possible?

Thank you.

5.0

Read residual properties using CMIS

$
0
0

Hi,

is it possible to read a "residual property" using CMIS?

5.0

David Ciamberlano

blog: alfrescoinaction.it
twitter: @sonosolobit

=================================================================================================
In evidenza su alfrescoinaction.it:

Alfresco – alcune considerazioni sulla sicurezza nella fase di installazione

Installazione e configurazione di solr4 su alfresco 5

=================================================================================================

GetNullPionter when Passing noder in setpermission()

$
0
0

Hi,

I am Using Alfresco Community edition 5.0.d, through java api I am trying set permissions ,Using new PermissionServicImpl.setPermission(noderef,authrty,permissin,true) when i run this I getting null pionter execptions .please let help on this issue

NodeRef noder =new NodeRef("workspace://SpacesStore/2f1f1e4a-349d-46dd-86ba-0db9c8f92fcb");

permissionService.setPermission(noder, "muddappa-venkatesh", PermissionService.CONSUMER, true);

Exception in thread "main" java.lang.NullPointerException
at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.getInheritParentPermissions(PermissionServiceImpl.java:538)
at com.helper.Test.main(Test.java:73)

Checking out via SlingShot REST API

$
0
0

Hi,
I'm trying to checkout a document via "alfresco/service/slingshot/doclib/action/checkout/node/workspace/SpacesStore/{id}" and get the following error:

{
"status":
{
"code":500,
"name":"Internal Error",
"description":"An error inside the HTTP server which prevented it from fulfilling the request."
},
 
"message":"08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator.",
"exception":"org.springframework.extensions.webscripts.WebScriptException - 08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator.",
 
"callstack":
[
"","freemarker.core._MiscTemplateException: When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]"
,"freemarker.core.Macro$Context.sanityCheck(Macro.java:249)"
,"freemarker.core.Macro$Context.runMacro(Macro.java:206)"
,"freemarker.core.Environment.visit(Environment.java:694)"
,"freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)"
,"freemarker.core.Environment.visit(Environment.java:265)"
,"freemarker.core.MixedContent.accept(MixedContent.java:93)"
,"freemarker.core.Environment.visit(Environment.java:265)"
,"freemarker.core.Environment.process(Environment.java:243)"
,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:217)"
,"org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:955)"
,"org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)"
,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
,"org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:489)"
,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:551)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)"
,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)"
,"javax.servlet.http.HttpServlet.service(HttpServlet.java:727)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)"
,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)"
,"org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)"
,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)"
,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)"
,"org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)"
,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)"
,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)"
,"org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)"
,"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)"
,"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)"
,"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)"
,"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)"
,"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)"
,"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)"
,"java.lang.Thread.run(Thread.java:745)"
,"org.alfresco.service.cmr.repository.TemplateException: 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator."
,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:221)"
,"org.springframework.extensions.webscripts.WebScriptException: 08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator."
,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1127)"
 
],
 
"server":"Community v5.0.0 (d r99759-b2) schema 8,022",
"time":"Sep 20, 2015 8:12:06 PM"
}

I'm posting an empty NameValuePair as I have no idea what to post/where to find what to post.
What am I doing wrong? I've spent two hours searching the API and googleing.
Thanks!
5.0.d

Export repository content from other CMS and import to Alfresco

$
0
0

Hello,
Is it possible to export all repository content from an other CMS in a way/ format and import it to the Alfresco?

Thank you in advance,
Kind regards,
N3k

CONTAINS keyword usage in CMIS queries

$
0
0

Hello,

I have CONTAINS keyword usage question. I am using Alfresco 5.0.d and trying to query my custom type objects via CMIS like this:
SELECT * FROM custom:type WHERE CONTAINS('test')

I tested this query via OpenCMIS Workbench. I expected to get all custom:type entries where at least one of my custom attributes has the text 'test'. But I guess I misunderstood how CONTAINS keyword works with CMIS - I get no results.

I found this earlier post which describes similar problem:
http://forums.alfresco.com/forum/developer-discussions/alfresco-api/cmis-contains-not-finding-documents-expected-03142011-1523
And I thought that this was fixed in version 3.4.3.. but it appears it is not the case.

I also tried this (same results as before):
SELECT * FROM custom:type WHERE CONTAINS('TEXT:test')
and this (I get an exception):
SELECT * FROM custom:type WHERE CONTAINS('ALL:test')
The latter query resulted in an error in workbench ("runtime: 08091542 Request failed 500 /solr4/alfresco/cmis...") and in alfresco logs:

ERROR [solr.core.SolrCore][http-bio-8443-exec-3] java.lang.UnsupportedOperationException
at org.alfresco.solr.query.Solr4QueryParser.createAllQuery(Solr4QueryParser.java:1005)
at org.alfresco.solr.query.Solr4QueryParser.getFieldQuery(Solr4QueryParser.java:615)
at org.alfresco.solr.query.Lucene4QueryParserAdaptor.getFieldQuery(Lucene4QueryParserAdaptor.java:67)
at org.alfresco.solr.query.Lucene4QueryParserAdaptor.getFieldQuery(Lucene4QueryParserAdaptor.java:48)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneFTSTerm.addComponent(LuceneFTSTerm.java:68)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneFunctionalConstraint.addComponent(LuceneFunctionalConstraint.java:57)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQuery.buildQuery(LuceneQuery.java:105)
at org.alfresco.solr.AlfrescoSolrDataModel.getCMISQuery(AlfrescoSolrDataModel.java:2004)
at org.alfresco.solr.query.CmisQParserPlugin$CmisQParser.parse(CmisQParserPlugin.java:189)
at org.apache.solr.search.QParser.getQuery(QParser.java:141)

So the questions at hand are:
How should CONTAINS keyword work?
Is it possible to achieve my requirement (search in all attributes, without specifying all of them in the query)?

Charlie

5.0.d

CMIS upload file with template

$
0
0

Hi,
I'd like to upload a text file in the shared folder via CMIS applying an existent alfresco template, is it possible?

Thank you.

5.0

Read residual properties using CMIS

$
0
0

Hi,

is it possible to read a "residual property" using CMIS?

5.0

David Ciamberlano

blog: alfrescoinaction.it
twitter: @sonosolobit

=================================================================================================
In evidenza su alfrescoinaction.it:

Alfresco – alcune considerazioni sulla sicurezza nella fase di installazione

Installazione e configurazione di solr4 su alfresco 5

=================================================================================================

GetNullPionter when Passing noder in setpermission()

$
0
0

Hi,

I am Using Alfresco Community edition 5.0.d, through java api I am trying set permissions ,Using new PermissionServicImpl.setPermission(noderef,authrty,permissin,true) when i run this I getting null pionter execptions .please let help on this issue

NodeRef noder =new NodeRef("workspace://SpacesStore/2f1f1e4a-349d-46dd-86ba-0db9c8f92fcb");

permissionService.setPermission(noder, "muddappa-venkatesh", PermissionService.CONSUMER, true);

Exception in thread "main" java.lang.NullPointerException
at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.getInheritParentPermissions(PermissionServiceImpl.java:538)
at com.helper.Test.main(Test.java:73)

Checking out via SlingShot REST API

$
0
0

Hi,
I'm trying to checkout a document via "alfresco/service/slingshot/doclib/action/checkout/node/workspace/SpacesStore/{id}" and get the following error:

{
"status":
{
"code":500,
"name":"Internal Error",
"description":"An error inside the HTTP server which prevented it from fulfilling the request."
},
 
"message":"08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator.",
"exception":"org.springframework.extensions.webscripts.WebScriptException - 08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator.",
 
"callstack":
[
"","freemarker.core._MiscTemplateException: When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]"
,"freemarker.core.Macro$Context.sanityCheck(Macro.java:249)"
,"freemarker.core.Macro$Context.runMacro(Macro.java:206)"
,"freemarker.core.Environment.visit(Environment.java:694)"
,"freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)"
,"freemarker.core.Environment.visit(Environment.java:265)"
,"freemarker.core.MixedContent.accept(MixedContent.java:93)"
,"freemarker.core.Environment.visit(Environment.java:265)"
,"freemarker.core.Environment.process(Environment.java:243)"
,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:217)"
,"org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:955)"
,"org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)"
,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
,"org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:489)"
,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:551)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)"
,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)"
,"javax.servlet.http.HttpServlet.service(HttpServlet.java:727)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)"
,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)"
,"org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)"
,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)"
,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)"
,"org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)"
,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)"
,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)"
,"org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)"
,"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)"
,"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)"
,"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)"
,"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)"
,"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)"
,"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)"
,"java.lang.Thread.run(Thread.java:745)"
,"org.alfresco.service.cmr.repository.TemplateException: 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator."
,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:221)"
,"org.springframework.extensions.webscripts.WebScriptException: 08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator."
,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1127)"
 
],
 
"server":"Community v5.0.0 (d r99759-b2) schema 8,022",
"time":"Sep 20, 2015 8:12:06 PM"
}

I'm posting an empty NameValuePair as I have no idea what to post/where to find what to post.
What am I doing wrong? I've spent two hours searching the API and googleing.
Thanks!
5.0.d

Possible bug while checking in via REST API?

$
0
0

Hi,
I'm trying to check in a document via REST-Api and I always get the error that I don't have the appropriate permissions to perform the operation. Problem is that the checkin actually completes.
Application flow is the following:
Checkout via service/slingshot/doclib/action/checkout/node/
Upload of new content via service/api/upload/ to the previously created working copy
Checkin via service/slingshot/doclib/action/checkin/node/
This correctly locks and unlocks the document and updates its content even though the server returns a 500 - Internal Error.
This occurs even with an administrator ticket.
Any idea why I get the 'Access Denied'?
Callstack, if it helps:

"","net.sf.acegisecurity.AccessDeniedException: Access is denied."
,"net.sf.acegisecurity.vote.AffirmativeBased.decide(AffirmativeBased.java:86)"
,"net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:398)"
,"net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)"
,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
,"org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)"
,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
,"org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:159)"
,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
,"org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)"
,"org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)"
,"org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)"
,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
,"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)"
,"com.sun.proxy.$Proxy80.checkin(Unknown Source)"
,"org.alfresco.repo.jscript.ScriptNode.checkin(ScriptNode.java:2493)"
,"org.alfresco.repo.jscript.ScriptNode.checkin(ScriptNode.java:2461)"
,"sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"
,"sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)"
,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
,"java.lang.reflect.Method.invoke(Method.java:483)"
,"org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)"
,"org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)"
,"org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:85)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4._c_runAction_19(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js:889)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
,"org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4._c_main_13(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js:607)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
,"org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:74)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4._c_script_0(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js:920)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
,"org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)"
,"org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.exec(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
,"org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:502)"
,"org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:200)"
,"org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)"
,"org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)"
,"org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)"
,"org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1364)"
,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)"
,"org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:489)"
,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:551)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)"
,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)"
,"javax.servlet.http.HttpServlet.service(HttpServlet.java:727)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)"
,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)"
,"org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)"
,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)"
,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)"
,"org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)"
,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)"
,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)"
,"org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)"
,"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)"
,"org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2403)"
,"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)"
,"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)"
,"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)"
,"java.lang.Thread.run(Thread.java:745)"
,"org.alfresco.repo.security.permissions.AccessDeniedException: 08210048 Access Denied. You do not have the appropriate permissions to perform this operation."
,"org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:50)"
,"org.springframework.extensions.webscripts.WebScriptException: 08210014 JavaException: org.alfresco.repo.security.permissions.AccessDeniedException: 08210048 Access Denied. You do not have the appropriate permissions to perform this operation."
,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1112)"

Thanks
5.0.d
Viewing all 252 articles
Browse latest View live