[opencms-dev] Re: resource type contsants

M Butcher mbutcher at grcomputing.net
Thu Jul 10 22:16:01 CEST 2003


I think I solved my own problem... since ResourceTypes are extensible,
then I guess there is no reason to maintain a partial list of constants
for ResourceTypes that were included, so I settled for using the name of
the ResourceType instead, which I could get using
I_ResourceType.getResourceTypeName();

So, my previous example now looks something like this:

public boolean isJsp(CmsFile f, CmsObject cmso) throws CmsException {

  int type = f.getType();
  String typeName = cmso.getResourceType(type).getResourceTypeName();

  if("jsp".equals(typeName))
    return true;

  return false;
}


On Thu, 2003-07-10 at 10:58, M Butcher wrote:
> Where are the constants that Resource.getType() refers to? They don't
> seem to be in I_CmsConstants. I want to be able to figure out what type
> of resource any given resource is.
> 
> Example:
> --------
> 
> public boolean isJsp(CmsFile f) throws CmsException {
>   if(f.getType() == ????) {
>     return true;
>   }
>   return false;
> }
-- 
M Butcher <mbutcher at grcomputing.net>



More information about the opencms-dev mailing list