cancel
Showing results for 
Search instead for 
Did you mean: 

SET CATERGORY FOR A CONTENT VIA WEB SERVICE

robertoroberto
Champ in-the-making
Champ in-the-making
How Can I programmatically set categories for a content via web services?

Sossty for my english.
3 REPLIES 3

srikanth
Champ in-the-making
Champ in-the-making
hello Mr.robertoroberto …did u get the answer for ur question…
i'm also facing same problem.If u resolved it previously plz help me out.
Thanks in advace.
-Srikanth

robertoroberto
Champ in-the-making
Champ in-the-making
this is sample code:

                ClassificationServiceSoapBindingStub classification = WebServiceFactory .getClassificationService(); 
      int contenutoCounter=count-1;
      com.enterprise.resource.Document alfrescoDocument=(com.enterprise.resource.Document) contenuti.get(contenutoCounter);
      log.fine("CONTENUTO:"+alfrescoDocument.getName());
      Reference reference = new Reference(STORE, alfrescoDocument.getId(), null);
      Predicate predicate = new Predicate(new Reference[]{reference}, null, null);

      AppliedCategory appliedCategory = new AppliedCategory();
      Reference[] array=new Reference[idCategories.size()];
      for (int i=0;i<idCategories.size();i++)
      {

         Reference catRef = new Reference(STORE, idCategories.get(i).toString(), null);
         array[i]=catRef;
      
      }
      appliedCategory.setCategories(array);
      appliedCategory.setClassification(Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, "generalclassifiable"));
      AppliedCategory[] appliedCategories = new AppliedCategory[]{appliedCategory};
      log.fine("APPLICAZIONE CATEGORIA AL CONTENUTO");
      ClassificationServiceSoapBindingStub classificationService = WebServiceFactory.getClassificationService();
      if (appliedCategories!=null){
         try {

            CategoriesResult[] result2 = classificationService.setCategories(predicate, appliedCategories);
         } catch (ClassificationFault e) {
            e.printStackTrace();

         } catch (RemoteException e) {
            e.printStackTrace();
         }

srikanth
Champ in-the-making
Champ in-the-making
Thanks Mr.Robertho….