hi all,
I've added, generated and deployed (successfully) an extended property on a project using Object Modeler.
I've registered and applied the property to a project instance called 'Concept' (this may help when reading the code). It really should exist on the project but the search can't find it.
In this example the extended property is a Metadata table.
Interestingly if the type is an 'INT' the NoSuchPropertyException error is not thrown but the property is always NULL even though I know it has a value
I've tried the search in many ways but simplified the code below to just return a specific property value on a project.
This is the exception thrown:
-------
com.imanage.cms.exceptions.library.NoSuchPropertyException: Property 'EXT:

ROJECT_STEP' does not exist on APP:

ROJECT
-------
This is the JSP code that will give the error:
N.B I can tell by the print statements that I have the correct workspace and project. So it really should have the extended property on it.
----------
<%@ page import="com.imanage.workteam.appservices.session.AppSession,
com.imanage.workteam.constants.RequestConstants,
com.imanage.cms.api.workteam.*,
com.imanage.cms.api.workteam.SearchArgument,
com.imanage.workteam.exceptions.FaultManager,
com.imanage.workteam.utilities.*,
java.util.*,
com.imanage.workteam.constants.XmlConstants,
com.imanage.workteam.viewSets.*,
com.imanage.workteam.adapter.*,
com.imanage.workteam.exceptions.WtAppException"%>
<%@ taglib uri="/tlds/c.tld" prefix="c" %>
<%@ taglib uri="/tlds/wsmp.tld" prefix="w" %>
<%
String conceptTitleValue = "unspecified";
AppSession appSession = (AppSession)JspUtil.getRequestAttribute(request, "appSession", null);
if(appSession != null)
{
out.println("app session is valid - starting search
");
String objectId = request.getParameter(RequestConstants.OBJECT_ID);
if(WorkletUtil.looksLikeObjectId(objectId))
{
try
{
Object obj = appSession.getObjectById(objectId);
if(obj instanceof Item)
{
out.println("found workspace object in app session
");
Workspace workspace = ((Item)obj).getWorkspace();
out.println("The workspace Name is: "
+ workspace.getName());
// workspace is a reference to a WorkSpace
// Create search argument
WorkspaceSearchArgument searchArgument =
new WorkspaceSearchArgument();
// Note that a default profile condition is necessary
searchArgument.
setProfileCondition("APP::NAME like \"%Concept\"");
// Create array of returned item types
SearchArgument.SearchReturnedItem[] searchReturnedItems =
new SearchArgument.SearchReturnedItem[1];
// Set the SearchReturnedItem[] element to return folders
// The second argument is null since
// no extended properties are returned
searchReturnedItems [0] =new
SearchArgument.SearchReturnedItem (Project.class, null);
// Set the SearchArgument SearchReturnedItem elements
searchArgument.setReturnedItems(searchReturnedItems);
// Execute the search
SearchResultList results =
workspace.search(searchArgument);
// Iterate through the result set, displaying the properties
Iterator iter = results.iterator();
out.println ("
Found " + results.size() + " items");
while(iter.hasNext())
{
SearchResult result = (SearchResult) iter.next();
// Retrieve item
Project item = (Project) result.getItem();
// Retrieve item properties and print them
out.println("The Name is: " + item.getName());
out.println("The Description is: "
+ item.getDescription());
out.println("The Created Date is: "
+ item.getCreatedDate());
out.println("The status is: "+ item.getPropertyValueString("EXT:

ROJECT_STEP") );
/* display all properties actually exist on object */
Collection propDescs = item.getAllPropertyDescriptions();
Iterator itsProps = propDescs.iterator();
while (itsProps.hasNext()) {
PropertyDescription desc = (PropertyDescription)itsProps.next();
out.println("
The Project has a property = " + desc.getName() );
}
}
}
}
catch(Exception e)
{
out.println("caught an exception: "+e);
FaultManager.register(e);
}
}
}
%>
---------------
This is a simple example. I've tried several different WOM search code alternatives but all fail to find an extended Project property.
I can search and find the metadata table and query its values. But i need the value associated with the project instance.
In the database I can see the project does link to the extended property.
I'm using WorkSite MP 4.1 HotFix 7 running on Windows 2003 Server with MS SQL Server 8.0
Thanks
Tom