本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setControlType方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.setControlType方法的具体用法?Java ResourceDescriptor.setControlType怎么用?Java ResourceDescriptor.setControlType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
的用法示例。
在下文中一共展示了ResourceDescriptor.setControlType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInputControl
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static void getInputControl(ARestV2Connection rc, ClientInputControl cr, ResourceDescriptor rd) throws ParseException {
rd.setMandatory(cr.isMandatory());
rd.setReadOnly(cr.isReadOnly());
rd.setVisible(cr.isVisible());
if (cr.getListOfValues() != null)
rd.getChildren().add(getRDContainer(rc, (ClientListOfValues) cr.getListOfValues()));
if (cr.getQuery() != null)
rd.getChildren().add(getRDContainer(rc, (ClientQuery) cr.getQuery()));
if (cr.getDataType() != null)
rd.getChildren().add(getRDContainer(rc, (ClientDataType) cr.getDataType()));
rd.setControlType(cr.getType());
rd.setQueryValueColumn(cr.getValueColumn());
if (cr.getVisibleColumns() != null)
rd.setQueryVisibleColumns(cr.getVisibleColumns().toArray(new String[cr.getVisibleColumns().size()]));
}
示例2: 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);
}
}
示例3: createDescriptor
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor createDescriptor(ANode parent) {
ResourceDescriptor rd = MResource.createDescriptor(parent);
rd.setWsType(ResourceDescriptor.TYPE_INPUT_CONTROL);
rd.setControlType(ResourceDescriptor.IC_TYPE_BOOLEAN);
return rd;
}