Get List of Aspect


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package sample;
  2.  
  3. import java.rmi.RemoteException;
  4.  
  5. import org.alfresco.webservice.dictionary.DictionaryFault;
  6. import org.alfresco.webservice.dictionary.DictionaryServiceSoapBindingStub;
  7. import org.alfresco.webservice.types.ClassDefinition;
  8. import org.alfresco.webservice.types.PropertyDefinition;
  9. import org.alfresco.webservice.util.AuthenticationUtils;
  10. import org.alfresco.webservice.util.WebServiceFactory;
  11.  
  12.  
  13. public class TestGetAspect {
  14. public static void main(String args[]) throws DictionaryFault, RemoteException{
  15. AuthenticationUtils.startSession("admin", "admin1234");
  16. DictionaryServiceSoapBindingStub dic = WebServiceFactory.getDictionaryService();
  17.  
  18. // get all class definition
  19. ClassDefinition[] classDefs = dic.getClasses(null, null);
  20. for (ClassDefinition d : classDefs){
  21.  
  22. // is aspect
  23. if (d.isIsAspect()){
  24. System.out.println("Desc: "+ d.getDescription());
  25. System.out.println("Title: "+d.getTitle());
  26. System.out.println("Name: "+ d.getName());
  27. System.out.println("------");
  28.  
  29. PropertyDefinition[] propDefs = d.getProperties();
  30. if (propDefs == null)
  31. continue;
  32.  
  33. // list all properties
  34. for(PropertyDefinition p : propDefs){
  35. System.out.println("\t Type:"+ p.getDataType());
  36. System.out.println("\t Name:"+ p.getName());
  37. System.out.println("\t------");
  38. }
  39. }
  40. }
  41. }
  42. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.