Hi, Christophe Lombart schrieb: > Thanks for the tips. > Maybe, the Sling explorer has to use (display) an indicator to make the > difference between the JCR resource & other kind of resources. By this way, > we can display different kind of info in function of the resource type.
Makes sense to me. Regards Felix > > > > 2009/7/2 Felix Meschberger <[email protected]> > >> Hi, >> >> Juan José Vázquez Delgado schrieb: >>> Hi, >>> >>>> var prop = valueMap.get("theName", Packages.javax.jcr.Property); >>>> if (prop != null) { >>>> .... >>>> } >>> This only applies to JCR based resources, isn´t it?. AFAIK, there is >>> no a standard way to retrieve the type and multivalue feature from >>> non-JCR based resources.. Am I right?. >> Yes, it is ok for this method to return null if a value exists which may >> not be converted to a JCR Property instance. Therefore the null check. >> >> For non-JCR properties, I would say (in Java speak) something like this >> might work: >> >> boolean isMulti = false; >> Class type = null; >> >> Object value = map.get("theName"); >> if (value == null) { >> ... >> } else { >> type = value.getClass(); >> if (type.isArray()) { >> isMulti = true; >> type = type.getComponentType(); >> } >> >> Regards >> Felix >> >> >
