[sip-comm-dev] Adding a config form to the configuration window


#1

I'm trying to get my config dialog to show up in the configuration
window, and frankly I'm stuck.

Details are on my project blog:
http://sc-avmailbox.blogspot.com/2007/08/well-it-looks-nice-in-my-head.html

I've got this lurking feeling that there's something really obvious
that I'm missing because it's getting a little late over here, but
thanks for any help.

···

--
Ryan Ricard
evilhecubus@gmail.com
ryan.ricard@student.utdallas.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Oh, and I've got the code up in my SVN in case anyone is inclined to have a look

https://sc-avmailbox.dev.java.net/

Thanks again.

···

On 8/14/07, Ryan Ricard <ryan.ricard@student.utdallas.edu> wrote:

I'm trying to get my config dialog to show up in the configuration
window, and frankly I'm stuck.

Details are on my project blog:
http://sc-avmailbox.blogspot.com/2007/08/well-it-looks-nice-in-my-head.html

I've got this lurking feeling that there's something really obvious
that I'm missing because it's getting a little late over here, but
thanks for any help.

--
Ryan Ricard
evilhecubus@gmail.com
ryan.ricard@student.utdallas.edu

--
Ryan Ricard
evilhecubus@gmail.com
ryan.ricard@student.utdallas.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Ryan,

Hope that the following will help you to fix this.

I found several problems.

The first one is that you try to obtain the UIService in the MalboxActivator
start method, but actually when you have a look in the
felix.client.run.properties file, the mailbox bundle is started before the
swing-ui bundle. I saw that you're using the matadata.xml, so maybe (as I'm
not very familiar with it) you should just declare there that your bundle
requires the UIService, as you've done for the ProtocolProviderService and
the ConfigurationService. The other alternative is to implement the
org.osgi.framework.ServiceListener (there are several implementations of
this listener in the code, you could have a look in
MetaContactListServiceImpl or SystrayServiceJdicImpl).

The second thing is that the mailbox.manifest.mf misses all javax libraries
used in the MailboxConfigurationForm and Resources classes, you should
import them.

And finally you'll notice that the mailbox.jar doesn't contain any resource
files, neither the resources.properties file, nor the images and the
resources directory. This could be fixed by copying them using the copy
target (have a look at the "resource" target in the main build.xml). You
could just copy the target, remove the second fileset and change the
destination and source dirs.

Ah, just one more thing, it should be a copy paste error, but in the
resources.properties file the mailboxIcon points to the installed.png, which
does not exist in the resources directory, I should change that to tape.png.

I've made myself these changes to your code and I've successfully seen the
mailbox configuration form.

Good luck!
Yana

···

On 8/14/07, Ryan Ricard <ryan.ricard@student.utdallas.edu> wrote:

Oh, and I've got the code up in my SVN in case anyone is inclined to have
a look

https://sc-avmailbox.dev.java.net/

Thanks again.

On 8/14/07, Ryan Ricard <ryan.ricard@student.utdallas.edu> wrote:
> I'm trying to get my config dialog to show up in the configuration
> window, and frankly I'm stuck.
>
> Details are on my project blog:
>
http://sc-avmailbox.blogspot.com/2007/08/well-it-looks-nice-in-my-head.html
>
> I've got this lurking feeling that there's something really obvious
> that I'm missing because it's getting a little late over here, but
> thanks for any help.
>
> --
> Ryan Ricard
> evilhecubus@gmail.com
> ryan.ricard@student.utdallas.edu
>

--
Ryan Ricard
evilhecubus@gmail.com
ryan.ricard@student.utdallas.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi!
I probably found a bug in the MclStorageManager:

In extractContactsForAccount a malformed contact causes, that the listener
is removed, then an exception raises and the listener is not added any more.
Then the contact list is never saved again. I attached the fix below:

