Forum

This content is now out of date.

Visit Our Community

Create a category using yellowfin API

Hi

I am trying to use yellowfin web service API to create a new category, i have the following code, please help me on what i am doing wrong here

AdministrationServiceRequest rsr = new AdministrationServiceRequest();
AdministrationServiceResponse rs = null;

rsr.setLoginId(adminUserName);
rsr.setPassword(adminUserPassword);
rsr.setOrgId(new Integer(1));

rsr.setFunction("TESTIMPORTCONTENT");
rsr.setParameters(new String[] { parameters });
try {
AdministrationPerson adminPerson = new AdministrationPerson();
adminPerson.setUserId(userEmail);
AdministrationServiceService ts = getAdministrationServiceService();
AdministrationServiceSoapBindingStub rssbs = (AdministrationServiceSoapBindingStub) ts
.getAdministrationService();
// rsr.setPerson(adminPerson);
ArrayList importOptions = new ArrayList();
ImportOption importOption = new ImportOption();
importOption.setItemIndex(0);
importOption.setOptionKey("SKIP");
importOption.setOptionValue("false");
importOptions.add(importOption);

importOption = new ImportOption();
importOption.setItemIndex(1);
importOption.setOptionKey("OPTION");
importOption.setOptionValue("ADD");
importOptions.add(importOption);

rsr.setImportOptions(importOptions.toArray(new ImportOption[0]));

rs = rssbs.remoteAdministrationCall(rsr);
log.debug(rs.getStatusCode());
log.debug(rs.getImportIssues().length);

Hi,

with the TESTIMPORTCONTENT (and IMPORTCONTENT) webservice functions you can either create a new category if the new category is included as part of the export XML file, in which case you must use the IMP prefix as described in our documentation:



Forum image



or you can use a category that already exists in the repository, in which case you must use the CAT prefix:


Forum image



If you are interested, the above screenshots were taken from the the link "6.1 WebServices documentation" which is found towards the bottom of this other forum post.


regards,
Dave