App Onboarding - Delete app not working
[portal.git] / ecomp-portal-BE-common / src / main / webapp / WEB-INF / fusion / orm / EP.hbm.xml
index e03c976..14156f4 100644 (file)
                        <column name="app_name" not-null="true" default="?"></column>
                </property>
                <property name="imageUrl" column="app_image_url" />
-               <property name="description" column="app_description" />
-               <property name="notes" column="app_notes" />
-               <property name="url" column="app_url" />
-               <property name="alternateUrl" column="app_alternate_url" />
+               <property name="appDescription" column="app_description" />
+               <property name="appNotes" column="app_notes" />
+               <property name="landingPage" column="app_url" />
+               <property name="alternateLandingPage" column="app_alternate_url" />
                <property name="appRestEndpoint" column="app_rest_endpoint" />
                <property name="mlAppName" type="string">
                        <column name="ml_app_name" not-null="true" default="?"></column>
                        <column name="ml_app_admin_id" not-null="true" default="?"></column>
                </property>
                <property name="motsId" column="mots_id" />
-               <property name="appPassword" type="string">
+               <property name="appBasicAuthPassword" type="string">
                        <column name="app_password" not-null="true" default="?"></column>
                </property>
                <property name="thumbnail" column="thumbnail" />
-               <property name="username" type="string">
+               <property name="appBasicAuthUsername" type="string">
                        <column name="app_username" not-null="true" default="?"></column>
                </property>
                <property name="open" type="yes_no">
                <property name="appType" type="integer">
                        <column name="app_type"></column>
                </property>
-               <property name="centralAuth" type="yes_no">
+               <property name="rolesInAAF" type="yes_no">
                        <column name="auth_central"></column>
                </property>
                <property name="nameSpace" type="string">
                        <column name="auth_namespace"></column>
                </property>
+               <property name="modeOfIntegration" type="string">
+                       <column name="mode_of_integration"></column>
+               </property>
+               <property name="appAck" type="yes_no">
+                       <column name="ack_app"></column>
+               </property>
+               <property name="usesCadi" type="yes_no">
+                       <column name="uses_cadi"></column>
+               </property>
+
                <one-to-one name="contactUs" class="AppContactUs" cascade="save-update"></one-to-one>
 
        </class>
                        from Language where languageId = :language_id
                ]]>
        </query>
+       
+       <query name="getActiveUsersForApp">
+               <![CDATA[
+                       select distinct(u) from EPUser as u inner join fetch u.EPUserApps as apps inner join fetch apps.app as app inner join fetch apps.role as role where app.id = :id and u.active = :active and role.id is not null
+               ]]>
+       </query>
 
        <!-- show the current user plus related users -->
        <sql-query name="relatedUsers">
@@ -1242,7 +1258,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE          , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1255,6 +1271,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                or
                                (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S')
                        )
+                       and a.app_type != 3 
                        union
                select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
@@ -1262,7 +1279,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION         , b.ACK_APP             , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d , ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                  order by app_name
@@ -1283,7 +1300,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE         , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1294,6 +1311,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                        or
                                (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H'))
                        )
+                       and a.app_type != 3 
                        union
                select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
@@ -1301,7 +1319,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d , ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                order by app_name
@@ -1325,7 +1343,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE          , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1338,6 +1356,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                or
                                (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S')
                        )
+                       and a.app_type != 3
                        union
                  select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
@@ -1345,7 +1364,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d , ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                        ) A 
@@ -1373,7 +1392,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE         , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1383,14 +1402,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                (a.OPEN = 'Y' and p.STATUS_CD = 'S')
                        or
                                (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H'))
-                       )union
+                       )
+                       and a.app_type != 3
+                       union
                select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
                        b.APP_NOTES             , b.APP_URL             , b.APP_ALTERNATE_URL   , b.APP_REST_ENDPOINT ,
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d , ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                        
@@ -1425,7 +1446,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE         , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1437,14 +1458,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                (a.OPEN = 'N' and r.ROLE_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H'))
                                or
                                (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S')
-                       )union
+                       )
+                       and a.app_type != 3
+                       union
                   select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
                        b.APP_NOTES             , b.APP_URL             , b.APP_ALTERNATE_URL   , b.APP_REST_ENDPOINT ,
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d , ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                        ) A 
@@ -1475,7 +1498,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE             , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1485,14 +1508,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                (a.OPEN = 'Y' and p.STATUS_CD = 'S')
                        or
                                (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H'))
-                       )union
+                       )
+                       and a.app_type != 3
+                       union
                  select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
                        b.APP_NOTES             , b.APP_URL             , b.APP_ALTERNATE_URL   , b.APP_REST_ENDPOINT ,
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d, ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                        )A 
@@ -1522,7 +1547,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE        , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1534,14 +1559,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                (a.OPEN = 'N' and r.ROLE_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H'))
                                or
                                (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S')
-                       )union
+                       )
+                       and a.app_type != 3
+                       union
                select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
                        b.APP_NOTES             , b.APP_URL             , b.APP_ALTERNATE_URL   , b.APP_REST_ENDPOINT ,
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d, ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                        ) A
@@ -1569,7 +1596,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE        , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1579,14 +1606,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                (a.OPEN = 'Y' and p.STATUS_CD = 'S')
                        or
                                (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H'))
-                       )union
+                       )
+                       and a.app_type != 3
+                       union
                select distinct  -- multiple roles yield multiple rows
                            b.APP_ID                    , b.APP_NAME            , b.APP_IMAGE_URL               ,b.APP_DESCRIPTION , 
                        b.APP_NOTES             , b.APP_URL             , b.APP_ALTERNATE_URL   , b.APP_REST_ENDPOINT ,
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d, ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                        ) A
@@ -1641,8 +1670,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
             left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
                        left outer join FN_PERS_USER_APP_SEL p ON a.APP_ID = p.APP_ID and p.USER_ID = :userId
       left outer join EP_USER_ROLES_REQUEST q ON a.APP_ID = q.APP_ID and q.USER_ID = :userId and q.request_status = 'P'
-      where a.ENABLED = 'Y'
-      
+      where a.ENABLED = 'Y' and a.app_type != 3
                        -- Show accessible apps first, then the rest; sort by name within each set.
             order by access desc, app_name asc
                    ;
@@ -1891,7 +1919,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
             left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
                        left outer join FN_PERS_USER_APP_SEL p ON a.APP_ID = p.APP_ID and p.USER_ID = :userId
                        left outer join EP_USER_ROLES_REQUEST q ON a.APP_ID = q.APP_ID and q.USER_ID = :userId and q.request_status = 'P'
-                       where a.ENABLED = 'Y'
+                       where a.ENABLED = 'Y' and a.app_type != 3
                        -- Show accessible apps first, then the rest; sort by name within each set.
             order by access desc, app_name asc
                    ;
@@ -2581,4 +2609,11 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                        UPDATE fn_user fu SET fu.language_id=:language_id WHERE fu.login_id=:login_id
                ]]>
        </sql-query>
+       
+       <sql-query name="getMicroservicesByAppId">
+       <return alias="getMicroservicesByAppId" class="org.onap.portalapp.portal.domain.MicroserviceData" />
+               <![CDATA[ 
+               SELECT * FROM ep_microservice WHERE appId =:applicationId
+               ]]>
+       </sql-query>
 </hibernate-mapping>