Ejemplo n.º 1
0
        //***********************************************************
        //
        // Method:		OnIndexFieldRename
        // Purpose:		An index field in the document class was renamed
        // Params:		strOldName-			Index field being renamed
        //				strNewName-			New name for index field
        // Output:		None
        //
        //************************************************************/
        internal static void OnIndexFieldRename(string strOldName, string strNewName,
                                                ReleaseSetupData oSetupData)
        {
            try
            {
                //locate all sourcetypes in the links collection which are BatchField related
                //and remove them but make sure that we add the destination back in to the collection

                foreach (Link oLink in oSetupData.Links)
                {
                    if ((oLink.Source.EndsWith(strOldName)) &&
                        (oLink.SourceType == KfxLinkSourceType.KFX_REL_INDEXFIELD))
                    {
                        oLink.Source = strNewName;
                    }
                }

                //FIX SPR#27062
                GC.Collect();
                GC.WaitForPendingFinalizers();

                oSetupData.Apply();
            }
            catch (Exception e)
            {
            }
        }
Ejemplo n.º 2
0
        //***********************************************************
        //
        // Method:		OnIndexFieldDelete
        // Purpose:		An index field was deleted from the existing document class
        // Params:		strIndexField-		Index field being deleted
        // Output:		None
        //
        //************************************************************/
        internal static bool OnIndexFieldDelete(string strIndexField, ReleaseSetupData oSetupData)
        {
            bool bShowUI = false;

            try
            {
                String            m_strDeletedIndexField   = strIndexField;
                KfxLinkSourceType m_kfxlnkDeletedFieldType = KfxLinkSourceType.KFX_REL_INDEXFIELD;

                //locate all sourcetypes in the links collection which are IndexField related
                //and remove them but make sure that we add the destination back in to the collection

                foreach (Link oLink in oSetupData.Links)
                {
                    if ((oLink.Source.EndsWith(strIndexField)) &&
                        (oLink.SourceType == m_kfxlnkDeletedFieldType))
                    {
                        oLink.Source     = "";
                        oLink.SourceType = KfxLinkSourceType.KFX_REL_UNDEFINED_LINK;
                        bShowUI          = true;
                    }
                }

                //FIX SPR#27062
                GC.Collect();
                GC.WaitForPendingFinalizers();

                oSetupData.Apply();
                return(bShowUI);
            }
            catch (Exception e)
            {
                return(bShowUI);
            }
        }
Ejemplo n.º 3
0
        //*********************************************************
        // Function:	CloseScript()
        // Scope:		internal
        // Overview:	SetupScript release point.  Perform any necessary
        //				cleanup such as logging out of the data
        //				source, release any resources, etc.
        // Params:		none
        // Returns:		One of the following:
        //				KFX_REL_SUCCESS, KFX_REL_ERROR
        // Called By:	Administration.  Called once just
        //				before the script object is released.
        //**********************************************************
        public KfxReturnValue CloseScript()
        {
            try
            {
                GC.Collect();
                GC.WaitForPendingFinalizers();

                //make sure all of the instances of SetupData are released.
                // **** LOOK AT THIS IN MORE DETAIL  **********
                while (System.Runtime.InteropServices.Marshal.ReleaseComObject(this.releaseSetUpData) > 0)
                {
                }

                this.releaseSetUpData = null;
                return(AscentRelease.KfxReturnValue.KFX_REL_SUCCESS);
            }
            catch (Exception e)
            {
                return(AscentRelease.KfxReturnValue.KFX_REL_ERROR);
            }
        }
 //**********************************************************************
 // Constructor. Expects a reference to the Setup Data structure.
 //**********************************************************************
 internal KfxReleaseScriptForm(ReleaseSetupData setupData)
 {
     InitializeComponent();
     this.setupData = setupData;
     PopulateControls();
 }
 /// <summary>
 /// Creates a reference to the setup data and initializes the UI
 /// </summary>
 /// <param name="objectSetupData">ReleaseSetupData</param>
 /// <returns></returns>
 public DialogResult ShowSetupForm(ref ReleaseSetupData objectSetupData)
 {
     releaseSetupData = objectSetupData;
     return(ShowDialog());
 }
Ejemplo n.º 6
0
 //***********************************************************
 //
 // Method:		Constructor
 // Purpose:		Initializes member variables.
 //
 //************************************************************/
 internal frmAlfrescoSetUp(ReleaseSetupData releaseSetUpData)
 {
     this.releaseSetUpData = releaseSetUpData;
     InitializeComponent();
 }