++++++++++++++++BUG?+++++++++++++++++
    void extractContactsForAccount(String accountID)
        throws XMLException
    {
        if(!isStarted())
            return;
        try
        {
            //we don't want to receive meta contact events triggerred by
ourselves
            //so we stop listening. it is possible but very unlikely that
other
            //events, not triggerred by us are received while we're off the
channel
            //but that would be a very bizzare case ..... I guess we got to
live
            //with the risk.
            this.mclServiceImpl.removeMetaContactListListener(this);

            Element root = findMetaContactGroupNode(
                mclServiceImpl.getRoot().getMetaUID());

            //parse the group node and extract all its child groups and
contacts
-> processGroupXmlNode(mclServiceImpl, accountID, root
->Exeption , null, null);

            //now save the contact list in case it has changed
            scheduleContactListStorage();

            //now that we're done updating the contact list we can start
listening
            //again
            this.mclServiceImpl.addMetaContactListListener(this);
        }catch(Throwable exc)
        {
            // catch everything because we MUST NOT disturb the thread
            //initializing the meta CL for a new provider with null point
            //exceptions or others of the sort
            throw new XMLException("Failed to extract contacts for account "
                                   +accountID, exc);
        }
    }

Here my corrected version. Shall I file a bug? See the finally section!
Best regards.

    void extractContactsForAccount(String accountID)
        throws XMLException
    {
        if(!isStarted())
            return;
        try
        {
            //we don't want to receive meta contact events triggerred by
ourselves
            //so we stop listening. it is possible but very unlikely that
other
            //events, not triggerred by us are received while we're off the
channel
            //but that would be a very bizzare case ..... I guess we got to
live
            //with the risk.
            this.mclServiceImpl.removeMetaContactListListener(this);

            Element root = findMetaContactGroupNode(
                mclServiceImpl.getRoot().getMetaUID());

            //parse the group node and extract all its child groups and
contacts
            processGroupXmlNode(mclServiceImpl, accountID, root
                                , null, null);

            //now save the contact list in case it has changed
            scheduleContactListStorage();

        }catch(Throwable exc)
        {
            // catch everything because we MUST NOT disturb the thread
            //initializing the meta CL for a new provider with null point
            //exceptions or others of the sort
            throw new XMLException("Failed to extract contacts for account "
                                   +accountID, exc);
        } finally {
            //now that we're done updating the contact list we can start
listening
            //again
            this.mclServiceImpl.addMetaContactListListener(this);
        }

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Yana, thanks so much! I can see my GUI now!

I really appreciate you picking over all the little details I forgot.
Thanks again.

···

On 8/14/07, Yana Stamcheva <yana.stamcheva@gmail.com> wrote:

Hi Ryan,

Hope that the following will help you to fix this.

I found several problems.

The first one is that you try to obtain the UIService in the MalboxActivator
start method, but actually when you have a look in the
felix.client.run.properties file, the mailbox bundle is started before the
swing-ui bundle. I saw that you're using the matadata.xml, so maybe (as I'm
not very familiar with it) you should just declare there that your bundle
requires the UIService, as you've done for the ProtocolProviderService and
the ConfigurationService. The other alternative is to implement the
org.osgi.framework.ServiceListener (there are several
implementations of this listener in the code, you could have a look in
MetaContactListServiceImpl or SystrayServiceJdicImpl).

The second thing is that the mailbox.manifest.mf misses all javax libraries
used in the MailboxConfigurationForm and Resources classes, you should
import them.

And finally you'll notice that the mailbox.jar doesn't contain any resource
files, neither the resources.properties file, nor the images and the
resources directory. This could be fixed by copying them using the copy
target (have a look at the "resource" target in the main build.xml). You
could just copy the target, remove the second fileset and change the
destination and source dirs.

Ah, just one more thing, it should be a copy paste error, but in the
resources.properties file the mailboxIcon points to the installed.png, which
does not exist in the resources directory, I should change that to tape.png.

I've made myself these changes to your code and I've successfully seen the
mailbox configuration form.

Good luck!
Yana

