Jump to content
We've recently updated our Privacy Statement, available here ×

Create Domain on Jasper via PHP Client


Recommended Posts

I want to create a domain using the PHP Rest Client.
I created a semanticLayerDatasource. I want to create the schema of this domain in $domname_files.
The object semanticLayer.... needs a schema, but the documentation lacks in this point.
So any idea or at best an example how to create a domain via the php client would be much appreciated.
I tried to create a xml file locally and set schema to the uri of this source. This way i am able to create a domain, but if i try to create an adhoc view, i get a null exception.

Thank you.

Link to comment
Share on other sites

  • 7 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Here is the example how to create a domain:

$domain = new JaspersoftDtoResourceSemanticLayerDataSource();$domain->uri = $uri;$domain->dataSource = $dataSourceuri;$domain->label = "Client Domain";$domain->schema = new JaspersoftDtoResourceFile();$domain->schema->content = base64_encode(file_get_contents('schema.data')); // base46 does the trick$domain->schema->type = 'xml';$domain->schema->label = 'schema';$repositoryService->createResource($domain);[/code]

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...