Re: Mailing software

2011-02-15 Thread Amedeo Mantica
Hi Anjo,

I don't understand very well what are u looking for, but may be a thing like 
this ?

http://downloads.insigno.net/Amedeo/MailingList.pdf

Regards
Amedeo

On 11/feb/2011, at 13.51, Anjo Krank wrote:

 Hi,
 
 has anyone built direct marketing/personalized email software with WO (or 
 used any reasonable package) that he'd like to share experiences with?
 
 I find my stuff is getting rejected probably due to the speed at which I sent 
 mails out, but before I go around stumbling in the dark, it'd be great to 
 hear people who have already been there...
 
 Cheers, Anjo ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/amedeomailing%40insigno.it
 
 This email sent to amedeomail...@insigno.it
 

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Employing mod_deflate Apache module

2011-02-15 Thread Patrick Middleton


On 14 Feb 2011, at 18:27, Gennady Kushnir wrote:


It is not Wonder app.
Why make such tricks whereas Apache should do that already?


Because you might be using WebObjects without Apache.

Is this a module load order problem?  Which version of Apache have  
you got?  Is mod_deflate.so loaded before mod_WebObjects.so, or after?




2011/2/14 Timo Hoepfner th-...@onlinehome.de:

If it's a Wonder app, add this to you Properties and you're done:

er.extensions.ERXApplication.responseCompressionEnabled=true

Timo

Am 14.02.2011 um 09:59 schrieb Gennady Kushnir:


Hello list!
I've just tried to compress traffic produced by my WOApp but I only
succeeded in compressing static resources (css and js).
Here is my configuration fragment.

IfModule mod_deflate.c
  AddOutputFilterByType DEFLATE text/html application/xhtml+xml
text/plain text/xml \
  text/css text/javascript application/x-javascript
application/javascript
/IfModule

Does anybody know what should be written to Apache mod_deflate
configuration so that it also compress WO-generated pages?

Regards,
Gennady




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Employing mod_deflate Apache module

2011-02-15 Thread Andrew Lindesay

Hi Gennady;


Why make such tricks whereas Apache should do that already?

Because you might be using WebObjects without Apache.


Another reason (depending on your deployment) is that you may have a 
number of application servers with ample CPU resource, but one 
web-server/load-balancer with limited CPU resource.  By compressing in 
the application-server, you could utilise more of the application-server 
resource compressing pages rather than the load-balancer.


cheers.

--
Andrew Lindesay
www.silvereye.co.nz
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Employing mod_deflate Apache module

2011-02-15 Thread Patrick Middleton


On 15 Feb 2011, at 09:54, Patrick Middleton wrote:



On 14 Feb 2011, at 18:27, Gennady Kushnir wrote:


...


Is this a module load order problem?  Which version of Apache have  
you got?  Is mod_deflate.so loaded before mod_WebObjects.so, or after?


Further research reveals that while module load order was very  
significant for Apache 1.3 (mod_rewrite et al), it's not significant  
for Apache 2.2, where modules can specify their own hook ordering  
preferences.  The easiest way of seeing what's going on is to enable  
mod_info.  After doing that, I saw that many modules in their  
configuration stanzas had this:

SetOutputFilter DEFLATE
while mod_WebObjects (for me, configured via /Library/WebObjects/ 
Adaptors/Apache2.2/apache.conf) did not.  After adding it, deflate  
now works for me with WO-generated content.






2011/2/14 Timo Hoepfner th-...@onlinehome.de:

If it's a Wonder app, add this to you Properties and you're done:

er.extensions.ERXApplication.responseCompressionEnabled=true

Timo

Am 14.02.2011 um 09:59 schrieb Gennady Kushnir:


Hello list!
I've just tried to compress traffic produced by my WOApp but I only
succeeded in compressing static resources (css and js).
Here is my configuration fragment.

IfModule mod_deflate.c
  AddOutputFilterByType DEFLATE text/html application/xhtml+xml
text/plain text/xml \
  text/css text/javascript application/x-javascript
application/javascript
/IfModule

Does anybody know what should be written to Apache mod_deflate
configuration so that it also compress WO-generated pages?

