当前位置: 首页>>代码示例>>Java>>正文


Java ResourceDescriptor.setHasData方法代码示例

本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setHasData方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.setHasData方法的具体用法?Java ResourceDescriptor.setHasData怎么用?Java ResourceDescriptor.setHasData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor的用法示例。


在下文中一共展示了ResourceDescriptor.setHasData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
    }
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:CreateReportUnit.java

示例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());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:37,代码来源:ASelector.java

示例3: getMainReport

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor getMainReport(IProgressMonitor monitor, MReportUnit mrunit, JasperDesign jd) {
	String jrxmln = jd.getProperty(AExporter.PROP_REPORTRESOURCE);
	String unit = mrunit.getValue().getUriString();
	if (jrxmln != null) {
		if (unit != null && jrxmln.startsWith(unit) && jrxmln.length() > unit.length() && jrxmln.substring((unit + WSClientHelper._FILES).length()).indexOf('/') < 0) {
			MServerProfile sp = (MServerProfile) mrunit.getRoot();
			if (sp != null) {
				ResourceDescriptor rd = new ResourceDescriptor();
				rd.setName(jrxmln.substring((unit + WSClientHelper._FILES).length()));
				rd.setLabel(IDStringValidator.safeChar(rd.getName()));
				rd.setUriString(jrxmln);
				rd.setParentFolder(unit + "_files");
				rd.setUriString(rd.getParentFolder() + "/" + rd.getName());
				rd.setIsNew(true);
				rd.setWsType(ResourceDescriptor.TYPE_JRXML);
				rd.setIsReference(false);
				rd.setHasData(true);
				try {
					rd = sp.getWsClient(monitor).get(monitor, rd, null);
					rd.setHasData(true);
					if (rd != null)
						return rd;
				} catch (Exception e) {
					rd.setMainReport(true);
					return rd;
				}
			}
		}
	}
	ResourceDescriptor mainr = new ResourceDescriptor();
	mainr.setName(Messages.JrxmlPublishAction_defaultresourcename);
	mainr.setLabel(Messages.JrxmlPublishAction_defaultresourcelabel);
	mainr.setWsType(ResourceDescriptor.TYPE_JRXML);
	mainr.setIsNew(true);
	mainr.setMainReport(true);
	mainr.setIsReference(false);
	mainr.setHasData(true);
	mainr.setParentFolder(unit + "_files");
	mainr.setUriString(mainr.getParentFolder() + "/" + mainr.getName());
	return mainr;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:42,代码来源:PublishUtil.java

示例4: saveResource

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor saveResource(MResource res, IProgressMonitor monitor, boolean refresh) throws Exception {
	INode n = res.getRoot();
	ResourceDescriptor rd = null;
	if (n != null && n instanceof MServerProfile) {
		MServerProfile sp = (MServerProfile) n;
		rd = res.getValue();
		if (rd.getIsNew()) {
			rd.setUriString(getParentFolder(rd) + rd.getName());
		}
		File file = null;
		if (res instanceof AFileResource) {
			file = ((AFileResource) res).getFile();
			if (file != null) {
				rd.setData(Base64.encodeBase64(FileUtils.getBytes(file)));
				rd.setHasData(true);
			} else
				rd.setHasData(false);
		} else
			rd.setHasData(false);

		MReportUnit mru = res.getReportUnit();
		IConnection cli = sp.getWsClient(monitor);
		if (cli == null)
			cli = connect(sp, monitor);
		System.out.println("saving: " + rd.getUriString() + " parent:" + rd.getParentFolder());
		if (mru != null && res != mru) {
			String wsType = rd.getWsType();
			if (wsType.equals(ResourceDescriptor.TYPE_INPUT_CONTROL) && !rd.getIsNew())
				rd = cli.addOrModifyResource(monitor, rd, file);
			else if (res instanceof MRDataAdapterFile || res instanceof MRDataAdapter)
				rd = cli.addOrModifyResource(monitor, rd, file);
			else {
				if (wsType.equals(ResourceDescriptor.TYPE_JRXML) && !rd.getIsNew() && rd.getName().equals("main_jrxml"))
					rd.setMainReport(true);
				// String turi = rd.getUriString();
				ResourceDescriptor trd = cli.modifyReportUnitResource(monitor, mru.getValue(), rd, file);
				// if (!trd.getUriString().equals(turi))
				// rd = getResource(cli, rd, null);
				rd = trd;
			}
		} else
			rd = cli.addOrModifyResource(monitor, rd, file);
		if (refresh && res.getParent() instanceof MResource) {
			// standard resource creation inside an existing MResource
			refreshContainer((MResource) res.getParent(), monitor);
		} else if (res.getParent() instanceof MServerProfile) {
			// resource created inside the root folder
			connectGetData((MServerProfile) res.getParent(), monitor);
			fireResourceChanged(res);
		}
	}
	return rd;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:54,代码来源:WSClientHelper.java

示例5: createReportUnit

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static void createReportUnit(WSClient client, String folder, String name, String label, String jrxmlFile) throws Exception {

        String reportUnitUri = folder + "/" + name;
        
        ResourceDescriptor rd = new ResourceDescriptor();
        rd.setName(name);
        rd.setLabel(label);
        rd.setWsType(ResourceDescriptor.TYPE_REPORTUNIT);
        rd.setUriString(folder + "/" + name);
        rd.setParentFolder(folder);
        


        // If you want delete the report in case it already exists, just uncomment this code

        //try {
        //    client.delete(rd);
        //} catch (Exception ex) { }

        rd.setIsNew(true);
        rd.setResourceProperty(ResourceDescriptor.PROP_RU_ALWAYS_PROPMT_CONTROLS, true);

        ResourceDescriptor datasource = new ResourceDescriptor();
        datasource.setIsNew(true);
        datasource.setWsType(ResourceDescriptor.TYPE_DATASOURCE);
        datasource.setIsReference(true);
        datasource.setReferenceUri("/datasources/JServerJdbcDS");
        rd.getChildren().add(datasource);

        ResourceDescriptor jrxmlDescriptor = new ResourceDescriptor();
        jrxmlDescriptor.setName("main_jrxml");
        jrxmlDescriptor.setLabel("Main Jrxml");
        jrxmlDescriptor.setWsType( ResourceDescriptor.TYPE_JRXML );
        jrxmlDescriptor.setIsNew(true);
        jrxmlDescriptor.setMainReport(true);
        jrxmlDescriptor.setIsReference(false);
        jrxmlDescriptor.setHasData(true);
        rd.getChildren().add( jrxmlDescriptor );

        client.addOrModifyResource( rd, new File(jrxmlFile));
        
        System.out.println("  Created report " + label);
        System.out.flush();
    }
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:45,代码来源:CreateReportUnit.java

示例6: putReportUnitResource

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public ResourceDescriptor putReportUnitResource(String reportUnitUri, ResourceDescriptor descriptor, RequestAttachment[] attachments) throws Exception {

		try {
			Request req = new Request();
			req.setOperationName("put"); //$NON-NLS-1$
			req.setLocale(getServer().getLocale());

			if (reportUnitUri != null && reportUnitUri.length() > 0) {
				req.getArguments().add(new Argument(Argument.MODIFY_REPORTUNIT, reportUnitUri));
			}

			ManagementService ms = getManagementService();

			// ManagementServiceServiceLocator rsl = new
			// ManagementServiceServiceLocator();
			// ManagementService ms = rsl.getrepository(new java.net.URL(
			// getWebservicesUri() ) );
			// ((org.apache.axis.client.Stub)ms).setUsername( getUsername() );
			// ((org.apache.axis.client.Stub)ms).setPassword( getPassword() );
			// ((org.apache.axis.client.Stub)ms).setMaintainSession( false );

			// attach the file...
			if (attachments != null && attachments.length > 0) {
				descriptor.setHasData(true);
				// Tell the stub that the message being formed also contains an
				// attachment, and it is of type MIME encoding.
				if (getServer().isMime())
					((org.apache.axis.client.Stub) ms)._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_MIME);
				else
					((org.apache.axis.client.Stub) ms)._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME);

				for (int i = 0; i < attachments.length; i++) {
					RequestAttachment attachment = attachments[i];
					DataHandler attachmentHandler = new DataHandler(attachment.getDataSource());
					AttachmentPart attachmentPart = new AttachmentPart(attachmentHandler);
					if (attachment.getContentID() != null) {
						attachmentPart.setContentId(attachment.getContentID());
					}

					// Add the attachment to the message
					((org.apache.axis.client.Stub) ms).addAttachment(attachmentPart);
				}
			}

			req.setResourceDescriptor(descriptor);

			String result = ms.put(marshaller.marshal(req));

			OperationResult or = (OperationResult) unmarshal(result);

			if (or.getReturnCode() != 0)
				throw new Exception(composeErrorMessage(or));

			return (ResourceDescriptor) or.getResourceDescriptors().get(0);

		} catch (Exception ex) {
			// ex.printStackTrace();
			throw ex;
		}
	}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:61,代码来源:WSClient.java


注:本文中的com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setHasData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。