public static int getActionTypeByDesc( String tt ) { if ( tt == null ) { return 0; } for ( int i = 0; i < actionTypeDesc.length; i++ ) { if ( actionTypeDesc[i].equalsIgnoreCase( tt ) ) { return i; } } // If this fails, try to match using the code. return getActionTypeByCode( tt ); }
private void setAfterIMAPRetrived() { boolean activeMoveToFolfer = ( ( ( wProtocol.getText().equals( MailConnectionMeta.PROTOCOL_STRING_IMAP ) ) && ( MailConnectionMeta .getActionTypeByDesc( wActionType.getText() ) == MailConnectionMeta.ACTION_TYPE_MOVE ) ) || ( MailConnectionMeta .getAfterGetIMAPByDesc( wAfterGetIMAP.getText() ) == MailConnectionMeta.AFTER_GET_IMAP_MOVE ) ); wlMoveToFolder.setEnabled( activeMoveToFolfer ); wMoveToFolder.setEnabled( activeMoveToFolfer ); wTestMoveToFolder.setEnabled( activeMoveToFolfer ); wSelectMoveToFolder.setEnabled( activeMoveToFolfer ); wlcreateMoveToFolder.setEnabled( activeMoveToFolfer ); wcreateMoveToFolder.setEnabled( activeMoveToFolfer ); }
retval.append( " " ).append( XMLHandler.addTagValue( "attachmentwildcard", attachmentwildcard ) ); retval.append( " " ).append( XMLHandler.addTagValue( "valueimaplist", MailConnectionMeta.getValueImapListCode( valueimaplist ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "imapfirstmails", imapfirstmails ) ); retval.append( " " ).append( XMLHandler.addTagValue( "imapfolder", imapfolder ) ); retval.append( " " ).append( XMLHandler.addTagValue( "conditionreceiveddate", MailConnectionMeta .getConditionDateCode( conditionReceivedDate ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nottermreceiveddatesearch", notTermReceivedDateSearch ) ); retval.append( " " ).append( XMLHandler.addTagValue( "receiveddate2", receivedDate2 ) ); retval.append( " " ).append( XMLHandler.addTagValue( "actiontype", MailConnectionMeta.getActionTypeCode( actiontype ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "movetoimapfolder", moveToIMAPFolder ) ); retval.append( " " ).append( XMLHandler.addTagValue( "createlocalfolder", createlocalfolder ) ); retval.append( " " ).append( XMLHandler.addTagValue( "aftergetimap", MailConnectionMeta.getAfterGetIMAPCode( aftergetimap ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "includesubfolders", includesubfolders ) ); retval.append( " " ).append( XMLHandler.addTagValue( "useproxy", useproxy ) );
private void checkUnavailableMode() { if ( wProtocol.getText().equals( MailConnectionMeta.PROTOCOL_STRING_POP3 ) && MailConnectionMeta.getActionTypeByDesc( wActionType.getText() ) == MailConnectionMeta.ACTION_TYPE_MOVE ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( "This action is not available for POP3!" + Const.CR + "Only one Folder (INBOX) is available in POP3." + Const.CR + "If you want to move messages to another folder," + Const.CR + "please use IMAP protocol." ); mb.setText( "ERROR" ); mb.open(); wActionType.setText( MailConnectionMeta.getActionTypeDesc( MailConnectionMeta.ACTION_TYPE_GET ) ); } }
attachmentwildcard = XMLHandler.getTagValue( entrynode, "attachmentwildcard" ); valueimaplist = MailConnectionMeta.getValueImapListByCode( Const.NVL( XMLHandler .getTagValue( entrynode, "valueimaplist" ), "" ) ); imapfirstmails = XMLHandler.getTagValue( entrynode, "imapfirstmails" ); notTermBodySearch = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "nottermbodysearch" ) ); conditionReceivedDate = MailConnectionMeta.getConditionByCode( Const.NVL( XMLHandler.getTagValue( entrynode, "conditionreceiveddate" ), "" ) ); notTermReceivedDateSearch = receivedDate2 = XMLHandler.getTagValue( entrynode, "receivedDate2" ); actiontype = MailConnectionMeta.getActionTypeByCode( Const .NVL( XMLHandler.getTagValue( entrynode, "actiontype" ), "" ) ); moveToIMAPFolder = XMLHandler.getTagValue( entrynode, "movetoimapfolder" ); createlocalfolder = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "createlocalfolder" ) ); aftergetimap = MailConnectionMeta.getAfterGetIMAPByCode( Const.NVL( XMLHandler.getTagValue( entrynode, "aftergetimap" ), "" ) ); includesubfolders = "Y".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, "includesubfolders" ) );
jobEntry.setProtocol( wProtocol.getText() ); jobEntry.setAttachmentWildcard( wAttachmentWildcard.getText() ); jobEntry.setValueImapList( MailConnectionMeta.getValueImapListByDesc( wIMAPListmails.getText() ) ); jobEntry.setFirstIMAPMails( wIMAPFirstmails.getText() ); jobEntry.setIMAPFolder( wIMAPFolder.getText() ); jobEntry.setBodySearch( wBody.getText() ); jobEntry.setNotTermBodySearch( wNegateBody.getSelection() ); jobEntry.setConditionOnReceivedDate( MailConnectionMeta.getConditionDateByDesc( wConditionOnReceivedDate .getText() ) ); jobEntry.setNotTermReceivedDateSearch( wNegateReceivedDate.getSelection() ); jobEntry.setReceivedDate1( wReadFrom.getText() ); jobEntry.setReceivedDate2( wReadTo.getText() ); jobEntry.setActionType( MailConnectionMeta.getActionTypeByDesc( wActionType.getText() ) ); jobEntry.setMoveToIMAPFolder( wMoveToFolder.getText() ); jobEntry.setCreateMoveToFolder( wcreateMoveToFolder.getSelection() ); jobEntry.setCreateLocalFolder( wcreateLocalFolder.getSelection() ); jobEntry.setAfterGetIMAP( MailConnectionMeta.getAfterGetIMAPByDesc( wAfterGetIMAP.getText() ) ); jobEntry.setIncludeSubFolders( wIncludeSubFolders.getSelection() ); jobEntry.setUseProxy( wUseProxy.getSelection() );
wIMAPListmails.setText( MailConnectionMeta.getValueImapListDesc( jobEntry.getValueImapList() ) ); if ( jobEntry.getIMAPFolder() != null ) { wIMAPFolder.setText( jobEntry.getIMAPFolder() ); wConditionOnReceivedDate.setText( MailConnectionMeta.getConditionDateDesc( jobEntry .getConditionOnReceivedDate() ) ); wNegateReceivedDate.setSelection( jobEntry.isNotTermReceivedDateSearch() ); wReadTo.setText( jobEntry.getReceivedDate2() ); wActionType.setText( MailConnectionMeta.getActionTypeDesc( jobEntry.getActionType() ) ); wcreateMoveToFolder.setSelection( jobEntry.isCreateMoveToFolder() ); wcreateLocalFolder.setSelection( jobEntry.isCreateLocalFolder() ); wMoveToFolder.setText( jobEntry.getMoveToIMAPFolder() ); wAfterGetIMAP.setText( MailConnectionMeta.getAfterGetIMAPDesc( jobEntry.getAfterGetIMAP() ) ); wIncludeSubFolders.setSelection( jobEntry.isIncludeSubFolders() ); wUseProxy.setSelection( jobEntry.isUseProxy() );
attachmentwildcard = rep.getJobEntryAttributeString( id_jobentry, "attachmentwildcard" ); valueimaplist = MailConnectionMeta.getValueListImapListByCode( Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "valueimaplist" ), "" ) ); imapfirstmails = rep.getJobEntryAttributeString( id_jobentry, "imapfirstmails" ); notTermBodySearch = rep.getJobEntryAttributeBoolean( id_jobentry, "nottermbodysearch" ); conditionReceivedDate = MailConnectionMeta.getConditionByCode( Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "conditionreceiveddate" ), "" ) ); notTermReceivedDateSearch = rep.getJobEntryAttributeBoolean( id_jobentry, "nottermreceiveddatesearch" ); receivedDate2 = rep.getJobEntryAttributeString( id_jobentry, "receiveddate2" ); actiontype = MailConnectionMeta.getActionTypeByCode( Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "actiontype" ), "" ) ); moveToIMAPFolder = rep.getJobEntryAttributeString( id_jobentry, "movetoimapfolder" ); createlocalfolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createlocalfolder" ); aftergetimap = MailConnectionMeta.getAfterGetIMAPByCode( Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "aftergetimap" ), "" ) ); includesubfolders = rep.getJobEntryAttributeBoolean( id_jobentry, "includesubfolders" );
mailConn = new MailConnection( LogChannel.UI, MailConnectionMeta.getProtocolFromString( wProtocol.getText(), MailConnectionMeta.PROTOCOL_IMAP ), realserver, realport, realuser, realpass, wUseSSL.getSelection(), wUseProxy.getSelection(), realProxyUsername );
private void setActionType() { checkUnavailableMode(); if ( MailConnectionMeta.getActionTypeByDesc( wActionType.getText() ) != MailConnectionMeta.ACTION_TYPE_GET ) { wAfterGetIMAP.setText( MailConnectionMeta.getAfterGetIMAPDesc( MailConnectionMeta.AFTER_GET_IMAP_NOTHING ) ); } boolean getmessages = MailConnectionMeta.getActionTypeByDesc( wActionType.getText() ) == MailConnectionMeta.ACTION_TYPE_GET; wlOutputDirectory.setEnabled( getmessages ); wOutputDirectory.setEnabled( getmessages ); wbDirectory.setEnabled( getmessages ); wlcreateLocalFolder.setEnabled( getmessages ); wcreateLocalFolder.setEnabled( getmessages ); wFilenamePattern.setEnabled( getmessages ); wlFilenamePattern.setEnabled( getmessages ); wlAttachmentWildcard.setEnabled( getmessages ); wAttachmentWildcard.setEnabled( getmessages ); wlDifferentFolderForAttachment.setEnabled( getmessages ); wDifferentFolderForAttachment.setEnabled( getmessages ); wlGetAttachment.setEnabled( getmessages ); wGetAttachment.setEnabled( getmessages ); wlGetMessage.setEnabled( getmessages ); wGetMessage.setEnabled( getmessages ); wlAfterGetIMAP .setEnabled( getmessages && wProtocol.getText().equals( MailConnectionMeta.PROTOCOL_STRING_IMAP ) ); wAfterGetIMAP .setEnabled( getmessages && wProtocol.getText().equals( MailConnectionMeta.PROTOCOL_STRING_IMAP ) ); setAfterIMAPRetrived(); }
MailConnectionMeta.getValueImapListByCode( Const.NVL( XMLHandler.getTagValue( stepnode, "valueimaplist" ), "" ) ); imapfirstmails = XMLHandler.getTagValue( stepnode, "imapfirstmails" ); notTermSubjectSearch = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "nottermsubjectsearch" ) ); conditionReceivedDate = MailConnectionMeta.getConditionByCode( Const.NVL( XMLHandler.getTagValue( stepnode, "conditionreceiveddate" ), "" ) ); notTermReceivedDateSearch =
MailConnectionMeta.getValueListImapListByCode( Const.NVL( rep.getStepAttributeString( id_step, "valueimaplist" ), "" ) ); imapfirstmails = rep.getStepAttributeString( id_step, "imapfirstmails" ); notTermSubjectSearch = rep.getStepAttributeBoolean( id_step, "nottermsubjectsearch" ); conditionReceivedDate = MailConnectionMeta.getConditionByCode( Const.NVL( rep.getStepAttributeString( id_step, "conditionreceiveddate" ), "" ) ); notTermReceivedDateSearch = rep.getStepAttributeBoolean( id_step, "nottermreceiveddatesearch" );
public static int getAfterGetIMAPByDesc( String tt ) { if ( tt == null ) { return 0; } for ( int i = 0; i < afterGetIMAPDesc.length; i++ ) { if ( afterGetIMAPDesc[i].equalsIgnoreCase( tt ) ) { return i; } } // If this fails, try to match using the code. return getAfterGetIMAPByCode( tt ); }
private void activeAttachmentFolder() { boolean getmessages = MailConnectionMeta.getActionTypeByDesc( wActionType.getText() ) == MailConnectionMeta.ACTION_TYPE_GET; wlDifferentFolderForAttachment.setEnabled( getmessages && wGetAttachment.getSelection() ); wDifferentFolderForAttachment.setEnabled( getmessages && wGetAttachment.getSelection() ); boolean activeattachmentfolder = ( wGetAttachment.getSelection() && wDifferentFolderForAttachment.getSelection() ); wlAttachmentFolder.setEnabled( getmessages && activeattachmentfolder ); wAttachmentFolder.setEnabled( getmessages && activeattachmentfolder ); wbAttachmentFolder.setEnabled( getmessages && activeattachmentfolder ); if ( !wGetAttachment.getSelection() && !wGetMessage.getSelection() ) { wGetMessage.setSelection( true ); } }
mailConn = new MailConnection( LogChannel.UI, MailConnectionMeta.getProtocolFromString( wProtocol.getText(), MailConnectionMeta.PROTOCOL_IMAP ), realserver, realport, realuser, realpass, wUseSSL.getSelection(), wUseProxy.getSelection(), realproxyuser );
rep.saveJobEntryAttribute( id_job, getObjectId(), "attachmentwildcard", attachmentwildcard ); rep.saveJobEntryAttribute( id_job, getObjectId(), "valueimaplist", MailConnectionMeta .getValueImapListCode( valueimaplist ) ); rep.saveJobEntryAttribute( id_job, getObjectId(), "imapfirstmails", imapfirstmails ); rep.saveJobEntryAttribute( id_job, getObjectId(), "imapfolder", imapfolder ); rep.saveJobEntryAttribute( id_job, getObjectId(), "nottermbodysearch", notTermBodySearch ); rep.saveJobEntryAttribute( id_job, getObjectId(), "conditionreceiveddate", MailConnectionMeta .getConditionDateCode( conditionReceivedDate ) ); rep.saveJobEntryAttribute( id_job, getObjectId(), "nottermreceiveddatesearch", notTermReceivedDateSearch ); rep.saveJobEntryAttribute( id_job, getObjectId(), "receiveddate1", receivedDate1 ); rep.saveJobEntryAttribute( id_job, getObjectId(), "receiveddate2", receivedDate2 ); rep.saveJobEntryAttribute( id_job, getObjectId(), "actiontype", MailConnectionMeta .getActionTypeCode( actiontype ) ); rep.saveJobEntryAttribute( id_job, getObjectId(), "movetoimapfolder", moveToIMAPFolder ); rep.saveJobEntryAttribute( id_job, getObjectId(), "createmovetofolder", createmovetofolder ); rep.saveJobEntryAttribute( id_job, getObjectId(), "createlocalfolder", createlocalfolder ); rep.saveJobEntryAttribute( id_job, getObjectId(), "aftergetimap", MailConnectionMeta .getAfterGetIMAPCode( aftergetimap ) ); rep.saveJobEntryAttribute( id_job, getObjectId(), "includesubfolders", includesubfolders ); rep.saveJobEntryAttribute( id_job, getObjectId(), "useproxy", useproxy );
log, MailConnectionMeta.getProtocolFromString( meta.getProtocol(), MailConnectionMeta.PROTOCOL_IMAP ), realserver, realport, realusername, realpassword, meta.isUseSSL(), meta.isUseProxy(), realProxyUsername );
log, MailConnectionMeta.getProtocolFromString( getProtocol(), MailConnectionMeta.PROTOCOL_IMAP ), realserver, realport, realusername, realpassword, isUseSSL(), isUseProxy(), realProxyUsername );