private iSubmissionPackageModule Get_Submission_Module(Builder_Module_Setting ItemSetting, string InstanceName, out string ErrorMessage)
        {
            ErrorMessage = String.Empty;

            // Look for the standard
            if (String.IsNullOrEmpty(ItemSetting.Assembly))
            {
                iSubmissionPackageModule thisModule = null;
                switch (ItemSetting.Class)
                {
                    case "SobekCM.Builder_Library.Modules.Items.ConvertOfficeFilesToPdfModule":
                        thisModule = new ConvertOfficeFilesToPdfModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.ExtractTextFromPdfModule":
                        thisModule = new ExtractTextFromPdfModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CreatePdfThumbnailModule":
                        thisModule = new CreatePdfThumbnailModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.ExtractTextFromHtmlModule":
                        thisModule = new ExtractTextFromHtmlModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.ExtractTextFromXmlModule":
                        thisModule = new ExtractTextFromXmlModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.OcrTiffsModule":
                        thisModule = new OcrTiffsModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CleanDirtyOcrModule":
                        thisModule = new CleanDirtyOcrModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CheckForSsnModule":
                        thisModule = new CheckForSsnModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CreateImageDerivativesModule":
                        thisModule = new CreateImageDerivativesModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CreateImageDerivativesLegacyModule":
                        thisModule = new CreateImageDerivativesLegacyModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CopyToArchiveFolderModule":
                        thisModule = new CopyToArchiveFolderModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.MoveFilesToImageServerModule":
                        thisModule = new MoveFilesToImageServerModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.ReloadMetsAndBasicDbInfoModule":
                        thisModule = new ReloadMetsAndBasicDbInfoModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.UpdateJpegAttributesModule":
                        thisModule = new UpdateJpegAttributesModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.AttachAllNonImageFilesModule":
                        thisModule = new AttachAllNonImageFilesModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.AddNewImagesAndViewsModule":
                        thisModule = new AddNewImagesAndViewsModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.AttachImagesAllModule":
                        thisModule = new AttachImagesAllModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.EnsureMainThumbnailModule":
                        thisModule = new EnsureMainThumbnailModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.GetPageCountFromPdfModule":
                        thisModule = new GetPageCountFromPdfModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.UpdateWebConfigModule":
                        thisModule = new UpdateWebConfigModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.SaveServiceMetsModule":
                        thisModule = new SaveServiceMetsModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.SaveMarcXmlModule":
                        thisModule = new SaveMarcXmlModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.SaveToDatabaseModule":
                        thisModule = new SaveToDatabaseModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.SaveToSolrLuceneModule":
                        thisModule = new SaveToSolrLuceneModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CleanWebResourceFolderModule":
                        thisModule = new CleanWebResourceFolderModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.CreateStaticVersionModule":
                        thisModule = new CreateStaticVersionModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.AddTrackingWorkflowModule":
                        thisModule = new AddTrackingWorkflowModule();
                        break;

                    case "SobekCM.Builder_Library.Modules.Items.DeleteItemModule":
                        thisModule = new DeleteItemModule();
                        break;
                }

                if (thisModule != null)
                {
                    if ((!String.IsNullOrEmpty(ItemSetting.Argument1)) || (!String.IsNullOrEmpty(ItemSetting.Argument2)) || (!String.IsNullOrEmpty(ItemSetting.Argument3)))
                    {
                        if (thisModule.Arguments == null)
                            thisModule.Arguments = new List<string>();
                        thisModule.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument1) ? String.Empty : ItemSetting.Argument1);
                        thisModule.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument2) ? String.Empty : ItemSetting.Argument2);
                        thisModule.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument3) ? String.Empty : ItemSetting.Argument3);
                    }
                    return thisModule;
                }
            }

            object itemAsObj = Get_Module(ItemSetting, InstanceName, out ErrorMessage);
            if ((itemAsObj == null) && (ErrorMessage.Length > 0))
            {
                return null;
            }

            iSubmissionPackageModule itemAsItem = itemAsObj as iSubmissionPackageModule;
            if (itemAsItem == null)
            {
                ErrorMessage = ItemSetting.Class + " loaded from assembly but does not implement the ISubmissionPackageModules interface!";
                return null;
            }

            if ((!String.IsNullOrEmpty(ItemSetting.Argument1)) || (!String.IsNullOrEmpty(ItemSetting.Argument2)) || (!String.IsNullOrEmpty(ItemSetting.Argument3)))
            {
                if (itemAsItem.Arguments == null)
                    itemAsItem.Arguments = new List<string>();
                itemAsItem.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument1) ? String.Empty : ItemSetting.Argument1);
                itemAsItem.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument2) ? String.Empty : ItemSetting.Argument2);
                itemAsItem.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument3) ? String.Empty : ItemSetting.Argument3);
            }

            return itemAsItem;
        }