Ejemplo n.º 7
0
        //**************************************************************
        // Function:	ShowForm
        // Purpose:		Display the Release Setup form to the user
        //                (also displaying the frmWait)
        //
        // Input:		None
        //
        // Output:		The return value KfxReturnValue success/failure/Stopped
        //*************************************************************/
        internal KfxReturnValue ShowForm()
        {
            try
            {

                frmConnecting oWait = new frmConnecting(this);
                oWait.LoadSettings();

                DialogResult oResult = this.ShowDialog();

                if (oResult == DialogResult.Cancel)
                {
                    m_bCancel = true;

                    this.Close();
                }

                //If the user has canceled the UI, we must return KFX_REL_STOPPED
                if (!m_bCancel)
                {
                    return KfxReturnValue.KFX_REL_SUCCESS;
                }
                else
                {
                    return KfxReturnValue.KFX_REL_STOPPED;
                }

            }
            catch (Exception)
            {
                return KfxReturnValue.KFX_REL_ERROR;
            }
            finally
            {
                //Unload the form
                this.Close();
                this.Dispose(true);
                this.releaseSetUpData = null;

            }
        }
Ejemplo n.º 8
0
        //*********************************************************
        // Function:	CloseScript()
        // Scope:		internal
        // Overview:	SetupScript release point.  Perform any necessary
        //                cleanup such as logging out of the data
        //                source, release any resources, etc.
        // Params:		none
        // Returns:		One of the following:
        //                KFX_REL_SUCCESS, KFX_REL_ERROR
        // Called By:	Administration.  Called once just
        //                before the script object is released.
        //**********************************************************
        public KfxReturnValue CloseScript()
        {
            try
            {
                GC.Collect();
                GC.WaitForPendingFinalizers();

                //make sure all of the instances of SetupData are released.
                // **** LOOK AT THIS IN MORE DETAIL  **********
                while (System.Runtime.InteropServices.Marshal.ReleaseComObject(this.releaseSetUpData) > 0)
                { }

                this.releaseSetUpData = null;
                return AscentRelease.KfxReturnValue.KFX_REL_SUCCESS;
            }
            catch(Exception e)
            {

                return AscentRelease.KfxReturnValue.KFX_REL_ERROR;
            }
        }
 //**********************************************************************
 // Appends the specified exception in the Kofax error log
 //**********************************************************************
 private void LogException(ReleaseSetupData setupData,
     Exception e)
 {
     if (setupData != null)
     {
         // Use the Kofax logging handler
         setupData.LogError(0,
                            0,
                            0,
                            e.ToString(),
                            e.Source,
                            0);
     }
 }
Ejemplo n.º 10
0
 public ReleaseUtils(ReleaseSetupData releaseSetUpData)
 {
     this.releaseSetUpData = releaseSetUpData;
 }
Ejemplo n.º 11
0
        //***********************************************************
        //
        // Method:		OnIndexFieldRename
        // Purpose:		An index field in the document class was renamed
        // Params:		strOldName-			Index field being renamed
        //                strNewName-			New name for index field
        // Output:		None
        //
        //************************************************************/
        internal static void OnIndexFieldRename(string strOldName, string strNewName,
            ReleaseSetupData oSetupData)
        {
            try
            {

                //locate all sourcetypes in the links collection which are BatchField related
                //and remove them but make sure that we add the destination back in to the collection

                foreach (Link oLink in oSetupData.Links)
                {
                    if ((oLink.Source.EndsWith(strOldName)) &&
                        (oLink.SourceType == KfxLinkSourceType.KFX_REL_INDEXFIELD))
                    {
                        oLink.Source = strNewName;
                    }
                }

                //FIX SPR#27062
                GC.Collect();
                GC.WaitForPendingFinalizers();

                oSetupData.Apply();
            }
            catch (Exception e)
            {

            }
        }
Ejemplo n.º 12
0
        //***********************************************************
        //
        // Method:		OnIndexFieldDelete
        // Purpose:		An index field was deleted from the existing document class
        // Params:		strIndexField-		Index field being deleted
        // Output:		None
        //
        //************************************************************/
        internal static bool OnIndexFieldDelete(string strIndexField, ReleaseSetupData oSetupData)
        {
            bool bShowUI = false;

            try
            {

                String m_strDeletedIndexField = strIndexField;
                KfxLinkSourceType m_kfxlnkDeletedFieldType = KfxLinkSourceType.KFX_REL_INDEXFIELD;

                //locate all sourcetypes in the links collection which are IndexField related
                //and remove them but make sure that we add the destination back in to the collection

                foreach (Link oLink in oSetupData.Links)
                {
                    if ((oLink.Source.EndsWith(strIndexField)) &&
                        (oLink.SourceType == m_kfxlnkDeletedFieldType))
                    {
                        oLink.Source = "";
                        oLink.SourceType = KfxLinkSourceType.KFX_REL_UNDEFINED_LINK;
                        bShowUI = true;
                    }
                }

                //FIX SPR#27062
                GC.Collect();
                GC.WaitForPendingFinalizers();

                oSetupData.Apply();
                return bShowUI;
            }
            catch (Exception e)
            {

                return bShowUI;
            }
        }
Ejemplo n.º 13
0
 public ReleaseUtils(ReleaseSetupData releaseSetUpData)
 {
     this.releaseSetUpData = releaseSetUpData;
 }