Regards,
Gennady




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[MEETING] REMINDER (2) WO-NoVA is TONIGHT 2/15/2011 at 6:30 PM

2011-02-15 Thread Andrew Kinnie
Greetings all, 

I evidently neglected to state the time for the WO-NoVA meeting in my reminder 
from yesterday.

The meetings are 6:30 PM at K12's offices:

K12, Inc.
2300 Corporate Park Drive
Herndon, VA 20171

http://maps.google.com/maps?f=qsource=s_qhl=engeocode=q=2300+Corporate+Park+Dr,+Herndon,+VA+20171sll=37.0625,-95.677068sspn=55.016555,76.992187ie=UTF8hq=hnear=2300+Corporate+Park+Dr,+Herndon,+Fairfax,+Virginia+20171z=17


See you there!

Andrew
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

WO server to connect to Apple's Push Notification Service for iOS

2011-02-15 Thread Andrew Kinnie
Greetings all,

As I am now an iOS developer (as well as a part time WO developer), and my new 
employer has decided to build a server to handle the iOS push notifications, I 
thought perhaps building such a thing based on WebObjects might be worth 
considering.

Has anyone used WebObjects to create a server to handle the APNs calls?  (i.e. 
- I think - communications from the device with the token to the server, then 
handle the pushes to the Apple server with the data and relevant devices)  It 
seems comparatively simple, but I thought I'd ask.  There was a short thread (4 
messages) a little over a year ago about this, referencing 
http://code.google.com/p/javapns/ and suggesting a component using it be 
included in Wonder, but I have not seen anything else.

Any thought?  Suggestions?  etc?

Thanks in advance

Andrew 

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: WO server to connect to Apple's Push Notification Service for iOS

2011-02-15 Thread David LeBer
http://lists.apple.com/archives/webobjects-dev/2010/Jan/msg00530.html

On 2011-02-15, at 2:43 PM, Andrew Kinnie wrote:

 Greetings all,
 
 As I am now an iOS developer (as well as a part time WO developer), and my 
 new employer has decided to build a server to handle the iOS push 
 notifications, I thought perhaps building such a thing based on WebObjects 
 might be worth considering.
 
 Has anyone used WebObjects to create a server to handle the APNs calls?  
 (i.e. - I think - communications from the device with the token to the 
 server, then handle the pushes to the Apple server with the data and relevant 
 devices)  It seems comparatively simple, but I thought I'd ask.  There was a 
 short thread (4 messages) a little over a year ago about this, referencing 
 http://code.google.com/p/javapns/ and suggesting a component using it be 
 included in Wonder, but I have not seen anything else.
 
 Any thought?  Suggestions?  etc?
 
 Thanks in advance
 
 Andrew 
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com
 
 This email sent to dleber_wo...@codeferous.com

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: WO server to connect to Apple's Push Notification Service for iOS

2011-02-15 Thread Andrew Kinnie
that was the thread I was talking about...

On Feb 15, 2011, at 2:48 PM, David LeBer wrote:

 http://lists.apple.com/archives/webobjects-dev/2010/Jan/msg00530.html
 
 On 2011-02-15, at 2:43 PM, Andrew Kinnie wrote:
 
 Greetings all,
 
 As I am now an iOS developer (as well as a part time WO developer), and my 
 new employer has decided to build a server to handle the iOS push 
 notifications, I thought perhaps building such a thing based on WebObjects 
 might be worth considering.
 
 Has anyone used WebObjects to create a server to handle the APNs calls?  
 (i.e. - I think - communications from the device with the token to the 
 server, then handle the pushes to the Apple server with the data and 
 relevant devices)  It seems comparatively simple, but I thought I'd ask.  
 There was a short thread (4 messages) a little over a year ago about this, 
 referencing http://code.google.com/p/javapns/ and suggesting a component 
 using it be included in Wonder, but I have not seen anything else.
 
 Any thought?  Suggestions?  etc?
 
 Thanks in advance
 
 Andrew 
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com
 
 This email sent to dleber_wo...@codeferous.com
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site: http://codeferous.com
 blog: http://davidleber.net
 profile:  http://www.linkedin.com/in/davidleber
 twitter:  http://twitter.com/rebeld
 --
 Toronto Area Cocoa / WebObjects developers group:
 http://tacow.org
 
 
 
 

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: WO server to connect to Apple's Push Notification Service for iOS

