It's all about the answers!

Ask a question

RAM API to update category name


Harirajan Padmanabhan (1143) | asked Jul 15 '10, 12:03 a.m.
Has anyone used the RAM Java API to update category names? I am unable to get the setName method to work.

I have community admin access to the community in which the category schema I am updating is defined. I do not have repository admin access. I am able to add new categories and sub-categories to the schema I am using. I would like to be able to rename categories and sub-categories using the API.

Here is my code:

RAMCategorySchema testapiSchema = session.getCategorySchema("TestAPI");
RAMCategory level1Category1 = (RAMCategory)testapiSchema.getCategory("L1 Subcategory 1");
level1Category1.setName("L1 Category 1");
session.put(testapiSchema, new NullProgressMonitor());

I get the following exception:
com.ibm.ram.common.data.exception.RAMRuntimeException: Method is not executable by the client.
at com.ibm.ram.client.RAMCategory.setName(RAMCategory.java:441)
at com.ibm.assethub.test.HelloRAM.main(HelloRAM.java:49)

One answer



permanent link
Kevin Bauer (34621) | answered Jul 17 '10, 11:27 p.m.
JAZZ DEVELOPER
Hari,

The API lets you create category schemas, but we have not implemented the ability to allow you to update schemas.

Has anyone used the RAM Java API to update category names? I am unable to get the setName method to work.

I have community admin access to the community in which the category schema I am updating is defined. I do not have repository admin access. I am able to add new categories and sub-categories to the schema I am using. I would like to be able to rename categories and sub-categories using the API.

Here is my code:

RAMCategorySchema testapiSchema = session.getCategorySchema("TestAPI");
RAMCategory level1Category1 = (RAMCategory)testapiSchema.getCategory("L1 Subcategory 1");
level1Category1.setName("L1 Category 1");
session.put(testapiSchema, new NullProgressMonitor());

I get the following exception:
com.ibm.ram.common.data.exception.RAMRuntimeException: Method is not executable by the client.
at com.ibm.ram.client.RAMCategory.setName(RAMCategory.java:441)
at com.ibm.assethub.test.HelloRAM.main(HelloRAM.java:49)

Your answer


Register or to post your answer.