cancel
Showing results for 
Search instead for 
Did you mean: 

How to classify a document

Former Member
0 Kudos

Hi,

Surfing through SND I found this post

https://www.sdn.sap.com/irj/sdn/thread?threadID=229951

I implemented the code that they suggest in the post and didn’t show any error in the log but I couldn’t classify the document.

The value of IRidList for my taxonomy is "".

Could anyone help me in order to classify a document?

Regards,

Orlando Covault

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ankur,

Thanks for the information about the classification, but unfortunally that’s not what I’m looking for. I’m developing a repository service that allows me to classify a document in his upload, so I need information about how to classify a document via API. The thread that I previously post seems to be a near approach but I don’t know why it doesn’t work for me. If you have any other information please don’t doubt to send it to me.

Regards,

Orlando Covault

0 Kudos

Hi,

Check if your index has Classification service and before you assign Document2TaxCategory, reindex your index. Also check if the Taxonomies are defined in your index.

Check this method, which gets IClassificationIndex for taxonomies, this way you can make sure if an index exists for taxonomy.

public static IClassificationIndex getClassificationIndex(RID taxRID) throws WcmException {
        IClassificationIndex classIndex = null;
//        taxonomyName = ClassificationUtils.getTaxonomyNameFromRid(taxRID);
//        setTaxonomy(taxonomyName);
        IIndexService indexService =
            (IIndexService) ResourceFactory.getInstance().getServiceFactory().getService("IndexmanagementService");
        if (indexService != null) {
            classIndex = (IClassificationIndex) indexService.getIndexForResource(taxRID, "classification");
            if (IndexCheck.isValidForUI(classIndex))
                return classIndex;
            else
                return null;
        } else {
            return null;
        }
    }

If this all does not work, remove the index and create it again with taxonomies.

Greetings,

Praveen Gudapati

Former Member
0 Kudos

Hi Praveen,

The method getClassificationIndex(RID taxRID) returns a valid object and my Index is working fine one thing that a print on the log is the taxList in the method assignDocument2TaxCategory and prints "", I suppose this is correct because the IResource document is just being upload (I don’t know if this give you a clue).

But I’m in the same place I don’t got any error in the log but still not working, Any ideas?

I think I got a better question in the method assignDocument2TaxCategory but should do the "taxonomy" parameter in the line "docClassMap.put(taxonomy, taxList);", because no matter what I put there, it doesn’t give an error.

Regards,

Orlando Covault

P.D. I suppose that the taxRID parameter of the method is the RID for de folder under the repository “/taxonomies” which have the same name as my index... or should it be the folder indicated inside sys admin->sys config->km->Index admin->Index name->taxonomies. I don’t know if this is explicative enough

Message was edited by:

Orlando Covault

Answers (2)

Answers (2)

Former Member
0 Kudos

The problem was that my Index has a datasource pointing to a different repository that the one that I run my service.

ankur_garg5
Active Contributor
0 Kudos

Hi Orlando,

See the following links:

<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/bf/a17a05d15211d6b2c700508b6b8a93/frameset.htm">Classification (Classifying Documents)</a>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/be/72e26ef0ff794d96e0474da8e2bade/frameset.htm">Classification Inbox</a>

Bye

Ankur

Reward points if it helps!!