本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setListOfValues方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.setListOfValues方法的具体用法?Java ResourceDescriptor.setListOfValues怎么用?Java ResourceDescriptor.setListOfValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
的用法示例。
在下文中一共展示了ResourceDescriptor.setListOfValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLOV
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static void getLOV(ARestV2Connection rc, ClientListOfValues cr, ResourceDescriptor rd) throws ParseException {
List<ListItem> lovs = new ArrayList<ListItem>();
if (cr.getItems() != null)
for (ClientListOfValuesItem sds : cr.getItems())
lovs.add(new ListItem(sds.getLabel(), sds.getValue()));
rd.setListOfValues(lovs);
}
示例2: copyFields
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static void copyFields(ResourceDescriptor rd, ResourceDescriptor rnew) {
rnew.setParameters(rd.getParameters());
rnew.setProperties(rd.getProperties());
rnew.setChildren(rd.getChildren());
rnew.setQueryData(rd.getQueryData());
rnew.setQueryValueColumn(rd.getQueryValueColumn());
rnew.setQueryVisibleColumns(rd.getQueryVisibleColumns());
rnew.setListOfValues(rd.getListOfValues());
rnew.setPattern(rd.getPattern());
rnew.setMinValue(rd.getMinValue());
rnew.setMaxValue(rd.getMaxValue());
rnew.setStrictMin(rd.isStrictMin());
rnew.setStrictMax(rd.isStrictMax());
rnew.setDataType(rd.getDataType());
rnew.setJndiName(rd.getJndiName());
rnew.setBeanMethod(rd.getBeanMethod());
rnew.setBeanName(rd.getBeanName());
rnew.setDriverClass(rd.getDriverClass());
rnew.setUsername(rd.getUsername());
rnew.setPassword(rd.getPassword());
rnew.setConnectionUrl(rd.getConnectionUrl());
rnew.setName(rd.getName());
rnew.setLabel(rd.getLabel());
rnew.setDescription(rd.getDescription());
rnew.setData(rd.getData());
rnew.setHasData(rd.getHasData());
rnew.setSql(rd.getSql());
}
示例3: publish
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public void publish(MReportUnit mrunit, IProgressMonitor monitor, JasperDesign jasper, JasperReportsConfiguration jrConfig) throws Exception {
ResourceDescriptor runit = mrunit.getValue();
for (JRParameter p : jasper.getParametersList()) {
if (p.isSystemDefined() || !p.isForPrompting())
continue;
ResourceDescriptor rd = MInputControl.createDescriptor(mrunit);
rd.setName(p.getName());
rd.setLabel(p.getName());
rd.setDescription(p.getDescription());
rd.setVisible(true);
rd.setReadOnly(false);
rd.setMandatory(false);
rd.setResourceProperty(ResourceDescriptor.PROP_INPUTCONTROL_TYPE, ResourceDescriptor.IC_TYPE_SINGLE_VALUE);
rd.setParentFolder(runit.getUriString() + "_files");
rd.setUriString(runit.getUriString() + "_files/" + rd.getName());
MInputControl mres = (MInputControl) ResourceFactory.getResource(mrunit, rd, -1);
if (Boolean.class.isAssignableFrom(p.getValueClass())) {
rd.setControlType(ResourceDescriptor.IC_TYPE_BOOLEAN);
} else if (String.class.isAssignableFrom(p.getValueClass())) {
addType(rd, mres, ResourceDescriptor.DT_TYPE_TEXT);
} else if (Timestamp.class.isAssignableFrom(p.getValueClass())) {
addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE_TIME);
} else if (Date.class.isAssignableFrom(p.getValueClass())) {
addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE);
} else if (TimestampRange.class.isAssignableFrom(p.getValueClass())) {
addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE_TIME);
} else if (DateRange.class.isAssignableFrom(p.getValueClass())) {
addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE);
} else if (Number.class.isAssignableFrom(p.getValueClass())) {
addType(rd, mres, ResourceDescriptor.DT_TYPE_NUMBER);
} else if (Collection.class.isAssignableFrom(p.getValueClass())) {
rd.setControlType(ResourceDescriptor.IC_TYPE_MULTI_SELECT_LIST_OF_VALUES);
ResourceDescriptor dt = new ResourceDescriptor();
dt.setWsType(ResourceDescriptor.TYPE_LOV);
dt.setName("lov_" + rd.getName());
dt.setLabel("lov_" + rd.getName());
dt.setIsNew(true);
dt.setParentFolder(rd.getUriString() + "_files");
dt.setUriString(dt.getParentFolder() + "/" + rd.getName());
List<ListItem> values = new ArrayList<ListItem>();
dt.setListOfValues(values);
rd.getChildren().add(dt);
} else {
mrunit.removeChild(mres);
continue;
}
mres.setPublishOptions(new PublishOptions());
PublishUtil.getResources(mrunit, monitor, jrConfig).add(mres);
}
}
示例4: 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;
}