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


Java ResourceDescriptor.getWsType方法代码示例

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


在下文中一共展示了ResourceDescriptor.getWsType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cascadeInputControls

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
public List<ResourceDescriptor> cascadeInputControls(ResourceDescriptor runit, List<ResourceDescriptor> ics, IProgressMonitor monitor) throws Exception {
	String dsUri = null;
	for (ResourceDescriptor sub_rd : runit.getChildren()) {
		String wsType = sub_rd.getWsType();
		if (wsType.equals(ResourceDescriptor.TYPE_DATASOURCE) && sub_rd.getIsReference())
			dsUri = sub_rd.getReferenceUri();
		else if (SelectorDatasource.isDatasource(sub_rd))
			dsUri = sub_rd.getUriString();
	}
	String ruri = runit.getUriString();
	List<ResourceDescriptor> res = new ArrayList<ResourceDescriptor>();
	for (ResourceDescriptor rd : ics)
		res.add(updateControl(ruri, dsUri, rd, monitor));
	return res;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:SoapConnection.java

示例2: getQuery

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private static ResourceDescriptor getQuery(ResourceDescriptor ru) {
	for (Object obj : ru.getChildren()) {
		ResourceDescriptor r = (ResourceDescriptor) obj;
		String t = r.getWsType();
		if (t.equals(ResourceDescriptor.TYPE_QUERY))
			return r;
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:SelectorQuery.java

示例3: getResourceDescriptor

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected ResourceDescriptor getResourceDescriptor(ResourceDescriptor ru) {
	for (Object obj : ru.getChildren()) {
		ResourceDescriptor r = (ResourceDescriptor) obj;
		String t = r.getWsType();
		if (t.equals(ResourceDescriptor.TYPE_LOV))
			return r;
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:SelectorLov.java

示例4: initInputControls

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public void initInputControls(ResourceDescriptor rdrepunit) {
	this.rdrepunit = rdrepunit;
	inputcontrols = new ArrayList<ResourceDescriptor>();
	if (rdrepunit != null)
		for (ResourceDescriptor sub_rd : rdrepunit.getChildren()) {
			String wsType = sub_rd.getWsType();
			if (wsType.equals(ResourceDescriptor.TYPE_INPUT_CONTROL))
				inputcontrols.add(sub_rd);
		}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:InputControlsManager.java

示例5: getReportUnit

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static void getReportUnit(ARestV2Connection rc, AbstractClientReportUnit<?> cr, ResourceDescriptor rd) throws ParseException {
	cr.setAlwaysPromptControls(Misc.nvl(rd.getResourcePropertyValueAsBoolean(ResourceDescriptor.PROP_RU_ALWAYS_PROPMT_CONTROLS), Boolean.FALSE));
	cr.setInputControlRenderingView(rd.getResourcePropertyValue(ResourceDescriptor.PROP_RU_INPUTCONTROL_RENDERING_VIEW));
	cr.setReportRenderingView(rd.getResourcePropertyValue(ResourceDescriptor.PROP_RU_REPORT_RENDERING_VIEW));
	int rurv = Misc.nvl(rd.getResourcePropertyValueAsInteger(ResourceDescriptor.PROP_RU_CONTROLS_LAYOUT), (int) ResourceDescriptor.RU_CONTROLS_LAYOUT_POPUP_SCREEN);
	switch (rurv) {
	case (int) ResourceDescriptor.RU_CONTROLS_LAYOUT_POPUP_SCREEN:
		cr.setControlsLayout(ControlsLayoutType.popupScreen);
		break;
	case (int) ResourceDescriptor.RU_CONTROLS_LAYOUT_SEPARATE_PAGE:
		cr.setControlsLayout(ControlsLayoutType.separatePage);
		break;
	case (int) ResourceDescriptor.RU_CONTROLS_LAYOUT_TOP_OF_PAGE:
		cr.setControlsLayout(ControlsLayoutType.topOfPage);
		break;
	case 4:
		cr.setControlsLayout(ControlsLayoutType.inPage);
		break;
	}
	List<ResourceDescriptor> children = rd.getChildren();
	List<ClientReferenceableInputControl> ics = cr.getInputControls();
	if (ics == null) {
		ics = new ArrayList<ClientReferenceableInputControl>();
		cr.setInputControls(ics);
	}
	Map<String, ClientReferenceableFile> icf = cr.getFiles();
	if (icf == null) {
		icf = new HashMap<String, ClientReferenceableFile>();
		cr.setFiles(icf);
	}
	for (ResourceDescriptor r : children) {
		if (r == null)
			continue;
		if (SelectorDatasource.isDatasource(r))
			cr.setDataSource((ClientReferenceableDataSource) getResourceContainer(rc, r));
		else {
			String t = r.getWsType();
			if (t.equals(ResourceDescriptor.TYPE_QUERY))
				cr.setQuery((ClientReferenceableQuery) getResourceContainer(rc, r));
			else if ((t.equals(ResourceDescriptor.TYPE_JRXML) || t.equals(ResourceDescriptor.TYPE_REFERENCE)) && r.isMainReport()) {
				// r.setName("main_jrxml");
				// r.setLabel("Main Jrxml");
				// r.setUriString(rd.getUriString() + "_files/" + r.getName());
				cr.setJrxml((ClientReferenceableFile) getResourceContainer(rc, r));
			} else if (t.equals(ResourceDescriptor.TYPE_INPUT_CONTROL))
				ics.add((ClientReferenceableInputControl) getResourceContainer(rc, r));
			else if (ResourceFactory.isFileResourceType(r) || t.equals(ResourceDescriptor.TYPE_REFERENCE)) {
				icf.put(r.getName(), (ClientReferenceableFile) getResourceContainer(rc, r));
			}
		}
	}

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:54,代码来源:Soap2Rest.java

示例6: 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

示例7: dorun

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
protected void dorun(final Object obj, IProgressMonitor monitor) throws Exception, FileNotFoundException, IOException {
	if (isFileResource(obj)) {
		AFileResource res = (AFileResource) obj;
		ResourceDescriptor rd = WSClientHelper.getResource(new NullProgressMonitor(), res, res.getValue());
		ANode parent = res.getParent();
		int index = parent.getChildren().indexOf(res);
		parent.removeChild(res);
		res = (AFileResource) ResourceFactory.getResource(parent, rd, index);
		WSClientHelper.fireResourceChanged(res);

		String fkeyname = ServerManager.getKey(res);
		if (fkeyname == null)
			return;
		String type = rd.getWsType();
		IFile f = null;
		if (type.equals(ResourceDescriptor.TYPE_JRXML)) {
			IFile file = new JrxmlExporter(path).exportToIFile(res, rd, fkeyname, monitor);
			if (file != null) {
				JasperReportsConfiguration.getDefaultJRConfig(file).getPrefStore().setValue(JRSEditorContributor.KEY_PUBLISH2JSS_SILENT, true);
				openEditor(file);
			}
			if (res.getParent() instanceof MReportUnit) {
				for (INode n : res.getParent().getChildren()) {
					if (n instanceof MJar) {
						MJar mjar = (MJar) n;
						fkeyname = ServerManager.getKey(mjar);
						rd = WSClientHelper.getResource(new NullProgressMonitor(), mjar, mjar.getValue());
						f = new AExporter(path).exportToIFile(mjar, rd, fkeyname, monitor);
						if (f != null)
							PublishUtil.savePath(f, mjar);
					}
				}
			}
			return;
		} else if (type.equals(ResourceDescriptor.TYPE_IMAGE))
			f = new ImageExporter(path).exportToIFile(res, rd, fkeyname, monitor);
		else
			f = new AExporter(path).exportToIFile(res, rd, fkeyname, monitor);

		if (f != null) {
			PublishUtil.savePath(f, res);
			openEditor(f);
		}
		path = null;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:47,代码来源:OpenInEditorAction.java

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


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