My problem is:
i've got the PHP Client http://community.jaspersoft.com/wiki/php-client-sample-code#About_the_Class from the Jasper Community.
I want to add a Domain with PHP to the Jasper Repository and i've got the needed data in an .xml, like label etc.
In this PHP Client i have to use the class SemanticLayerDataSource to create a domain.
This class got a public variable schema.
But i can't find what this schema needs to work and add an correct domain to repository. There is not info neither on the webside nor in the class.
$semLayer = new SemanticLayerDataSource();
$semLayer->schema = ?????
$semLayer->label = (string)$xml->label; //SimpleXml
Well, i found the solution. If you want to create a schema per php client, create a new file object.
$file = new \Jaspersoft\Dto\Resource\File(); $file->type = "xml"; $file->label = "MyDomain_schema"; $file->content = base64_encode((string)$schemaXML);
The file content is the base64 encoded (valid) domain schema.
$semLayer->schema = $file. This way works rather good.
Also, there is a way to create the domain via multipart request, but this way is rather complicated with php client. There is a function multipartrequest in the PHP Client, but it seems that this function consists of legacy code.