ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Fernandez <Alec.Fernan...@sas.com>
Subject adding filters to a filterset
Date Thu, 10 Apr 2008 03:10:17 GMT
Hello,

I'm hoping someone can tell me if this is possible.  I'm beginning to think that since there
is no set method in Project that this simply is not possible.

I define a filterset in a target and then call a custom task to which I pass the refid of
the filterset.

      <filterset id="configobj.filterset" >
          <filter token="foo.foo" value="bar.bar" />
      </filterset>


      <mytask filteretrefid="configobj.filterset" />
         </then>

In the task I can then see the filters in the filterset

            Reference r = new Reference(getProject(), filtersetrefid);
            f = (FilterSet) r.getReferencedObject();
            String allfilters = f.getFilterHash().toString();
            Logger.log( Project.MSG_VERBOSE, this, "filterhash toString():" + allfilters );

I then use f.addFilter to add filter elements to the filterset and I can print these in the
task.

[GetObjectProperties] filterhash toString():{oma.folder.products.path=/Products, oma.person.demo.login.userid=hpusrv001\sasdemo,
foo.foo=bar.bar}


However, upon returning from the task to the calling target, the filterset seems to only have
the original filter element that was added in the filterset task.

Does anyone know if I can accomplish adding filter elements to a filterset in this manner?
Or can I create a new filterset in my task, give it a refid and then use that refid back in
my target?

Thanks,
Alec



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message