cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOPEX V5 Customization package possibilities

oguimard
Retired

I’ve just watched your Webinar

 

 

I’ve 2 questions for you that came to my mind while watching:

  1. I saw we can include a subset of the megasite.ini file in a custom module. Now, if I need to change the value of an option at profile level, how should I proceed to package this change in a custom module?
  2. Is there a way to batch the restart of the HAS instance and the Automatic update? Imagine the HOPEX administrator has published a new custom module but does wand to stop the service during working hours. It would be useful if he could schedule these two last steps at night.
3 Replies

Point 1: when you say it cannot be done in HOPEX customizer what you mean ?

 

In V5 I can change the option directly on the profile;

optionprofile.png

 

 

Point 2 : This is planned to published this REST API. Right now it it schedule for the next major release. 

 

 

 

Hi Olivier,

Thanks for you answer.

Let me add 2 remarks:

Point 1: indeed, profile options are stored in the systemDb. But we cannot change them through the HOPEX Customizer desktop (we need to use the HOPEX Administration desktop). I Don’t know how to package these changes in this particular case

 

Point 2: it would be great if we could launch the EasyUpdate through RESTAPI (thus, we could both restart the HAS instance and launch the EasyUpdate through APIs 😊)

oguimard
Retired

The package module contains two main type of elements :

  • ressource files : css, jar, dll, mgs...
  • content to be imported in the database : a set of MGR/XMG

 

Point 1 :  if i am correct options at profile level are stored within the SystemDb. So you need to use the mechanism to generate the MGR/XMG.

 

Point 2 :

 

 

Parameter to give to the macro 

 

"EnvironmentUpdate=Yes;SqlConversion=Yes;DataConversion=Yes;MetamodelCompilation=Yes"

 

 

'MegaContext(External,Fields,Types)
'Uses(Components)
Option Explicit

Function InvokeArgCount()
    InvokeArgCount = 1
End Function

Function InvokeOnRoot(mgobjRoot, strOptions)
    Dim bEnvironementUpdate : bEnvironementUpdate = 0
    Dim bSqlConversion : bSqlConversion = 0
    Dim bDataConversion : bDataConversion = 0
    Dim bMetamodelCompilation : bMetamodelCompilation = 0

    If 0 < Len(strOptions) Then
        Dim strOption
        For each strOption in split(strOptions, ",")
            If 0 < Len(strOption) Then
                Dim nOptionTokenIndex : nOptionTokenIndex = 0
                Dim strCommandId : strCommandId = ""
                Dim strCommandValue : strCommandValue = "No"
                Dim strOptionToken
                For each strOptionToken in split(strOption, "=")
                    If 0 = nOptionTokenIndex Then
                        strCommandId = strOptionToken
                    End If

                    If 1 = nOptionTokenIndex Then
                        strCommandValue = strOptionToken
                    End If
                    nOptionTokenIndex = nOptionTokenIndex + 1
                Next

                If "EnvironmentUpdate" = strCommandId And "Yes" = strCommandValue Then
                    bEnvironementUpdate = 1
                End If

                If "SqlConversion" = strCommandId And "Yes" = strCommandValue Then
                    bSqlConversion = 1
                End If

                If "DataConversion" = strCommandId And "Yes" = strCommandValue Then
                    bDataConversion = 1
                End If

                If "MetamodelCompilation" = strCommandId And "Yes" = strCommandValue Then
                    bMetamodelCompilation = 1
                End If
            End If
        Next
    End If

    Dim strFinalResult : strFinalResult = "{"

    Dim strJsonSqlConversionAlignIndexResult : strJsonSqlConversionAlignIndexResult = "{}"
    Dim strJsonSqlConversionOptimFkResult : strJsonSqlConversionOptimFkResult = "{}"
    If 1 = bSqlConversion Then
        strJsonSqlConversionAlignIndexResult = mgobjRoot.CallFunction("~OpjjgM(ZQzrR[TechnicalSQLDataConvert]","AlignIndexes")
        strJsonSqlConversionOptimFkResult = mgobjRoot.CallFunction("~OpjjgM(ZQzrR[TechnicalSQLDataConvert]","AlignFKOptimizations")
    End If

    Dim strJsonEnvironementUpdateResult : strJsonEnvironementUpdateResult = "{}"
    If 1 = bEnvironementUpdate Then
        strJsonEnvironementUpdateResult = mgobjRoot.CallFunction("~j22iGOxJFL71[ImportAutomaticUpdate]")
    End If
    
    Dim strJsonDataConversionResult : strJsonDataConversionResult = "{}"
    If 1 = bDataConversion Then
        strJsonDataConversionResult = mgobjRoot.CallFunction("~n8Zm3OSVQfrG[ConvertAutomaticUpdateMethod]", "", "")
    End If
    
    Dim strJsonMetamodelCompilationResult : strJsonMetamodelCompilationResult = "{}"
    If 1 = bMetamodelCompilation Then
        Dim ulCompileMM : ulCompileMM = 1
        Dim ulCompileTD : ulCompileTD = 1
        Dim ulCompileP : ulCompileP = 1
        Dim ulRemoveOldCompilationResults : ulRemoveOldCompilationResults = 1
        Dim ulSaveCompilationResults : ulSaveCompilationResults = 1
        strJsonMetamodelCompilationResult = mgobjRoot.CallFunction("~91tmJFSUQL6I[MetaControl]", ulCompileMM, ulCompileTD, ulCompileP, ulRemoveOldCompilationResults, ulSaveCompilationResults)
    End If
    
    If 1 = bEnvironementUpdate Then
        strFinalResult = strFinalResult & " ""EnvironmentUpdate"" : " &  strJsonEnvironementUpdateResult
    End If
    
    If 1 = bSqlConversion Then
        If 1 < Len(strFinalResult) Then
            strFinalResult = strFinalResult & ","
        End If
        strFinalResult = strFinalResult & " ""IndexesAlignment"" : " & strJsonSqlConversionAlignIndexResult & "," & " ""FKOptimizations"" : " & strJsonSqlConversionOptimFkResult
    End If
    
    If 1 = bDataConversion Then
        If 1 < Len(strFinalResult) Then
            strFinalResult = strFinalResult & ","
        End If
        strFinalResult = strFinalResult & " ""DataConversion"" : " & strJsonDataConversionResult
    End If
    
    If 1 = bMetamodelCompilation Then
        If 1 < Len(strFinalResult) Then
            strFinalResult = strFinalResult & ","
        End If
        strFinalResult = strFinalResult & " ""MetamodelCompilation"" : " & strJsonMetamodelCompilationResult
    End If

    strFinalResult = strFinalResult & "}"

    InvokeOnRoot = strFinalResult
End Function