Search in sources :

Example 11 with IMsn

use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.

the class InitMsnPage method getMsnList.

private List getMsnList() {
    if (this.msns == null || this.msns.size() == 0) {
        this.msns = new ArrayList();
        this.removeMsns = new ArrayList();
        String msnList = this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + "list");
        if (msnList.trim().length() > 0) {
            StringTokenizer st = new StringTokenizer(msnList, ",");
            while (st.hasMoreTokens()) {
                String number = st.nextToken().trim();
                if (number.length() > 0) {
                    IMsn msn = this.getRuntime().getCallFactory().createMsn(this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_msn"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_label"));
                    this.msns.add(msn);
                }
            }
        }
    }
    return this.msns;
}
Also used : StringTokenizer(java.util.StringTokenizer) ArrayList(java.util.ArrayList) IMsn(de.janrufmonitor.framework.IMsn)

Example 12 with IMsn

use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.

the class InitMsnPage method openMsnWizard.

private void openMsnWizard(String msn, String additional) {
    Display display = DisplayManager.getDefaultDisplay();
    Shell shell = new Shell(display);
    // Create the dialog
    IMsn oldMsn = this.getRuntime().getCallFactory().createMsn(msn, additional);
    WizardDialog.setDefaultImage(SWTImageManager.getInstance(this.getRuntime()).get(IJAMConst.IMAGE_KEY_PIM_ICON));
    MsnWizard msnW = new MsnWizard(oldMsn);
    WizardDialog dlg = new WizardDialog(shell, msnW);
    dlg.open();
    if (dlg.getReturnCode() == WizardDialog.OK) {
        IMsn result = msnW.getResult();
        this.msns.remove(oldMsn);
        this.msns.add(result);
    }
    tv.setInput(this.msns);
    this.resizeTable(tv.getTable());
}
Also used : Shell(org.eclipse.swt.widgets.Shell) MsnWizard(de.janrufmonitor.ui.jface.wizards.MsnWizard) IMsn(de.janrufmonitor.framework.IMsn) WizardDialog(org.eclipse.jface.wizard.WizardDialog) Display(org.eclipse.swt.widgets.Display)

Example 13 with IMsn

use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.

the class OldDatFileCallImporter method parseMsn.

private IMsn parseMsn(String msn) {
    IMsn parsedMSN = PIMRuntime.getInstance().getCallFactory().createMsn("", "");
    if (msn.indexOf("(") > 0) {
        String _msn = msn.substring(0, msn.indexOf("(") - 1);
        _msn = _msn.trim();
        String _msnAdd = msn.substring(msn.indexOf("(") + 1, msn.lastIndexOf(")"));
        parsedMSN.setMSN(_msn);
        parsedMSN.setAdditional(_msnAdd);
    } else {
        msn = msn.trim();
        parsedMSN.setMSN(msn);
        parsedMSN.setAdditional(PIMRuntime.getInstance().getMsnManager().getMsnLabel(msn));
    }
    return parsedMSN;
}
Also used : IMsn(de.janrufmonitor.framework.IMsn)

Example 14 with IMsn

use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.

the class MailNotification method getDataList.

private List getDataList() {
    if (this.dataList == null || this.dataList.size() == 0) {
        this.dataList = new ArrayList();
        this.removableData = new ArrayList();
        String msnList = this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + "list");
        if (msnList.trim().length() > 0) {
            StringTokenizer st = new StringTokenizer(msnList, ",");
            while (st.hasMoreTokens()) {
                String number = st.nextToken().trim();
                if (number.length() > 0) {
                    IMsn msn = this.getRuntime().getMsnManager().createMsn(number);
                    MailDataObject mdo = new MailDataObject(msn, this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailto"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailfrom"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mimetype"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_encoding"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailsubject"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailcontent"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailtemplate"));
                    if (!this.dataList.contains(mdo))
                        this.dataList.add(mdo);
                }
            }
        }
    }
    return this.dataList;
}
Also used : IMsn(de.janrufmonitor.framework.IMsn)

Example 15 with IMsn

use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.

the class MailNotification method sendTestMail.

public void sendTestMail() {
    ICaller caller = getRuntime().getCallerFactory().createCaller(getRuntime().getCallerFactory().createName("Max", "Mustermann"), getRuntime().getCallerFactory().createPhonenumber("49", "30", "1234567890"));
    IMsn msn = getRuntime().getMsnManager().createMsn("12345");
    ICip cip = getRuntime().getCipManager().createCip("999");
    ICall call = getRuntime().getCallFactory().createCall(caller, msn, cip);
    if (this.m_configuration == null) {
        PropagationFactory.getInstance().fire(new de.janrufmonitor.exception.Message(de.janrufmonitor.exception.Message.ERROR, NAMESPACE, "notstarted", new String[] {}, new Exception()), "Tray");
        return;
    }
    if (this.m_task == null) {
        this.m_task = new MailTask();
        this.m_logger.info("Created new MailTask instance");
    }
    PropagationFactory.getInstance().fire(new de.janrufmonitor.exception.Message(de.janrufmonitor.exception.Message.INFO, NAMESPACE, "testmail", new String[] {}, new Exception()), "Tray");
    this.m_task.setConfiguration(this.m_configuration);
    this.m_task.addMail(call);
    this.m_task.run();
}
Also used : ICaller(de.janrufmonitor.framework.ICaller) ICip(de.janrufmonitor.framework.ICip) ICall(de.janrufmonitor.framework.ICall) IMsn(de.janrufmonitor.framework.IMsn) MessagingException(javax.mail.MessagingException) AddressException(javax.mail.internet.AddressException)

Aggregations

IMsn (de.janrufmonitor.framework.IMsn)43 ICip (de.janrufmonitor.framework.ICip)17 IPhonenumber (de.janrufmonitor.framework.IPhonenumber)17 ICaller (de.janrufmonitor.framework.ICaller)16 Date (java.util.Date)16 IAttributeMap (de.janrufmonitor.framework.IAttributeMap)11 ICall (de.janrufmonitor.framework.ICall)9 IAttribute (de.janrufmonitor.framework.IAttribute)8 IName (de.janrufmonitor.framework.IName)6 StringTokenizer (java.util.StringTokenizer)6 SimpleDateFormat (java.text.SimpleDateFormat)5 AttributeFilter (de.janrufmonitor.repository.filter.AttributeFilter)4 IFilter (de.janrufmonitor.repository.filter.IFilter)4 ItemCountFilter (de.janrufmonitor.repository.filter.ItemCountFilter)4 MsnFilter (de.janrufmonitor.repository.filter.MsnFilter)4 IRuntime (de.janrufmonitor.runtime.IRuntime)4 HandlerException (de.janrufmonitor.service.commons.http.handler.HandlerException)4 ParseException (java.text.ParseException)4 ArrayList (java.util.ArrayList)4 Iterator (java.util.Iterator)4