2011-02-15 Thread David LeBer
On 2011-02-15, at 2:52 PM, Andrew Kinnie wrote:

 that was the thread I was talking about...

Erm, yeah, of course, I knew that. :P

Actually, I'm not sure how much WOification is necessary for working with 
javapns.

The push notification payload is pretty basic. However, what you'd put in your 
messages and (more importantly) when and how you chose send the notifications 
is not likely to be generic.

 
 On Feb 15, 2011, at 2:48 PM, David LeBer wrote:
 
 http://lists.apple.com/archives/webobjects-dev/2010/Jan/msg00530.html
 
 On 2011-02-15, at 2:43 PM, Andrew Kinnie wrote:
 
 Greetings all,
 
 As I am now an iOS developer (as well as a part time WO developer), and my 
 new employer has decided to build a server to handle the iOS push 
 notifications, I thought perhaps building such a thing based on WebObjects 
 might be worth considering.
 
 Has anyone used WebObjects to create a server to handle the APNs calls?  
 (i.e. - I think - communications from the device with the token to the 
 server, then handle the pushes to the Apple server with the data and 
 relevant devices)  It seems comparatively simple, but I thought I'd ask.  
 There was a short thread (4 messages) a little over a year ago about this, 
 referencing http://code.google.com/p/javapns/ and suggesting a component 
 using it be included in Wonder, but I have not seen anything else.
 
 Any thought?  Suggestions?  etc?
 
 Thanks in advance
 
 Andrew 
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com
 
 This email sent to dleber_wo...@codeferous.com
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site:http://codeferous.com
 blog:http://davidleber.net
 profile: http://www.linkedin.com/in/davidleber
 twitter: http://twitter.com/rebeld
 --
 Toronto Area Cocoa / WebObjects developers group:
 http://tacow.org
 
 
 
 
 
 

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: WO server to connect to Apple's Push Notification Service for iOS

2011-02-15 Thread Andrew Kinnie
Yeah, it seems pretty straight forward, after having read some of the basic 
docs of the javapns and APNs itself.  I guess I was just wondering if anyone 
had used this with WO or if they've just gone with a a straight java 
implementation.  I have next to no experience with anything other than WO and 
Cocoa, so I pretty much default to using it within a WO app.  Maybe I should 
not bother with that.  

However, we presumably would need a database to store the information on our 
side to know which devices to push the payloads too, and WO seems like an 
easy(ish) way to accomplish that.  Thus far, I haven't the foggiest idea what 
circumstances will result in us pushing out data, or how the app will be 
notified of this (I expect to know more an hour from now), but sending the push 
to apple can use javapns it seems.  

Thanks (though any other thoughts are obviously welcome as well)

Andrew

On Feb 15, 2011, at 3:42 PM, David LeBer wrote:

 On 2011-02-15, at 2:52 PM, Andrew Kinnie wrote:
 
 that was the thread I was talking about...
 
 Erm, yeah, of course, I knew that. :P
 
 Actually, I'm not sure how much WOification is necessary for working with 
 javapns.
 
 The push notification payload is pretty basic. However, what you'd put in 
 your messages and (more importantly) when and how you chose send the 
 notifications is not likely to be generic.

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: WO server to connect to Apple's Push Notification Service for iOS

2011-02-15 Thread Mertz Stéphan
Hi,

Here is the code I used some time ago:

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.UnknownHostException;
import java.security.KeyStore;
import java.util.Enumeration;

import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

import com.webobjects.foundation.NSData;
import com.webobjects.foundation.NSDictionary;

