Skip to Content
author's profile photo Former Member
Former Member

scheduler task to change properties of document

I create a scheduelr task for change properties of document. I followed the example to prakash.

Run but but not change nothing. the code is:

public class rellena implements ISchedulerTask {

public rellena(){

super();

}

public void run( String id, Properties properties ) {

// implement the tasks to be scheduled

try {

//prueba//

//cojo un documento y le cambio las propiedades

RID rid=RID.getRID("/documents/adios.txt");

IUser user=WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");

ResourceContext ctxt = new ResourceContext(user);

IResource reVersioned =(IResource) ResourceFactory.getInstance().getResource(rid,ctxt);

IContent content=reVersioned.getContent();

IPropertyMap prop=reVersioned.getProperties();

IPropertyIterator iter=prop.iterator();

while(iter.hasNext()){

IProperty property=iter.next();

if(property.getPropertyName().getNamespace().equalsIgnoreCase("Clientes")){

property.getMutable().setStringValue("CambioValorSchedulerTask");

}

}

reVersioned.checkOut();

reVersioned.checkIn(content,prop,true);

}

}catch(Exception e){

e.printStackTrace();

}

}

public static void main (String args[]) {

rellena nu=new rellena();

String id="rellena";

Properties properties=null;

nu.run(id,properties);

}

}

what debbug this code???

why not run??

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Nov 15, 2007 at 01:42 PM

    Hi,

    try this:

    IMutablePropertyMap mutPropMap = resource.getProperties().getMutable();
    IPropertyIterator iter = mutPropMap.iterator();
    while(iter.hasNext()){
    ...

    Best regards,

    Avishai Zamir

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 10:41 AM

    Thanks Zamir.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.