Jaspersoft / jrs-rest-java-client

Java Rest Client for JasperReports Server
GNU Lesser General Public License v3.0
101 stars 102 forks source link

update ClientSemanticLayerDataSource failed #314

Open peteryuanpan opened 7 years ago

peteryuanpan commented 7 years ago

I am trying to update ClientSemanticLayerDataSource by following ways:

OperationResult xmlResult = client .authenticate(Constant.ServerInfo.userName, Constant.ServerInfo.password) .resourcesService() .resource(domain.getSchema().getUri()) .downloadBinary(); InputStream inputStreamSchema = xmlResult.getEntity();

ClientFile clientFileSchema = client.authenticate(Constant.ServerInfo.userName,Constant.ServerInfo.password) .resourcesService() .resource(domain.getSchema().getUri()) .get(ClientFile.class) .getEntity();

client.authenticate(Constant.ServerInfo.userName, Constant.ServerInfo.password) .resourcesService() .resource(domain) .withSchema(inputStreamSchema, clientFileSchema) .createInFolder("/CHRLBI/Domain");

However, eclipse shows me the following errors: Exception in thread "JavaFX Application Thread" com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.IllegalParameterValueException: パラメータ「schema」の値「/CHRLBI/新規ドメイン_test1_files/schema.xml」が無効です。

What is the wrong with my function ? I can not get the problem. Is there any effective way to update ClientSemanticLayerDataSource data from computer to server ? Or other way ? using ClientMondrianConnection connection ... ?

I need help. Please help me. Thank you very very much.

yaroslav-kovalchyk commented 7 years ago

Could you please run your code under EN locale? Unfortunately can't understand what does exception message says...

peteryuanpan commented 7 years ago

In English, that is means: the value of path [schema] [filepath/schema.xml] is invalid

yaroslav-kovalchyk commented 7 years ago

Thanks for clarification. After deeper investigation we realized, that current REST client API doesn't allow update of ClientSemanticLayerDataSource with sub resources (i.e. with schema, bundles etc.). And you are trying to create semanticLayerDataSource (you are using createInFolder method). This method fails by another issue. So, we will work on this bug, but I can't promise, that fix will be provided soon. I can provide a sample how to create and update semanticLayerDataSources using pure JerseyClient if you wish.

peteryuanpan commented 7 years ago

Thanks for your reply. Maybe I did not express it clearly, but I've solved my problem with help of my colleague.

yaroslav-kovalchyk commented 7 years ago

Great! I'll keep this issue open to implement proper create/update API for sermanticLayerDataSource. Thank you!

Ffrenchy commented 5 years ago

@yaroslav-kovalchyk @peteryuanpan Can you please share the details on how you resolved the issue with creating semanticLayerDataSource?