本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setUriString方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.setUriString方法的具体用法?Java ResourceDescriptor.setUriString怎么用?Java ResourceDescriptor.setUriString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
的用法示例。
在下文中一共展示了ResourceDescriptor.setUriString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setChild
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static void setChild(ResourceDescriptor rd, ResourceDescriptor child) {
List<ResourceDescriptor> children = rd.getChildren();
for (int i = 0; i < children.size(); i++) {
ResourceDescriptor r = children.get(i);
if (r.isMainReport() && child.isMainReport()) {
child.setName(r.getName());
child.setLabel(r.getLabel());
child.setDescription(r.getDescription());
child.setUriString(r.getUriString());
children.set(i, child);
return;
}
if ((child.getUriString() == null && r.getUriString() == null && child.getWsType().equals(r.getWsType())) || (r.getUriString() != null && r.getUriString().equals(child.getUriString()))) {
if (r.isMainReport())
child.setMainReport(true);
children.set(i, child);
return;
}
}
children.add(child);
}
示例2: loadPreferences
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static void loadPreferences(IProgressMonitor monitor, IFile ifile, MResource f) {
PublishOptions popt = f.getPublishOptions();
String prefix = f.getValue().getName();
try {
String ovw = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".overwrite"));
if (ovw != null)
popt.setOverwrite(Boolean.parseBoolean(ovw));
String ref = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".reference"));
if (ref != null) {
popt.setPublishMethod(ResourcePublishMethod.valueOf(ref));
String path = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".refPATH"));
if (path != null) {
ResourceDescriptor rd = new ResourceDescriptor();
rd.setParentFolder(RDUtil.getParentFolder(path));
rd.setUriString(path);
rd.setWsType(f.getValue().getWsType());
popt.setReferencedResource(WSClientHelper.getResource(monitor, f, rd, FileUtils.createTempFile("tmp", "")));
} else
popt.setPublishMethod(ResourcePublishMethod.LOCAL);
}
} catch (Exception e) {
popt.setPublishMethod(ResourcePublishMethod.LOCAL);
e.printStackTrace();
}
}
示例3: listFolder
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
/**
* This function shows how to create a folder in the root directory.
* Subfolders can be created just specifying a proper Uri string i.e.
* rd.setUriString("/this/is/my/new/folder");
*
* @param client
* @param folderLabel
* @param folderName
* @throws IOException
*/
public static void listFolder(WSClient client, String folderUri)
throws Exception {
ResourceDescriptor rd = new ResourceDescriptor();
rd.setWsType(ResourceDescriptor.TYPE_FOLDER);
rd.setUriString(folderUri);
List<ResourceDescriptor> children = client.list(rd);
for (ResourceDescriptor r : children) {
for (int i = 0; i < depth; ++i)
System.out.print(" ");
if (r.getWsType().equals(ResourceDescriptor.TYPE_FOLDER)) {
System.out.println("[" + r.getLabel() + "]");
depth++;
listFolder(client, r.getUriString());
depth--;
} else if (r.getWsType().equals(ResourceDescriptor.TYPE_REPORTUNIT)) {
r = client.get(r, null);
listFolder(client, r.getUriString());
} else {
System.out.println("" + r.getLabel() + "");
}
}
}
示例4: addReportResource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static void addReportResource(WSClient client, String reportUnitUri, String name, String imageFile) throws Exception {
// Add a simple Resources...
ResourceDescriptor resourceDescriptor = new ResourceDescriptor();
resourceDescriptor.setWsType( ResourceDescriptor.TYPE_IMAGE );
resourceDescriptor.setName(name);
resourceDescriptor.setLabel(name);
resourceDescriptor.setIsNew(true);
resourceDescriptor.setHasData(true);
resourceDescriptor.setUriString(reportUnitUri+"/" + name);
client.modifyReportUnitResource(reportUnitUri, resourceDescriptor, new File(imageFile));
System.out.println(" Image " + name + " added to the report");
System.out.flush();
}
示例5: checkConnection
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static boolean checkConnection(MServerProfile msp, IProgressMonitor monitor) throws Exception {
monitor.subTask("Connecting to " + msp.getDisplayText());
IConnection c = new ProxyConnection();
boolean cres = c.connect(monitor, msp.getValue());
if (cres) {
monitor.subTask("Connected");
msp.setWsClient(c);
monitor.subTask("Trying to read folder");
ResourceDescriptor rd = new ResourceDescriptor();
rd.setWsType(ResourceDescriptor.TYPE_FOLDER);
rd.setUriString("/");
c.get(monitor, rd, null);
} else
monitor.subTask("Not Connected");
return cres;
}
示例6: getReference
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor getReference(IProgressMonitor monitor, ANode root, ResourceDescriptor rd) throws Exception {
MServerProfile sp = (MServerProfile) root.getRoot();
if (rd.getReferenceUri() != null) {
String ref = rd.getReferenceUri();
int ldel = ref.lastIndexOf("/");
String pfolder = ref.substring(0, ldel - 1);
String file = ref.substring(ldel + 1, ref.length());
ResourceDescriptor r = new ResourceDescriptor();
r.setParentFolder(pfolder);
r.setName(file);
r.setUriString(rd.getReferenceUri());
r.setWsType(ResourceDescriptor.TYPE_CONTENT_RESOURCE);
return sp.getWsClient(monitor).get(monitor, r, null);
}
return null;
}
示例7: initInputControls
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public ResourceDescriptor initInputControls(String uri, IProgressMonitor monitor) throws Exception {
uri = WSClientHelper.getReportUnitUri(uri);
ResourceDescriptor rdunit = new ResourceDescriptor();
rdunit.setUriString(uri);
rdunit.setWsType(ResourceDescriptor.TYPE_REPORTUNIT);
rdunit = parent.get(monitor, rdunit, null);
if (monitor.isCanceled())
return rdunit;
Builder req = target.path("reports" + uri + "/inputControls").request();
Response r = connector.get(req, monitor);
ReportInputControlsListWrapper crl = toObj(r, ReportInputControlsListWrapper.class, monitor);
if (crl != null)
for (ResourceDescriptor rd : rdunit.getChildren()) {
if (rd.getWsType().equals(ResourceDescriptor.TYPE_INPUT_CONTROL)) {
for (ReportInputControl ric : crl.getInputParameters()) {
InputControlState ics = ric.getState();
rd.setMasterInputControls(ric.getMasterDependencies());
if (ics.getId().equals(rd.getName())) {
setInputControlState(rd, ics);
break;
}
}
}
}
return rdunit;
}
示例8: getInputControl
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor getInputControl(ARestV2Connection rc, ReportInputControl cr, ResourceDescriptor rd) throws ParseException {
rd.setName(cr.getId());
rd.setUriString(cr.getUri());
rd.setLabel(cr.getLabel());
rd.setDescription(cr.getDescription());
rd.setWsType(ResourceDescriptor.TYPE_INPUT_CONTROL);
rd.setValue(cr);
return rd;
}
示例9: addType
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor addType(ResourceDescriptor rd, MInputControl mres, byte type) {
ResourceDescriptor rdtype = MDataType.createDescriptor(mres);
String name = "myDatatype";
rdtype.setName(name);
rdtype.setLabel(name);
rdtype.setIsNew(true);
rdtype.setDataType(type);
rdtype.setIsReference(false);
rdtype.setParentFolder(rd.getUriString() + "_files");
rdtype.setUriString(rdtype.getParentFolder() + "/" + name);
rd.getChildren().add(rdtype);
return rdtype;
}
示例10: addResource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
protected AFileResource addResource(IProgressMonitor monitor,
MReportUnit mrunit, Set<String> fileset, File f, PublishOptions popt) {
ResourceDescriptor runit = mrunit.getValue();
String rname = f.getName();
ResourceDescriptor rd = null;
List<ResourceDescriptor> list = runit.getChildren();
for (ResourceDescriptor r : list) {
if (r.getName() != null && r.getName().equals(rname)) {
rd = r;
break;
}
}
if (rd == null) {
rd = createResource(mrunit);
rd.setName(rname);
rd.setLabel(rname);
rd.setParentFolder(runit.getUriString() + "_files");
rd.setUriString(rd.getParentFolder() + "/" + rd.getName());
}
AFileResource mres = (AFileResource) ResourceFactory.getResource(
mrunit, rd, -1);
mres.setFile(f);
mres.setPublishOptions(popt);
PublishUtil.getResources(mrunit, monitor, jrConfig).add(mres);
return mres;
}
示例11: createFolder
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
/**
* This function shows how to create a folder in the root directory.
* Subfolders can be created just specifying a proper Uri string i.e.
* rd.setUriString("/this/is/my/new/folder");
*
* @param client
* @param folderLabel
* @param folderName
* @throws IOException
*/
public static void createFolder(WSClient client, String folderLabel, String folderName) throws IOException
{
System.out.println("\n\n-----------" + folderName + " --------------");
ResourceDescriptor rd = new ResourceDescriptor();
rd.setWsType(ResourceDescriptor.TYPE_FOLDER);
rd.setUriString("/" + folderName);
rd.setName(folderName);
rd.setLabel(folderLabel);
// If you want delete a folder in case it already exists, just uncomment this code
//try {
// client.delete(rd);
//} catch (Exception ex) { }
rd.setIsNew(true);
try {
client.addOrModifyResource(rd, null);
System.out.println("Folder " + "/" + folderName + " created");
} catch (Exception ex)
{
System.out.println("Creation of folder " + "/" + folderName + " failed: " + ex.getMessage());
//ex.printStackTrace();
}
}
示例12: runReportUnit
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ReportExecution runReportUnit(IProgressMonitor monitor, ReportExecution repExec, Map<String, Object> parameters) throws Exception {
if (repExec.getResourceDescriptor() == null) {
ResourceDescriptor rd = new ResourceDescriptor();
rd.setUriString(repExec.getReportURI());
rd.setWsType(ResourceDescriptor.TYPE_REPORTUNIT);
repExec.setResourceDescriptor(rd);
}
repExec.setPrm(parameters);
if (repExec.getArgs() == null) {
List<Argument> args = new ArrayList<Argument>();
args.add(new Argument(Argument.RUN_OUTPUT_FORMAT, Argument.RUN_OUTPUT_FORMAT_JRPRINT));
repExec.setArgs(args);
}
return getClient(monitor, repExec.getReportURIFull()).runReport(monitor, repExec);
}
示例13: cloneResource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor cloneResource(ResourceDescriptor rd) {
ResourceDescriptor rnew = new ResourceDescriptor();
copyFields(rd, rnew);
rnew.setIsNew(rd.getIsNew());
rnew.setIsReference(rd.getIsReference());
rnew.setUriString(rd.getUriString());
rnew.setParentFolder(rd.getParentFolder());
rnew.setDataSourceType(rd.getDataSourceType());
rnew.setWsType(rd.getWsType());
return rnew;
}
示例14: list
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public List<ResourceDescriptor> list(IProgressMonitor monitor, ResourceDescriptor rd) throws Exception {
List<ResourceDescriptor> rds = new ArrayList<ResourceDescriptor>();
if (rd.getWsType().equals(ResourceDescriptor.TYPE_REPORTUNIT)) {
rd = parent.get(monitor, rd, null);
return rd.getChildren();
} else if (rd.getWsType().equals(ResourceDescriptor.TYPE_DOMAIN_TOPICS)) {
rd = parent.get(monitor, rd, null);
return rd.getChildren();
} else if (rd.getWsType().equals(ResourceDescriptor.TYPE_ADHOC_DATA_VIEW)) {
return getInputControls(rd.getParentFolder() + "/" + rd.getName(), monitor);
} else if (rd.getWsType().equals(ResourceDescriptor.TYPE_DASHBOARD)) {
return getInputControls(rd.getParentFolder() + "/" + rd.getName(), monitor);
} else if (rd.getWsType().equals(ResourceDescriptor.TYPE_REPORT_OPTIONS)) {
return getInputControls(rd.getParentFolder() + "/" + rd.getName(), monitor);
} else {
WebTarget tgt = target.path("resources");
tgt = tgt.queryParam("folderUri", rd.getUriString());
tgt = tgt.queryParam("recursive", "false");
tgt = tgt.queryParam("sortBy", "label");
tgt = tgt.queryParam("limit", 0);
Builder req = tgt.request();
ClientResourceListWrapper resources = toObj(connector.get(req, monitor), ClientResourceListWrapper.class, monitor);
if (resources != null) {
boolean isPublic = false;
for (ClientResourceLookup crl : resources.getResourceLookups()) {
if (!isPublic)
isPublic = crl.getUri().equals("/public");
ResourceDescriptor nrd = Rest2Soap.getRDLookup(this, crl);
rds.add(nrd);
if (nrd.getWsType().equals(ResourceDescriptor.TYPE_CONTENT_RESOURCE)) {
String name = nrd.getUriString().toLowerCase();
if (FileExtension.isImage(name))
nrd.setWsType(ResourceDescriptor.TYPE_IMAGE);
if (FileExtension.isFont(name))
nrd.setWsType(ResourceDescriptor.TYPE_FONT);
else if (name.endsWith(".xml"))
nrd.setWsType(ResourceDescriptor.TYPE_XML_FILE);
else if (name.endsWith(FileExtension.PointJRXML))
nrd.setWsType(ResourceDescriptor.TYPE_JRXML);
else if (name.endsWith(".jar"))
nrd.setWsType(ResourceDescriptor.TYPE_CLASS_JAR);
else if (name.endsWith(FileExtension.PointJRTX))
nrd.setWsType(ResourceDescriptor.TYPE_STYLE_TEMPLATE);
else if (name.endsWith(ResourceDescriptor.TYPE_CSS_FILE))
nrd.setWsType(ResourceDescriptor.TYPE_CSS_FILE);
else if (name.endsWith(".properties"))
nrd.setWsType(ResourceDescriptor.TYPE_RESOURCE_BUNDLE);
}
}
// workaround
if (rd.getUriString().equals("/") && !isPublic) {
try {
ResourceDescriptor pub = new ResourceDescriptor();
pub.setUriString("/public");
pub.setWsType(ResourceDescriptor.TYPE_FOLDER);
rds.add(parent.get(monitor, pub, null));
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return rds;
}
示例15: getRD
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor getRD(ARestV2Connection rc, ClientResource<?> cr, ResourceDescriptor rd) throws ParseException {
rd.getChildren().clear();
rd.setWsType(WsTypes.INST().toSoapType(cr));
rd.setIsNew(false);
rd.setParentFolder(RDUtil.getParentFolder(cr.getUri()));
rd.setUriString(cr.getUri());
rd.setLabel(cr.getLabel());
rd.setDescription(cr.getDescription());
rd.setName(RDUtil.getID(cr.getUri()));
rd.setVersion(Misc.nvl(cr.getVersion(), 0));
rd.setCreationDate(rc.toTimestamp(cr.getCreationDate()));
DiffFields.setSoapValue(rd, DiffFields.UPDATEDATE, cr.getUpdateDate());
rd.setPermissionMask(Misc.nvl(cr.getPermissionMask(), 0));
// look recursively
if (cr instanceof ClientDataType)
getDataType(rc, (ClientDataType) cr, rd);
else if (cr instanceof ClientAdhocDataView)
getAdhocDataView(rc, (ClientAdhocDataView) cr, rd);
else if (cr instanceof ClientJdbcDataSource)
getJdbcDataSource(rc, (ClientJdbcDataSource) cr, rd);
else if (cr instanceof ClientJndiJdbcDataSource)
getJndiDataSource(rc, (ClientJndiJdbcDataSource) cr, rd);
else if (cr instanceof ClientAwsDataSource)
getAWSDataSource(rc, (ClientAwsDataSource) cr, rd);
else if (cr instanceof ClientVirtualDataSource)
getVirtualDataSource(rc, (ClientVirtualDataSource) cr, rd);
else if (cr instanceof ClientCustomDataSource)
getCustomDataSource(rc, (ClientCustomDataSource) cr, rd);
else if (cr instanceof ClientBeanDataSource)
getBeanDataSource(rc, (ClientBeanDataSource) cr, rd);
else if (cr instanceof ClientOlapUnit)
getOlapUnit(rc, (ClientOlapUnit) cr, rd);
else if (cr instanceof ClientQuery)
getQuery(rc, (ClientQuery) cr, rd);
else if (cr instanceof ClientXmlaConnection)
getXmlaConnection(rc, (ClientXmlaConnection) cr, rd);
else if (cr instanceof ClientMondrianConnection)
getMondrianConnection(rc, (ClientMondrianConnection) cr, rd);
else if (cr instanceof ClientSecureMondrianConnection)
getSecureMondrianConnection(rc, (ClientSecureMondrianConnection) cr, rd);
else if (cr instanceof ClientMondrianXmlaDefinition)
getMondrianXmlaDefinition(rc, (ClientMondrianXmlaDefinition) cr, rd);
else if (cr instanceof ClientListOfValues)
getLOV(rc, (ClientListOfValues) cr, rd);
else if (cr instanceof AbstractClientReportUnit)
getReportUnit(rc, (AbstractClientReportUnit<?>) cr, rd);
else if (cr instanceof ClientInputControl)
getInputControl(rc, (ClientInputControl) cr, rd);
else if (cr instanceof ClientFile)
getFile(rc, (ClientFile) cr, rd);
else
rd = Misc.nvl(Activator.getExtManager().getRD(rc, cr, rd), rd);
return rd;
}