public class IPhonePushNotification {
private static String staticHost = /* Apple gateway push server name */;
private static int staticPort = /* Apple gateway push server port */;
private static String passPhrase = * your passPhrase */;
private static String certificateAndKey = /Certificats/iPhoneAPS.p12;
private static SSLSocketFactory factory = null;
private static IPhonePushNotification iPhonePushNotification;

public IPhonePushNotification () {
try {
if (new File(certificateAndKey).exists()  staticHost != null  
staticPort != 0  passPhrase != null) {
try {
SSLContext ctx;
KeyManagerFactory kmf;
KeyStore ks;

ctx = SSLContext.getInstance(TLS);
kmf = KeyManagerFactory.getInstance(SunX509);
ks = KeyStore.getInstance(PKCS12);

ks.load(new FileInputStream(certificateAndKey), 
passPhrase.toCharArray());

kmf.init(ks, passPhrase.toCharArray());
ctx.init(kmf.getKeyManagers(), null, null);

factory = ctx.getSocketFactory();
} catch (Exception e) {
e.printStackTrace();
throw new IOException(e.getMessage());
}
}
} catch (Exception e) {
 e.printStackTrace();
}
}

public static IPhonePushNotification iPhonePushNotification() {
if (iPhonePushNotification == null) {
iPhonePushNotification = new IPhonePushNotification();
}

return iPhonePushNotification;
}

private static String getJSONMessage(String msg, NSDictionary infos) {
StringBuffer jsonMessage = new StringBuffer({\aps\:{\alert\:\ + 
msg + \,\badge\:0,\sound\:\default\});

if (infos != null  infos.count() != 0) {
Enumeration l_enum = infos.keyEnumerator();
while (l_enum.hasMoreElements()) {
String l_key = (String) l_enum.nextElement();
String l_value = (String) infos.objectForKey(l_key);

jsonMessage.append(,\ + l_key + \:\ + l_value + \);
}
}

jsonMessage.append(});

return jsonMessage.toString();
}

public synchronized void sendMessage(String msg, NSDictionary infos, NSData 
deviceToken) {
if (factory != null) {
SSLSocket socket;

try {
socket = (SSLSocket) factory.createSocket(staticHost, 
staticPort);
socket.startHandshake();
sendMessage(socket, getJSONMessage(msg, infos), deviceToken);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}

private synchronized static void sendMessage(SSLSocket sock, String msg, 
NSData deviceToken) throws Exception{
 OutputStream sos = sock.getOutputStream();
 ByteArrayOutputStream bos = new ByteArrayOutputStream();
 DataOutputStream dos = new DataOutputStream(bos);
 dos.writeByte(0); // 1 byte command

 byte[] binaryDeviceID = deviceToken.bytes();

 byte [] token = binaryDeviceID;
 dos.writeShort(token.length); // 2 byte token length
 dos.write(token); // token
 byte [] payload = msg.getBytes(UTF-8);
 dos.writeShort(payload.length); // 2 byte msg length
 dos.write(payload); // payload

 byte [] output = bos.toByteArray();

 sos.write(output);
 sock.close();
}
}


Example of use with WO:
while (l_usersEnum.hasMoreElements()) {
 EOUser l_user = (EOUser) l_usersEnum.nextElement();

 if (l_user.parameterValueForKey(deviceToken) != null) {
 if (l_passageCreation  
Utils.booleanValueOf(l_user.parameterValueForKey(pushPassageCreation))) {
 final NSDictionary infos = new NSDictionary(
 new Object[] { l_pssg.valueForKey(pssgID), 
l_user.parameterValueForKey(pushServer) },
 new Object[] { pssgID, server_name });
 final String msg = 

Re: WO server to connect to Apple's Push Notification Service for iOS

2011-02-15 Thread Andrew Kinnie
Thanks.  This should help, once we start actually developing it (i.e. have more 
complete requirements).  Evidently, we need to also support Android, so we need 
to research that as well.

Andrew

On Feb 15, 2011, at 4:24 PM, Mertz Stéphan wrote:

 Hi,
 
 Here is the code I used some time ago:
 
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.UnknownHostException;
 import java.security.KeyStore;
 import java.util.Enumeration;
 
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
 
 import com.webobjects.foundation.NSData;
 import com.webobjects.foundation.NSDictionary;
 
 public class IPhonePushNotification {
private static String staticHost = /* Apple gateway push server name */;
private static int staticPort = /* Apple gateway push server port */;
private static String passPhrase = * your passPhrase */;
private static String certificateAndKey = /Certificats/iPhoneAPS.p12;
private static SSLSocketFactory factory = null;
private static IPhonePushNotification iPhonePushNotification;
 
public IPhonePushNotification () {
try {
if (new File(certificateAndKey).exists()  staticHost != null  
 staticPort != 0  passPhrase != null) {
try {
SSLContext ctx;
KeyManagerFactory kmf;
KeyStore ks;
 
ctx = SSLContext.getInstance(TLS);
kmf = KeyManagerFactory.getInstance(SunX509);
ks = KeyStore.getInstance(PKCS12);
 
ks.load(new FileInputStream(certificateAndKey), 
 passPhrase.toCharArray());
 
kmf.init(ks, passPhrase.toCharArray());
ctx.init(kmf.getKeyManagers(), null, null);
 
factory = ctx.getSocketFactory();
} catch (Exception e) {
e.printStackTrace();
throw new IOException(e.getMessage());
}
}
} catch (Exception e) {
 e.printStackTrace();
}
}
 
public static IPhonePushNotification iPhonePushNotification() {
if (iPhonePushNotification == null) {
iPhonePushNotification = new IPhonePushNotification();
}
 
return iPhonePushNotification;
}
 
private static String getJSONMessage(String msg, NSDictionary infos) {
StringBuffer jsonMessage = new StringBuffer({\aps\:{\alert\:\ + 
 msg + \,\badge\:0,\sound\:\default\});
 
if (infos != null  infos.count() != 0) {
Enumeration l_enum = infos.keyEnumerator();
while (l_enum.hasMoreElements()) {
String l_key = (String) l_enum.nextElement();
String l_value = (String) infos.objectForKey(l_key);
 
jsonMessage.append(,\ + l_key + \:\ + l_value + \);
}
}
 
jsonMessage.append(});
 
return jsonMessage.toString();
}
 
public synchronized void sendMessage(String msg, NSDictionary infos, 
 NSData deviceToken) {
if (factory != null) {
SSLSocket socket;
 
try {
socket = (SSLSocket) factory.createSocket(staticHost, 
 staticPort);
socket.startHandshake();
sendMessage(socket, getJSONMessage(msg, infos), deviceToken);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}
 
private synchronized static void sendMessage(SSLSocket sock, String msg, 
 NSData deviceToken) throws Exception{
 OutputStream sos = sock.getOutputStream();
 ByteArrayOutputStream bos = new ByteArrayOutputStream();
 DataOutputStream dos = new DataOutputStream(bos);
 dos.writeByte(0); // 1 byte command
 
 byte[] binaryDeviceID = deviceToken.bytes();
 
 byte [] token = binaryDeviceID;
 dos.writeShort(token.length); // 2 byte token length
 dos.write(token); // token
 byte [] payload = msg.getBytes(UTF-8);
 dos.writeShort(payload.length); // 2 byte msg length
 dos.write(payload); // payload
 
 byte [] output = bos.toByteArray();
 
 sos.write(output);
 sock.close();
}
 }
 
 
 Example of use with WO:
while (l_usersEnum.hasMoreElements()) {
 EOUser l_user = (EOUser) l_usersEnum.nextElement();
 
 if (l_user.parameterValueForKey(deviceToken) != null) {
 if (l_passageCreation  
 Utils.booleanValueOf(l_user.parameterValueForKey(pushPassageCreation))) {
 final 

D2W and non-relational insertion lists.

2011-02-15 Thread Joe Little
I want the certain fields (String) to take the values from a pull down
from another Entity, inserting Entity.name or Entity.type for the
string on selection. I don't want a relation since the choices are to
be archival and not reflect what Entity.type is presently, but what it
was at time of creation/edit. I was wondering how this is normally
done with D2W rules. Also, I was hoping to do this on initial setting
of the property only, but allow free-form editing when not null. I'm
presuming pull downs like this are par for the coarse, but haven't
found ready examples to point me to the right d2w keys.
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: D2W and non-relational insertion lists.

2011-02-15 Thread Joe Little
Ok, I'll try to give a more specific example.

I have a Membership entity with such properties as beginDate, endDate,
company (relationship) and primaryContactName and primaryContactEmail.
The end users want to select these last two values from a pull down
list of known company.Affiliates, where Affiliates are people with
name, email, etc.

However, affliates move around so they want to store those values
relative to one this membership whenever its created, so five years
from now, those values stick. A slightly better example is Projects
who have among other thing a String property of VisitingScholar or
Fellow, which is just the name of an Affiliate again. In the same way,
they want this name to stick with project even if that Affiliate
changes companies or disappears altogether. I've done this before, but
have no clue of how to do this with D2W. I want one to be able to set
the value when say primaryContactName == null via a pull down of
current company.Affiliates if company itself is != null, and then
later, allow for just standard text field manipulation.


On Tue, Feb 15, 2011 at 9:17 PM, David Holt programming...@me.com wrote:
 I'd love to help but this makes no sense to me at all.

 Can you be more specific? What are your entities?


 On 2011-02-15, at 8:49 PM, Joe Little jmlit...@gmail.com wrote:

 I want the certain fields (String) to take the values from a pull down
 from another Entity, inserting Entity.name or Entity.type for the
 string on selection. I don't want a relation since the choices are to
 be archival and not reflect what Entity.type is presently, but what it
 was at time of creation/edit. I was wondering how this is normally
 done with D2W rules. Also, I was hoping to do this on initial setting
 of the property only, but allow free-form editing when not null. I'm
 presuming pull downs like this are par for the coarse, but haven't
 found ready examples to point me to the right d2w keys.
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com

 This email sent to programming...@mac.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: D2W and non-relational insertion lists.

2011-02-15 Thread Mark Wardle
Hi Joe.

I may have interpreted this incorrectly but I'll try some suggestions.

I don't think your issue is a D2W problem per se.

I would consider this a modelling one - if a membership is linked to a
user but you want some details copied in to the membership on
creation, then can't you do that as part of the setUser() setter in
your membership with a check not to overwrite if there's already  a
value for that (those) properties.

Mark

-- 
Dr. Mark Wardle
Specialist registrar, Neurology
(Sent from my mobile)


On 16 Feb 2011, at 05:49, Joe Little jmlit...@gmail.com wrote:

 Ok, I'll try to give a more specific example.

 I have a Membership entity with such properties as beginDate, endDate,
 company (relationship) and primaryContactName and primaryContactEmail.
 The end users want to select these last two values from a pull down
 list of known company.Affiliates, where Affiliates are people with
 name, email, etc.

 However, affliates move around so they want to store those values
 relative to one this membership whenever its created, so five years
 from now, those values stick. A slightly better example is Projects
 who have among other thing a String property of VisitingScholar or
 Fellow, which is just the name of an Affiliate again. In the same way,
 they want this name to stick with project even if that Affiliate
 changes companies or disappears altogether. I've done this before, but
 have no clue of how to do this with D2W. I want one to be able to set
 the value when say primaryContactName == null via a pull down of
 current company.Affiliates if company itself is != null, and then
 later, allow for just standard text field manipulation.


 On Tue, Feb 15, 2011 at 9:17 PM, David Holt programming...@me.com wrote:
 I'd love to help but this makes no sense to me at all.

 Can you be more specific? What are your entities?


 On 2011-02-15, at 8:49 PM, Joe Little jmlit...@gmail.com wrote:

 I want the certain fields (String) to take the values from a pull down
 from another Entity, inserting Entity.name or Entity.type for the
 string on selection. I don't want a relation since the choices are to
 be archival and not reflect what Entity.type is presently, but what it
 was at time of creation/edit. I was wondering how this is normally
 done with D2W rules. Also, I was hoping to do this on initial setting
 of the property only, but allow free-form editing when not null. I'm
 presuming pull downs like this are par for the coarse, but haven't
 found ready examples to point me to the right d2w keys.
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com

 This email sent to programming...@mac.com

 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org

 This email sent to m...@wardle.org
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com