本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.setLabel方法的具体用法?Java ResourceDescriptor.setLabel怎么用?Java ResourceDescriptor.setLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
的用法示例。
在下文中一共展示了ResourceDescriptor.setLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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);
}
示例3: 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();
}
}
示例4: getVirtualDataSource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static void getVirtualDataSource(ARestV2Connection rc, ClientVirtualDataSource cr, ResourceDescriptor rd) throws ParseException {
if (cr.getSubDataSources() != null)
for (ClientSubDataSourceReference sds : cr.getSubDataSources()) {
ResourceDescriptor r = new ResourceDescriptor();
r.setName(rd.getName());
r.setLabel(rd.getLabel());
r.setIsReference(true);
r.setReferenceUri(sds.getUri());
r.setWsType(ResourceDescriptor.TYPE_DATASOURCE);
r.setIsNew(true);
r.setResourceProperty("PROP_DATASOURCE_SUB_DS_ID", sds.getId());
rd.getChildren().add(r);
}
}
示例5: 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;
}
示例6: addReportInputControl
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static void addReportInputControl(WSClient client, String reportUnitUri, String name, String label) throws Exception {
// Let's add a simple input controls...
ResourceDescriptor icDescriptor = new ResourceDescriptor();
icDescriptor.setName(name);
icDescriptor.setLabel(label);
icDescriptor.setIsNew(true);
icDescriptor.setIsReference(false);
icDescriptor.setWsType( ResourceDescriptor.TYPE_INPUT_CONTROL );
icDescriptor.setResourceProperty( ResourceDescriptor.PROP_INPUTCONTROL_TYPE, ResourceDescriptor.IC_TYPE_SINGLE_VALUE);
icDescriptor.setUriString(reportUnitUri+"/<controls>/"+name);
// Now we need to add the input control data type...
ResourceDescriptor dataTypeDescriptor = new ResourceDescriptor();
dataTypeDescriptor.setName("myDatatype");
dataTypeDescriptor.setLabel("Simple text data type");
dataTypeDescriptor.setIsNew(true);
dataTypeDescriptor.setIsReference(false);
dataTypeDescriptor.setWsType( ResourceDescriptor.TYPE_DATA_TYPE );
dataTypeDescriptor.setDataType( ResourceDescriptor.DT_TYPE_TEXT);
dataTypeDescriptor.setUriString(reportUnitUri+"/<controls>/" + name +"/myDatatype");
if (icDescriptor.getChildren() == null) icDescriptor.setChildren(new java.util.ArrayList());
icDescriptor.getChildren().add(dataTypeDescriptor);
client.modifyReportUnitResource(reportUnitUri, icDescriptor, null);
System.out.println(" Input control " + name + " added to the report");
System.out.flush();
}
示例7: 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;
}
示例8: getNewRunit
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private AFileResource getNewRunit() {
if (newRes == null) {
ResourceDescriptor rd = AFileResource.createDescriptor(null);
rd.setWsType(ResourceDescriptor.TYPE_CONTENT_RESOURCE);
rd.setName(null);
PublishUtil.initResourceName(file.getName(), rd);
rd.setLabel(file.getName());
newRes = new MContentResource(null, rd, -1);
newRes.setJasperConfiguration(jConfig);
}
return newRes;
}
示例9: 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 + "/";
}
}
示例10: createLocal
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected ResourceDescriptor createLocal(MResource res) {
ResourceDescriptor rd = MRQuery.createDescriptor(res);
rd.setName(Messages.SelectorQuery_0);
rd.setLabel(rd.getName());
return rd;
}
示例11: createLocal
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected ResourceDescriptor createLocal(MResource res) {
ResourceDescriptor rd = MDataType.createDescriptor(res);
rd.setName("DataType");
rd.setLabel(rd.getName());
return rd;
}
示例12: 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());
}
示例13: createLocal
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected ResourceDescriptor createLocal(MResource res) {
ResourceDescriptor rd = MListOfValues.createDescriptor(res);
rd.setName("ListOfValues");
rd.setLabel(rd.getName());
return rd;
}
示例14: createLocal
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected ResourceDescriptor createLocal(MResource res) {
ResourceDescriptor rd = MJrxml.createDescriptor(res);
rd.setName(MJrxml.getIconDescriptor().getTitle());
rd.setLabel(rd.getName());
return rd;
}
示例15: createLocal
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected ResourceDescriptor createLocal(MResource res) {
ResourceDescriptor rd = MContentResource.createDescriptor(res);
rd.setName(MContentResource.getIconDescriptor().getTitle());
rd.setLabel(rd.getName());
return rd;
}