On 8/14/07, Ryan Ricard <ryan.ricard@student.utdallas.edu> > wrote:
> Oh, and I've got the code up in my SVN in case anyone is inclined to have
a look
>
> https://sc-avmailbox.dev.java.net/
>
> Thanks again.
>
>
>
> On 8/14/07, Ryan Ricard < > ryan.ricard@student.utdallas.edu> wrote:
> > I'm trying to get my config dialog to show up in the configuration
> > window, and frankly I'm stuck.
> >
> > Details are on my project blog:
> >
http://sc-avmailbox.blogspot.com/2007/08/well-it-looks-nice-in-my-head.html
> >
> > I've got this lurking feeling that there's something really obvious
> > that I'm missing because it's getting a little late over here, but
> > thanks for any help.
> >
> > --
> > Ryan Ricard
> > evilhecubus@gmail.com
> > ryan.ricard@student.utdallas.edu
> >
>
>
> --
> Ryan Ricard
> evilhecubus@gmail.com
> ryan.ricard@student.utdallas.edu
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
dev-unsubscribe@sip-communicator.dev.java.net
> For additional commands, e-mail:
dev-help@sip-communicator.dev.java.net
>
>

--
Ryan Ricard
evilhecubus@gmail.com
ryan.ricard@student.utdallas.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#6

Hey Thomas,

I was going back through uncommitted patches, and saw that there were
quite a few coming from you. Just wanted to let you know that the only
reason for this has been lack of time and if you want you may have a
look at them and commit these that are still relevant.

Cheers
Emil

Thomas Hofer wrote:

···

Hi!
I probably found a bug in the MclStorageManager:

In extractContactsForAccount a malformed contact causes, that the listener
is removed, then an exception raises and the listener is not added any more.
Then the contact list is never saved again. I attached the fix below:

++++++++++++++++BUG?+++++++++++++++++
    void extractContactsForAccount(String accountID)
        throws XMLException
    {
        if(!isStarted())
            return;
        try
        {
            //we don't want to receive meta contact events triggerred by
ourselves
            //so we stop listening. it is possible but very unlikely that
other
            //events, not triggerred by us are received while we're off the
channel
            //but that would be a very bizzare case ..... I guess we got to
live
            //with the risk.
            this.mclServiceImpl.removeMetaContactListListener(this);

            Element root = findMetaContactGroupNode(
                mclServiceImpl.getRoot().getMetaUID());

            //parse the group node and extract all its child groups and
contacts
-> processGroupXmlNode(mclServiceImpl, accountID, root
->Exeption , null, null);

            //now save the contact list in case it has changed
            scheduleContactListStorage();

            //now that we're done updating the contact list we can start
listening
            //again
            this.mclServiceImpl.addMetaContactListListener(this);
        }catch(Throwable exc)
        {
            // catch everything because we MUST NOT disturb the thread
            //initializing the meta CL for a new provider with null point
            //exceptions or others of the sort
            throw new XMLException("Failed to extract contacts for account "
                                   +accountID, exc);
        }
    }

Here my corrected version. Shall I file a bug? See the finally section!
Best regards.

    void extractContactsForAccount(String accountID)
        throws XMLException
    {
        if(!isStarted())
            return;
        try
        {
            //we don't want to receive meta contact events triggerred by
ourselves
            //so we stop listening. it is possible but very unlikely that
other
            //events, not triggerred by us are received while we're off the
channel
            //but that would be a very bizzare case ..... I guess we got to
live
            //with the risk.
            this.mclServiceImpl.removeMetaContactListListener(this);

            Element root = findMetaContactGroupNode(
                mclServiceImpl.getRoot().getMetaUID());

            //parse the group node and extract all its child groups and
contacts
            processGroupXmlNode(mclServiceImpl, accountID, root
                                , null, null);

            //now save the contact list in case it has changed
            scheduleContactListStorage();

        }catch(Throwable exc)
        {
            // catch everything because we MUST NOT disturb the thread
            //initializing the meta CL for a new provider with null point
            //exceptions or others of the sort
            throw new XMLException("Failed to extract contacts for account "
                                   +accountID, exc);
        } finally {
            //now that we're done updating the contact list we can start
listening
            //again
            this.mclServiceImpl.addMetaContactListListener(this);
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net