@Override public void toResource(Resource resource, ResourceFilter filter) throws RepositoryException { super.toResource(resource, filter); ResourceFilter.FilterSet filterSet = (ResourceFilter.FilterSet) filter; ResourceHandle handle = ResourceHandle.use(resource); ResourceFilter.FilterSet.Rule rule = filterSet.getRule(); handle.setProperty(PROPERTY_RULE, rule.name()); List<ResourceFilter> set = filterSet.getSet(); ResourceHandle entry; for (int i = 0; i < set.size(); i++) { entry = ResourceHandle.use( ResourceUtil.getOrCreateChild( resource, NODE_NAME_ENTRY + "-" + i, ResourceUtil.TYPE_UNSTRUCTURED)); ResourceFilterMapping.toResource(entry, set.get(i)); } }
@Override public void toResource(Resource resource, ResourceFilter filter) throws RepositoryException { ResourceHandle handle = ResourceHandle.use(resource); handle.setProperty(ResourceUtil.PROP_RESOURCE_TYPE, RESOURCE_FILTER_TYPE); handle.setProperty(PROPERTY_TYPE, getTypeName(filter)); }