本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.getUriString方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.getUriString方法的具体用法?Java ResourceDescriptor.getUriString怎么用?Java ResourceDescriptor.getUriString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
的用法示例。
在下文中一共展示了ResourceDescriptor.getUriString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: cascadeInputControls
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public List<ResourceDescriptor> cascadeInputControls(ResourceDescriptor runit, List<ResourceDescriptor> ics, IProgressMonitor monitor) throws Exception {
String dsUri = null;
for (ResourceDescriptor sub_rd : runit.getChildren()) {
String wsType = sub_rd.getWsType();
if (wsType.equals(ResourceDescriptor.TYPE_DATASOURCE) && sub_rd.getIsReference())
dsUri = sub_rd.getReferenceUri();
else if (SelectorDatasource.isDatasource(sub_rd))
dsUri = sub_rd.getUriString();
}
String ruri = runit.getUriString();
List<ResourceDescriptor> res = new ArrayList<ResourceDescriptor>();
for (ResourceDescriptor rd : ics)
res.add(updateControl(ruri, dsUri, rd, monitor));
return res;
}
示例3: getDataSourceQueryURI
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static String getDataSourceQueryURI(String dsUri, ResourceDescriptor ic) {
String dsUriQuery = null;
// reset query data...
// Look if this query has a specific datasource...
for (int k = 0; dsUriQuery == null && k < ic.getChildren().size(); ++k) {
ResourceDescriptor sub_ic = (ResourceDescriptor) ic.getChildren().get(k);
if (InputControlsManager.isRDQuery(sub_ic))
for (int k2 = 0; k2 < sub_ic.getChildren().size(); ++k2) {
ResourceDescriptor sub_sub_ic = (ResourceDescriptor) sub_ic.getChildren().get(k2);
if (SelectorDatasource.isDatasource(sub_sub_ic)) {
dsUriQuery = sub_sub_ic.getUriString();
break;
}
}
}
if (dsUriQuery == null)
dsUriQuery = dsUri;
return dsUriQuery;
}
示例4: get
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public ResourceDescriptor get(IProgressMonitor monitor, ResourceDescriptor rd, File f) throws Exception {
if (rd.getUriString() == null || rd.getUriString().contains("<"))
throw new Exception("wrong url");
String uri = rd.getUriString();
if (uri.startsWith("repo://"))
uri = uri.substring(5);
if (!uri.startsWith("/"))
uri = "/" + uri;
WebTarget tgt = target.path("resources" + uri);
tgt = tgt.queryParam("expanded", "true");
String rtype = WsTypes.INST().toRestType(rd.getWsType());
Builder req = tgt.request("application/repository." + rtype + "+" + FORMAT);
ClientResource<?> crl = toObj(connector.get(req, monitor), WsTypes.INST().getType(rtype), monitor);
if (crl != null) {
if (f != null && crl instanceof ClientFile) {
ClientFile cf = (ClientFile) crl;
tgt = target.path("resources" + uri);
try {
req = tgt.request(cf.getType().getMimeType()).header("Accept", cf.getType().getMimeType());
readFile(connector.get(req, monitor), f, monitor);
} catch (HttpResponseException e) {
if (e.getStatusCode() == 500)
;// jrs 5.5 returns 500 if file is not existing, a bug
// for newer versions, we should show the error
}
}
return Rest2Soap.getRD(this, crl);
}
return null;
}
示例5: dragSetData
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public void dragSetData(DragSourceEvent event) {
if (ImageURLTransfer.getInstance().isSupportedType(event.dataType)) {
IStructuredSelection selection = (IStructuredSelection) viewer
.getSelection();
if (selection.getFirstElement() instanceof MRImage) {
MRImage reportImg = (MRImage) selection.getFirstElement();
ResourceDescriptor imgDescriptor = reportImg.getValue();
event.data = "repo:" + imgDescriptor.getUriString(); //$NON-NLS-1$
}
}
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:RepositoryImageDragSourceListener.java
示例6: addDataSource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static void addDataSource(MServerProfile sp, ResourceDescriptor r) {
String url = r.getUriString();
StringTokenizer st = new StringTokenizer(url, "/");
String turl = "/";
ANode parent = sp;
while (st.hasMoreTokens()) {
String token = st.nextToken();
String sf = turl + token;
if (sf.equals(url)) {
ResourceFactory.getResource(parent, r, -1);
break;
}
MResource child = null;
for (INode node : parent.getChildren()) {
if (node instanceof MResource) {
MResource mr = (MResource) node;
if (mr.getValue().getUriString().equals(sf)) {
child = mr;
break;
}
}
}
if (child == null) {
ResourceDescriptor rd = new ResourceDescriptor();
rd.setName(token);
rd.setLabel(token);
rd.setUriString(sf);
rd.setWsType(ResourceDescriptor.TYPE_FOLDER);
child = ResourceFactory.getResource(parent, rd, -1);
child.removeChildren();
}
parent = child;
turl = sf + "/";
}
}
示例7: doPasteIntoReportUnit
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
protected ResourceDescriptor doPasteIntoReportUnit(ResourceDescriptor prd, ResourceDescriptor origin) {
String ruuri = prd.getUriString();
origin.setParentFolder(ruuri + "_files"); //$NON-NLS-1$
origin.setUriString(ruuri + "_files/" + origin.getName()); //$NON-NLS-1$
origin.setIsNew(true);
origin.setName(getRName(origin.getName(), prd.getChildren()));
origin.setLabel(origin.getLabel());
origin.setMainReport(false);
return origin;
}
示例8: get
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public ResourceDescriptor get(IProgressMonitor monitor, ResourceDescriptor rd, File f) throws Exception {
if (rd.getUriString() == null || rd.getUriString().contains("<"))
throw new Exception("wrong url");
return client.get(rd, f);
}
示例9: initInputControls
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public ResourceDescriptor initInputControls(String uri, IProgressMonitor monitor) throws Exception {
ResourceDescriptor rdrepunit = WSClientHelper.getReportUnit(monitor, uri);
// List<ResourceDescriptor> list = list(monitor, rdrepunit);
List<ResourceDescriptor> inputcontrols = new ArrayList<ResourceDescriptor>();
Set<String> icNames = new HashSet<String>();
String dsUri = null;
for (ResourceDescriptor sub_rd : rdrepunit.getChildren()) {
String wsType = sub_rd.getWsType();
if (wsType.equals(ResourceDescriptor.TYPE_INPUT_CONTROL)) {
inputcontrols.add(sub_rd);
icNames.add(sub_rd.getName());
} else if (wsType.equals(ResourceDescriptor.TYPE_DATASOURCE) && sub_rd.getIsReference())
dsUri = sub_rd.getReferenceUri();
else if (SelectorDatasource.isDatasource(sub_rd))
dsUri = sub_rd.getUriString();
}
for (int i = 0; i < inputcontrols.size(); ++i) {
ResourceDescriptor ic = inputcontrols.get(i);
if (InputControlsManager.isICQuery(ic)) {
String dsUriQuery = getDataSourceQueryURI(dsUri, ic);
ic.setResourceProperty(ResourceDescriptor.PROP_QUERY_DATA, null);
// Ask to add values to the control....
List<Argument> args = new ArrayList<Argument>();
args.add(new Argument(Argument.IC_GET_QUERY_DATA, dsUriQuery));
args.add(new Argument(Argument.RU_REF_URI, uri));
ic = client.get(ic, null, args);
cascadingDependencies(ic, icNames);
} else if (InputControlsManager.isICListOfValues(ic) && !ic.getChildren().isEmpty()) {
ResourceDescriptor rd2 = (ResourceDescriptor) ic.getChildren().get(0);
if (rd2.getWsType().equals(ResourceDescriptor.TYPE_REFERENCE)) {
ResourceDescriptor tmpRd = new ResourceDescriptor();
tmpRd.setUriString(rd2.getReferenceUri());
tmpRd = get(monitor, tmpRd, null);
ic.setListOfValues(tmpRd.getListOfValues());
} else
ic.setListOfValues(rd2.getListOfValues());
}
for (int j = 0; j < rdrepunit.getChildren().size(); j++) {
ResourceDescriptor r = rdrepunit.getChildren().get(j);
if (r.getName() != null && r.getName().equals(ic.getName()))
rdrepunit.getChildren().set(j, ic);
}
}
return rdrepunit;
}