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


Java ResourceDescriptor.setIsNew方法代码示例

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


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

示例1: createDescriptor

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor createDescriptor(ANode parent) {
	ResourceDescriptor rd = new ResourceDescriptor();
	rd.setIsNew(true);
	rd.setIsReference(false);
	rd.setName("NewResource");
	// rd.setLabel(rd.getName());
	if (parent != null) {
		if (parent instanceof MResource)
			if (parent instanceof MFolder)
				rd.setParentFolder(((MResource) parent).getValue().getUriString());
			else
				rd.setParentFolder(((MResource) parent).getValue().getUriString() + "_files");
		else
			rd.setParentFolder("/");
	}
	return rd;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:MResource.java

示例2: getLocalResource

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected MResource getLocalResource(MResource res, ResourceDescriptor runit, ANode pnode) {
	AddResourceWizard wizard = new AddResourceWizard(res, true);
	wizard.setMondrianOnly(true);
	WizardDialog dialog = new WizardDialog(UIUtils.getShell(), wizard);
	dialog.create();
	if (dialog.open() != Dialog.OK)
		return null;
	MResource r = wizard.getResource();
	ResourceDescriptor ref = r.getValue();
	ref.setIsNew(true);
	ref.setIsReference(false);
	ref.setParentFolder(runit.getParentFolder() + "/" + runit.getName() + "_files"); //$NON-NLS-1$
	ref.setDirty(true);
	return r;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:SelectorMondrianConnection.java

示例3: getLocalResource

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
@Override
protected MResource getLocalResource(MResource res, ResourceDescriptor runit, ANode pnode) {
	AddResourceWizard wizard = new AddResourceWizard(res, true);
	wizard.setOlapOnly(true);
	WizardDialog dialog = new WizardDialog(UIUtils.getShell(), wizard);
	dialog.create();
	if (dialog.open() != Dialog.OK)
		return null;
	MResource r = wizard.getResource();
	ResourceDescriptor ref = r.getValue();
	ref.setIsNew(true);
	ref.setIsReference(false);
	ref.setParentFolder(runit.getParentFolder() + "/" + runit.getName() + "_files"); //$NON-NLS-1$
	ref.setDirty(true);
	return r;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:SelectorOlapConnection.java

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

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

示例6: addType

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor addType(ResourceDescriptor rd, MInputControl mres, byte type) {
	ResourceDescriptor rdtype = MDataType.createDescriptor(mres);
	String name = "myDatatype";
	rdtype.setName(name);
	rdtype.setLabel(name);
	rdtype.setIsNew(true);
	rdtype.setDataType(type);
	rdtype.setIsReference(false);
	rdtype.setParentFolder(rd.getUriString() + "_files");
	rdtype.setUriString(rdtype.getParentFolder() + "/" + name);

	rd.getChildren().add(rdtype);
	return rdtype;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:ImpInputControls.java

示例7: resolveReference

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor resolveReference(IConnection wsc, ResourceDescriptor refrd, IProgressMonitor monitor) throws Exception {
	ResourceDescriptor rd = new ResourceDescriptor();
	rd.setUriString(refrd.getReferenceUri());
	rd.setIsNew(false);
	rd.setWsType(refrd.getWsType());

	rd = wsc.get(monitor, rd, null);
	if (monitor != null && monitor.isCanceled())
		return rd;
	if (rd.getIsReference())
		resolveReference(wsc, rd, monitor);
	return rd;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:ReferenceResolver.java

示例8: getLocalResource

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
protected MResource getLocalResource(MResource res, ResourceDescriptor runit, ANode pnode) {
	ResourceDescriptor ref = createLocal(res);
	ref.setIsNew(true);
	ref.setIsReference(false);
	ref.setParentFolder(runit.getParentFolder() + "/" + runit.getName() + "_files"); //$NON-NLS-1$
	setupResource(ref);
	ref.setDirty(true);

	MResource r = ResourceFactory.getResource(null, ref, -1);
	if (!showLocalWizard(r, pnode))
		return null;
	return r;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:ASelector.java

示例9: cloneResource

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor cloneResource(ResourceDescriptor rd) {
	ResourceDescriptor rnew = new ResourceDescriptor();
	copyFields(rd, rnew);

	rnew.setIsNew(rd.getIsNew());
	rnew.setIsReference(rd.getIsReference());

	rnew.setUriString(rd.getUriString());
	rnew.setParentFolder(rd.getParentFolder());
	rnew.setDataSourceType(rd.getDataSourceType());
	rnew.setWsType(rd.getWsType());

	return rnew;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:ASelector.java

示例10: doPasteIntoReportUnit

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
protected ResourceDescriptor doPasteIntoReportUnit(ResourceDescriptor prd, ResourceDescriptor origin) {
	String ruuri = prd.getUriString();
	origin.setParentFolder(ruuri + "_files"); //$NON-NLS-1$
	origin.setUriString(ruuri + "_files/" + origin.getName()); //$NON-NLS-1$
	origin.setIsNew(true);
	origin.setName(getRName(origin.getName(), prd.getChildren()));
	origin.setLabel(origin.getLabel());
	origin.setMainReport(false);
	return origin;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:PasteResourceAction.java

示例11: 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();
        }

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

示例12: 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();

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

示例13: getRD

import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor getRD(ARestV2Connection rc, ClientResource<?> cr, ResourceDescriptor rd) throws ParseException {
	rd.getChildren().clear();
	rd.setWsType(WsTypes.INST().toSoapType(cr));
	rd.setIsNew(false);

	rd.setParentFolder(RDUtil.getParentFolder(cr.getUri()));
	rd.setUriString(cr.getUri());
	rd.setLabel(cr.getLabel());
	rd.setDescription(cr.getDescription());
	rd.setName(RDUtil.getID(cr.getUri()));
	rd.setVersion(Misc.nvl(cr.getVersion(), 0));

	rd.setCreationDate(rc.toTimestamp(cr.getCreationDate()));
	DiffFields.setSoapValue(rd, DiffFields.UPDATEDATE, cr.getUpdateDate());
	rd.setPermissionMask(Misc.nvl(cr.getPermissionMask(), 0));

	// look recursively
	if (cr instanceof ClientDataType)
		getDataType(rc, (ClientDataType) cr, rd);

	else if (cr instanceof ClientAdhocDataView)
		getAdhocDataView(rc, (ClientAdhocDataView) cr, rd);

	else if (cr instanceof ClientJdbcDataSource)
		getJdbcDataSource(rc, (ClientJdbcDataSource) cr, rd);
	else if (cr instanceof ClientJndiJdbcDataSource)
		getJndiDataSource(rc, (ClientJndiJdbcDataSource) cr, rd);
	else if (cr instanceof ClientAwsDataSource)
		getAWSDataSource(rc, (ClientAwsDataSource) cr, rd);
	else if (cr instanceof ClientVirtualDataSource)
		getVirtualDataSource(rc, (ClientVirtualDataSource) cr, rd);
	else if (cr instanceof ClientCustomDataSource)
		getCustomDataSource(rc, (ClientCustomDataSource) cr, rd);
	else if (cr instanceof ClientBeanDataSource)
		getBeanDataSource(rc, (ClientBeanDataSource) cr, rd);
	else if (cr instanceof ClientOlapUnit)
		getOlapUnit(rc, (ClientOlapUnit) cr, rd);

	else if (cr instanceof ClientQuery)
		getQuery(rc, (ClientQuery) cr, rd);

	else if (cr instanceof ClientXmlaConnection)
		getXmlaConnection(rc, (ClientXmlaConnection) cr, rd);
	else if (cr instanceof ClientMondrianConnection)
		getMondrianConnection(rc, (ClientMondrianConnection) cr, rd);
	else if (cr instanceof ClientSecureMondrianConnection)
		getSecureMondrianConnection(rc, (ClientSecureMondrianConnection) cr, rd);
	else if (cr instanceof ClientMondrianXmlaDefinition)
		getMondrianXmlaDefinition(rc, (ClientMondrianXmlaDefinition) cr, rd);

	else if (cr instanceof ClientListOfValues)
		getLOV(rc, (ClientListOfValues) cr, rd);
	else if (cr instanceof AbstractClientReportUnit)
		getReportUnit(rc, (AbstractClientReportUnit<?>) cr, rd);
	else if (cr instanceof ClientInputControl)
		getInputControl(rc, (ClientInputControl) cr, rd);
	else if (cr instanceof ClientFile)
		getFile(rc, (ClientFile) cr, rd);
	else
		rd = Misc.nvl(Activator.getExtManager().getRD(rc, cr, rd), rd);

	return rd;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:64,代码来源:Rest2Soap.java

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

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


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