Return to Snippet

Revision: 22544
at January 14, 2010 22:47 by wearetherock


Initial Code
package sample;

import java.rmi.RemoteException;

import org.alfresco.webservice.dictionary.DictionaryFault;
import org.alfresco.webservice.dictionary.DictionaryServiceSoapBindingStub;
import org.alfresco.webservice.types.ClassDefinition;
import org.alfresco.webservice.types.PropertyDefinition;
import org.alfresco.webservice.util.AuthenticationUtils;
import org.alfresco.webservice.util.WebServiceFactory;


public class TestGetAspect {
	public static void main(String args[]) throws DictionaryFault, RemoteException{
		AuthenticationUtils.startSession("admin", "admin1234");
		DictionaryServiceSoapBindingStub dic = WebServiceFactory.getDictionaryService();
	
		// get all class definition
		ClassDefinition[] classDefs =  dic.getClasses(null, null);
		for (ClassDefinition d : classDefs){

			// is aspect
			if (d.isIsAspect()){
				System.out.println("Desc: "+ d.getDescription());
				System.out.println("Title: "+d.getTitle());
				System.out.println("Name: "+ d.getName());
				System.out.println("------");
				
				PropertyDefinition[] propDefs = d.getProperties();
				if (propDefs == null)
					continue;
				
				// list all properties
				for(PropertyDefinition p : propDefs){
					System.out.println("\t Type:"+ p.getDataType());
					System.out.println("\t Name:"+ p.getName());
					System.out.println("\t------");
				}
			}
		}
	}
}

Initial URL


Initial Description


Initial Title
Get List of Aspect

Initial Tags


Initial Language
Java