本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setMasterInputControls方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.setMasterInputControls方法的具体用法?Java ResourceDescriptor.setMasterInputControls怎么用?Java ResourceDescriptor.setMasterInputControls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
的用法示例。
在下文中一共展示了ResourceDescriptor.setMasterInputControls方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: cascadingDependencies
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private void cascadingDependencies(ResourceDescriptor ic, Set<String> icNames) {
List<ResourceDescriptor> children = ic.getChildren();
for (ResourceDescriptor sub_ic : children) {
if (!InputControlsManager.isRDQuery(sub_ic))
continue;
String queryString = sub_ic.getSql();
String lang = sub_ic.getResourceProperty(ResourceDescriptor.PROP_QUERY_LANGUAGE).getValue();
if (!Misc.isNullOrEmpty(queryString)) {
List<String> parameters = new ArrayList<String>();
JRDesignQuery query = new JRDesignQuery();
query.setText(queryString);
if (lang != null)
query.setLanguage(lang);
for (JRQueryChunk chunk : query.getChunks()) {
switch (chunk.getType()) {
case JRQueryChunk.TYPE_TEXT:
break;
case JRQueryChunk.TYPE_PARAMETER_CLAUSE:
case JRQueryChunk.TYPE_PARAMETER:
String paramName = chunk.getText().trim();
if (!parameters.contains(paramName) && icNames.contains(paramName))
parameters.add(paramName);
break;
case JRQueryChunk.TYPE_CLAUSE_TOKENS:
String[] tokens = chunk.getTokens();
if (tokens.length > 2) {
for (String t : tokens) {
t = t.trim();
if (!parameters.contains(t) && icNames.contains(t))
parameters.add(t);
}
}
break;
}
}
if (!parameters.isEmpty())
ic.setMasterInputControls(parameters);
}
break;
}
}