HughP / simal

Automatically exported from code.google.com/p/simal
0 stars 0 forks source link

Set PTSW polling in the properties file #382

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Out of the box, Simal seems to repeatedly poll or otherwise interact with PTSW. 
But since I'm not registered or something, I get these exceptions at regular 
intervals:

---
Exception in thread "Timer-1" java.lang.NullPointerException
    at uk.ac.osswatch.simal.model.jena.simal.JenaSimalRepository.getAllProjects(JenaSimalRepository.java:279)
    at uk.ac.osswatch.simal.importData.PTSWImport.importLatestDOAP(PTSWImport.java:187)
    at uk.ac.osswatch.simal.schedule.ImportPTSWTask.run(ImportPTSWTask.java:40)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)

---

Short of becoming a good semantic web citizen...perhaps the PTSW thing could be 
disabled by default?

Original issue reported on code.google.com by Stevage on 7 Feb 2011 at 7:55

GoogleCodeExporter commented 9 years ago
PTSW imports can be enabled/disabled from the Tools page, but currently is not 
configurable from the properties.

The scheduler is created in the constructor of UserApplication:

    public UserApplication() {
        setScheduledPtswStatus(true);
    }

I agree that this really should default to false, so I've made that change. but 
I'm not closing the issue - just changing the summary of it.

We need to add a property which is read here. As you can see the method will 
already handle a false setting.

Since we can turn PTSW on/off from the UI we should also save the property 
here. The relevant code is the setScheduledPtswStatus(...)

Whilst making this change we should also add the ability to configure the 
interval between refreshes (used in the same method)

Original comment by ross.gardler on 9 Feb 2011 at 9:44