01-13-2010 02:24 AM
Predicate predicate = new Predicate();
predicate.Items = new Object[] { reference };
Node[] nodes = WebServiceFactory.getRepositoryService().get(predicate);
foreach (NamedValue nv in nodes[0].properties)
{
string propValue = nv.value;
PropertyDefinition [] propDefinitions = WebServiceFactory.getDictionaryService().getProperties(new string[] { nv.name} );
string propTitle = propDefinitions[0].title;
string propDataType = propdefinitions[0].dataType;
}
But I get exception at this line:PropertyDefinition [] propDefinitions = WebServiceFactory.getDictionaryService().getProperties(new string[] { nv.name} );
in System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
in System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
in Alfresco.DictionaryService.getProperties(String[] propertyNames) in ….
01-13-2010 02:46 PM
01-29-2010 09:40 PM
public static void getPropertiesDefinition(String nodeName) {
DictionaryServiceSoapBindingStub dictionaryService = WebServiceFactory
.getDictionaryService();
try {
ClassDefinition[] definitions = dictionaryService.getClasses(null,
null);
PropertyDefinition[] properties = null;
for (ClassDefinition classDefinition : definitions) {
if (classDefinition.getName().equals(nodeName)) {
properties = classDefinition.getProperties();
break;
}
}
for (PropertyDefinition propertyDefinition : properties) {
System.out.println(propertyDefinition.getName());
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
try {
final String repositoryPath = "http://10.7.16.199:8080/alfresco/api";
final String userName = "admin";
final String passwd = "admin";
WebServiceFactory.setEndpointAddress(repositoryPath);
AuthenticationUtils.startSession(userName, passwd);
getPropertiesDefinition(Constants.TYPE_CONTENT);
} catch (AuthenticationFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
AuthenticationUtils.endSession();
}
}
05-24-2010 08:58 AM
06-09-2010 05:14 PM
System.out.println(qname.getNamespaceURI() + ":" + qname.getLocalName());
08-11-2010 09:17 AM
11-17-2010 12:27 AM
07-03-2013 09:34 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.