Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleПример
linenumberstrue
collapsetrue
public class CustomUpload
    extends EventScriptBase<SormUploadEvent>
{
	 @Override
    public void onEvent( SormUploadEvent event, Setup setup, ConnectionSet set )
    throws Exception
    {
        SormProject sormProject = event.getSormProject();

        CustomUploadSorm customCustomUploadSorm = new CustomUploadSorm( sormProject, true );

        event.setUploadVersion( customCustomUploadSorm );
    }

    /**
     * Класс-реализация пользовательской выгрузки СОРМ.
     */
    static class CustomUploadSorm
        extends Upload
    {
        SormProject sormProject;

        public CustomUploadSorm( SormProject sormProject )
        {
			//true - если нужна полная выгрузка, false - если выгрузка будет инкрементальной. Т.е. будут выгружены только новые и изменённые с последней выгрузки договоры, и данные к ним.
            super( sormProject, true );
            this.sormProject = sormProject;
        }

        @Override
        public File abonents()
        {
            return null;
        }

        @Override
        public File abonentsAddresses()
        {
            return null;
        }

        @Override
        public File abonentLogins()
        {
            return null;
        }

        @Override
        public File services()
        {
            return null;
        }

        @Override
        public File abonentServices()
        {
            return null;
        }

        @Override
        public File ipNumbering()
        {
            return null;
        }

        @Override
        public File abonentsIpNumbering()
        {
            return null;
        }

        @Override
        public File switches()
        {
            return null;
        }

        @Override
        public File gateways()
        {
            return null;
        }

        @Override
        public File bunches()
        {
            return null;
        }

        @Override
        public File phoneNumbering()
        {
            return null;
        }

        @Override
        public File phoneNumberingAbonents()
        {
            return null;
        }

        @Override
        public File documentTypes()
        {
            return null;
        }

        @Override
        public File paymentTypes()
        {
            return null;
        }

        @Override
        public File abonentsPayments()
        {
            return null;
        }

        @Override
        public List<File> getOtherFiles()
        {
            return null;
        }

        @Override
        public File operatorInfo()
        {
            return null;
        }
         @Override
        public void closeResources()
        throws BGException
        {
			
        }

        @Override
        public SormUploadStatistic getUploadStatistic()
        {
            return null;
        }
    }

Метод getOtherFiles() может быть использован для формирования и выгрузки любых необходимых файлов.

...