You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Laurent Michenaud <lm...@adeuza.fr> on 2005/04/25 17:45:32 UTC
Bug/Patch: subscriber persistence
Subscribers are not persistent.
I have looked at the slide code and I have corrected it :
In the file NotificationTrigger.java, I have added : writer.close();
private void saveSubscribers() {
if ( filename != null ) {
synchronized ( subscribers ) {
try {
FileOutputStream
outputStream = new FileOutputStream(filename);
XMLOutputStreamWriter
writer = new XMLOutputStreamWriter(outputStream);
writer.writeXMLDeclaration();
writer.writeStartTag(XMLWriter.createStartTag(E_SUBSCRIPTIONS));
for ( Iterator i =
subscribers.iterator(); i.hasNext(); ) {
Subscriber
subscriber = (Subscriber)i.next();
System.out.println("OK"+ subscriber.getUri());
writer.writeStartTag(XMLWriter.createStartTag(E_SUBSCRIPTION, new
String[][] {
{ A_ID, String.valueOf(subscriber.getId()) } }));
writer.writeElementWithPCData(XMLWriter.createStartTag(E_URI),
XMLEncode.xmlEncodeText(subscriber.getUri()),
XMLWriter.createEndTag(E_URI));
writer.writeElementWithPCData(XMLWriter.createStartTag(E_DEPTH),
String.valueOf(subscriber.getDepth()), XMLWriter.createEndTag(E_DEPTH));
writer.writeElementWithPCData(XMLWriter.createStartTag(E_CALLBACK),
XMLEncode.xmlEncodeText(subscriber.getCallback()),
XMLWriter.createEndTag(E_CALLBACK));
writer.writeElementWithPCData(XMLWriter.createStartTag(E_NOTIFICATION_TY
PE), XMLEncode.xmlEncodeText(subscriber.getNotificationType()),
XMLWriter.createEndTag(E_NOTIFICATION_TYPE));
writer.writeElementWithPCData(XMLWriter.createStartTag(E_NOTIFICATION_DE
LAY), String.valueOf(subscriber.getNotificationDelay()),
XMLWriter.createEndTag(E_NOTIFICATION_DELAY));
writer.writeElementWithPCData(XMLWriter.createStartTag(E_SUBSCRIPTION_EN
D), String.valueOf(subscriber.getSubscriptionEnd()),
XMLWriter.createEndTag(E_SUBSCRIPTION_END));
writer.writeEndTag(XMLWriter.createEndTag(E_SUBSCRIPTION));
}
writer.writeEndTag(XMLWriter.createEndTag(E_SUBSCRIPTIONS));
writer.close();
outputStream.close();
} catch ( Exception e) {
Domain.log(e);
}
}
}
}
But I don't understand how it is able to load my subscriber at next
launch.
Example of subscribers.xml :
<?xml version="1.0" encoding="UTF-8"?>
<subscriptions>
<subscription id="1">
<uri>/files</uri>
<depth>2147483647</depth>
<callback>httpu://localhost:4444</callback>
<notification-type>UPDATE</notification-type>
<notification-delay>0</notification-delay>
<subscription-end>1114446870897</subscription-end>
</subscription>
</subscriptions>
I think it uses the callback to get my subscriber but I don't understand
how to do that.
Authentication with Slide 2.1 and JBoss 4.0.1
Posted by Jérémy Soula <js...@ebusinessinformation.fr>.
Hi all,
I am using slide 2.1 with jboss 4.0.1. It works fine but i have one
problem: authentication.
I add a new Realm in the login-config.xml:
<application-policy name = "slide">
<authentication>
<login-module code = "org.apache.slide.jaas.spi.SlideLoginModule"
flag = "required">
</login-module>
</authentication>
</application-policy>
i add a jboss-web.xml in the slide.war:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd">
<jboss-web>
<security-domain>java:/jaas/slide</security-domain>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>org.apache.slide:loader=slide.war</loader-repository>
</class-loading>
</jboss-web>
and i obviously enable the security authentication in web.xml et
slide.properties.
But when i connect with DAVExplorer with 'root','root', i have a 403
Access to the requested ressource is denied.
Someone can help me?
Regards,
Jérémy
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org