本文整理汇总了Java中com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor.setParentFolder方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptor.setParentFolder方法的具体用法?Java ResourceDescriptor.setParentFolder怎么用?Java ResourceDescriptor.setParentFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
的用法示例。
在下文中一共展示了ResourceDescriptor.setParentFolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setResource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private void setResource(MResource res, ResourceDescriptor rd) {
ResourceDescriptor runit = res.getValue();
try {
rd = WSClientHelper.getResource(new NullProgressMonitor(), parent, rd);
rd.setIsReference(true);
rd.setReferenceUri(rd.getUriString());
rd.setParentFolder(runit.getParentFolder() + "/" + runit.getName() + "_files"); //$NON-NLS-1$ //$NON-NLS-2$
rd.setWsType(rd.getWsType());
rd.setUriString(rd.getParentFolder() + "/" + rd.getName());//$NON-NLS-1$
SelectorDatasource.replaceDatasource(res, rd);
rd.setDirty(false);
textDSFromRepo.setText(rd.getReferenceUri());
} catch (Exception e1) {
UIUtils.showError(e1);
}
}
示例2: loadPreferences
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static void loadPreferences(IProgressMonitor monitor, IFile ifile, MResource f) {
PublishOptions popt = f.getPublishOptions();
String prefix = f.getValue().getName();
try {
String ovw = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".overwrite"));
if (ovw != null)
popt.setOverwrite(Boolean.parseBoolean(ovw));
String ref = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".reference"));
if (ref != null) {
popt.setPublishMethod(ResourcePublishMethod.valueOf(ref));
String path = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".refPATH"));
if (path != null) {
ResourceDescriptor rd = new ResourceDescriptor();
rd.setParentFolder(RDUtil.getParentFolder(path));
rd.setUriString(path);
rd.setWsType(f.getValue().getWsType());
popt.setReferencedResource(WSClientHelper.getResource(monitor, f, rd, FileUtils.createTempFile("tmp", "")));
} else
popt.setPublishMethod(ResourcePublishMethod.LOCAL);
}
} catch (Exception e) {
popt.setPublishMethod(ResourcePublishMethod.LOCAL);
e.printStackTrace();
}
}
示例3: 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;
}
示例4: setRemoteResource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private void setRemoteResource(MResource res, ResourceDescriptor rd, ANode parent) {
ResourceDescriptor runit = res.getValue();
try {
rd = WSClientHelper.getResource(new NullProgressMonitor(), parent, rd);
rd.setIsReference(true);
rd.setMainReport(true);
rd.setReferenceUri(rd.getUriString());
rd.setParentFolder(runit.getParentFolder() + "/" + runit.getName() + "_files");
rd.setWsType(ResourceDescriptor.TYPE_JRXML);
rd.setUriString(rd.getParentFolder() + "/" + rd.getName());
replaceMainReport(res, rd);
rd.setDirty(false);
fireSelectionChanged();
jsRefDS.setText(rd.getUriString());
} catch (Exception e1) {
UIUtils.showError(e1);
}
}
示例5: setRemoteResource
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
private void setRemoteResource(MResource res, ResourceDescriptor rd, ANode pnode) {
ResourceDescriptor runit = res.getValue();
try {
rd = WSClientHelper.getResource(new NullProgressMonitor(), pnode, rd);
rd.setIsReference(true);
rd.setReferenceUri(rd.getUriString());
rd.setParentFolder(runit.getParentFolder() + "/" + runit.getName() + "_files"); //$NON-NLS-1$ //$NON-NLS-2$
rd.setUriString(rd.getParentFolder() + "/" + rd.getName());//$NON-NLS-1$
setupResource(rd);
replaceChildren(res, rd);
jsRefDS.setText(rd.getReferenceUri());
} catch (Exception e1) {
UIUtils.showError(e1);
}
firePageComplete();
}
示例6: 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;
}
示例7: 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;
}
示例8: getReference
import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor; //导入方法依赖的package包/类
public static ResourceDescriptor getReference(IProgressMonitor monitor, ANode root, ResourceDescriptor rd) throws Exception {
MServerProfile sp = (MServerProfile) root.getRoot();
if (rd.getReferenceUri() != null) {
String ref = rd.getReferenceUri();
int ldel = ref.lastIndexOf("/");
String pfolder = ref.substring(0, ldel - 1);
String file = ref.substring(ldel + 1, ref.length());
ResourceDescriptor r = new ResourceDescriptor();
r.setParentFolder(pfolder);
r.setName(file);
r.setUriString(rd.getReferenceUri());
r.setWsType(ResourceDescriptor.TYPE_CONTENT_RESOURCE);
return sp.getWsClient(monitor).get(monitor, r, null);
}
return null;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: 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;
}
示例14: 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;
}
示例15: 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);
}
}