Example: Querying the Content Store in Java

To see the code in context, view the sample in the following location:

installation_location/sdk/java/Security/Logon.java

This Java code sample demonstrates how to query the content store:

 
PropEnum  props[]  = 
	new  PropEnum[]  {PropEnum.searchPath,  PropEnum.defaultName,  PropEnum.policies,   
			PropEnum.userName,  PropEnum.notificationEMail  }; 
Account  myAccount  =  null; 
... 
	BaseClass  bc[]  = 
		connection.getCMService().query( 
				new  SearchPathMultipleObject("~"),  props,  new  Sort[]  {},  new  QueryOptions()); 
 
	if  ((bc  !=  null)  &&  (bc.length  >  0)) 
	{ 
		for  (int  i  =  0;  i  <  bc.length;  i++) 
		{ 
			myAccount  =  (Account)bc[i]; 
		} 
	} 
... 
		output  = 
			output.concat( 
				"Your  alert  email  address  is:  " 
					+  myAccount.getNotificationEMail().getValue());