Example #2
0
        private iSubmissionPackageModule Get_Submission_Module(Builder_Module_Setting ItemSetting, string InstanceName, out string ErrorMessage)
        {
            ErrorMessage = String.Empty;

            // Look for the standard
            if (String.IsNullOrEmpty(ItemSetting.Assembly))
            {
                iSubmissionPackageModule thisModule = null;
                switch (ItemSetting.Class)
                {
                case "SobekCM.Builder_Library.Modules.Items.ConvertOfficeFilesToPdfModule":
                    thisModule = new ConvertOfficeFilesToPdfModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.ExtractTextFromPdfModule":
                    thisModule = new ExtractTextFromPdfModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CreatePdfThumbnailModule":
                    thisModule = new CreatePdfThumbnailModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.ExtractTextFromHtmlModule":
                    thisModule = new ExtractTextFromHtmlModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.ExtractTextFromXmlModule":
                    thisModule = new ExtractTextFromXmlModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.OcrTiffsModule":
                    thisModule = new OcrTiffsModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CleanDirtyOcrModule":
                    thisModule = new CleanDirtyOcrModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CheckForSsnModule":
                    thisModule = new CheckForSsnModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CreateImageDerivativesModule":
                    thisModule = new CreateImageDerivativesModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CreateImageDerivativesLegacyModule":
                    thisModule = new CreateImageDerivativesLegacyModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CopyToArchiveFolderModule":
                    thisModule = new CopyToArchiveFolderModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.MoveFilesToImageServerModule":
                    thisModule = new MoveFilesToImageServerModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.ReloadMetsAndBasicDbInfoModule":
                    thisModule = new ReloadMetsAndBasicDbInfoModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.UpdateJpegAttributesModule":
                    thisModule = new UpdateJpegAttributesModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.AttachAllNonImageFilesModule":
                    thisModule = new AttachAllNonImageFilesModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.AddNewImagesAndViewsModule":
                    thisModule = new AddNewImagesAndViewsModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.AttachImagesAllModule":
                    thisModule = new AttachImagesAllModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.EnsureMainThumbnailModule":
                    thisModule = new EnsureMainThumbnailModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.GetPageCountFromPdfModule":
                    thisModule = new GetPageCountFromPdfModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.UpdateWebConfigModule":
                    thisModule = new UpdateWebConfigModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.SaveServiceMetsModule":
                    thisModule = new SaveServiceMetsModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.SaveMarcXmlModule":
                    thisModule = new SaveMarcXmlModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.SaveToDatabaseModule":
                    thisModule = new SaveToDatabaseModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.SaveToSolrLuceneModule":
                    thisModule = new SaveToSolrLuceneModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CleanWebResourceFolderModule":
                    thisModule = new CleanWebResourceFolderModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.CreateStaticVersionModule":
                    thisModule = new CreateStaticVersionModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.AddTrackingWorkflowModule":
                    thisModule = new AddTrackingWorkflowModule();
                    break;

                case "SobekCM.Builder_Library.Modules.Items.DeleteItemModule":
                    thisModule = new DeleteItemModule();
                    break;
                }

                if (thisModule != null)
                {
                    if ((!String.IsNullOrEmpty(ItemSetting.Argument1)) || (!String.IsNullOrEmpty(ItemSetting.Argument2)) || (!String.IsNullOrEmpty(ItemSetting.Argument3)))
                    {
                        if (thisModule.Arguments == null)
                        {
                            thisModule.Arguments = new List <string>();
                        }
                        thisModule.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument1) ? String.Empty : ItemSetting.Argument1);
                        thisModule.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument2) ? String.Empty : ItemSetting.Argument2);
                        thisModule.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument3) ? String.Empty : ItemSetting.Argument3);
                    }
                    return(thisModule);
                }
            }

            object itemAsObj = Get_Module(ItemSetting, InstanceName, out ErrorMessage);

            if ((itemAsObj == null) && (ErrorMessage.Length > 0))
            {
                return(null);
            }

            iSubmissionPackageModule itemAsItem = itemAsObj as iSubmissionPackageModule;

            if (itemAsItem == null)
            {
                ErrorMessage = ItemSetting.Class + " loaded from assembly but does not implement the ISubmissionPackageModules interface!";
                return(null);
            }

            if ((!String.IsNullOrEmpty(ItemSetting.Argument1)) || (!String.IsNullOrEmpty(ItemSetting.Argument2)) || (!String.IsNullOrEmpty(ItemSetting.Argument3)))
            {
                if (itemAsItem.Arguments == null)
                {
                    itemAsItem.Arguments = new List <string>();
                }
                itemAsItem.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument1) ? String.Empty : ItemSetting.Argument1);
                itemAsItem.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument2) ? String.Empty : ItemSetting.Argument2);
                itemAsItem.Arguments.Add(String.IsNullOrEmpty(ItemSetting.Argument3) ? String.Empty : ItemSetting.Argument3);
            }

            return(itemAsItem);
        }