Wednesday, September 12, 2012

UI Templates used by Configurator UI

Following query returns the list of templates used by given UI. Replace ui_def_id in following query.


SELECT DISTINCT templ_ui_def_id,
  templ_id
FROM
  (SELECT ctrl_template_ui_def_id AS templ_ui_def_id,
     ctrl_template_id AS templ_id
   FROM cz_ui_page_elements pe
   WHERE ui_def_id = 113607
   AND deleted_flag = 0
   AND ctrl_template_id IS NOT NULL
   AND ctrl_template_ui_def_id IS NOT NULL
   AND EXISTS
    (SELECT 1
     FROM cz_ui_templates
     WHERE seeded_flag = 0
     AND deleted_flag = 0
     AND template_id = pe.ctrl_template_id
     AND ui_def_id = pe.ctrl_template_ui_def_id)
  UNION ALL
   SELECT page_status_templ_uidef_id AS templ_ui_def_id,
     page_status_template_id AS templ_id
   FROM cz_ui_pages pg
   WHERE ui_def_id = 113607
   AND deleted_flag = 0
   AND page_status_templ_uidef_id IS NOT NULL
   AND page_status_template_id IS NOT NULL
   AND EXISTS
    (SELECT 1
     FROM cz_ui_templates
     WHERE seeded_flag = 0
     AND deleted_flag = 0
     AND template_id = pg.page_status_template_id
     AND ui_def_id = pg.page_status_templ_uidef_id)
  UNION ALL
   SELECT ref_template_ui_def_id AS templ_ui_def_id,
     ref_template_id AS templ_id
   FROM cz_ui_ref_templates r
   WHERE deleted_flag = 0 START WITH deleted_flag = 0
   AND ref_templ_seeded_flag = 0
   AND(EXISTS
    (SELECT 1
     FROM cz_ui_page_elements pe
     WHERE pe.ui_def_id = 113607
     AND pe.deleted_flag = 0
     AND pe.ctrl_template_ui_def_id = r.template_ui_def_id
     AND pe.ctrl_template_id = r.template_id) OR EXISTS
      (SELECT 1
       FROM cz_ui_pages pg
       WHERE pg.ui_def_id = 113607
       AND pg.deleted_flag = 0
       AND pg.page_status_templ_uidef_id = r.template_ui_def_id
       AND pg.page_status_template_id = r.template_id)
    )
  CONNECT BY deleted_flag = 0
   AND ref_templ_seeded_flag = 0
   AND template_ui_def_id = PRIOR ref_template_ui_def_id
   AND template_id = PRIOR ref_template_id) ;
 

Friday, August 24, 2012

Fixing Dropdown Size in Configurator UI

In Configurator UI, dropdown UI element can be used to display 0/1 option feature's option in UI. In Configurator, we do not have control to specify width of the dropdown. It is automatically adjusted to accomodate largest string in its optoins. I have seen response from Bruce Bowers (of Sun microsystem, now Oracle) on this in one of the forum.
Here is a response from Bruce Bowers on this.
The following idea can be extended to tweak other styles in Configurator as well.

------------------

We are currently on 11.5.10.  I actually examined the HTML code generated for dropdowns by the OA Framework (see below).  The HTML select element (dropdown) is actually embedded in a HTML table for some reason (perhaps it's necessary for the Partial Page Refresh functionality.)  This embedding makes it harder to style the dropdown itself.  However, the select element does have a class attribute with the value "x4".  Therefore, you can give all of the dropdowns on a page the same width (or other style property).  To do this, add a Raw Text UI element with the following text:

<style>
select.x4 {width:200px;}
</style>


This is not strictly conformant to the HTML standard (because style elements are only supposed to appear in the head of the HTML page), and it is not guaranteed to work from Oracle release to Oracle release, but it is accepted by most browsers, and we have been using this general approach for several years without issues.

Bruce

-----

HTML code generated for a Configurator Dropdown List UI e
lement:

<table id="czUiNode_1__xc_" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td align="right" nowrap></td>
        <td></td>
        <td valign="top" nowrap>
            <script>function _uixspu(f,v,e,s,pt,p,o){if (!o) o=new Object();o.event=(e)?e:'update';if (s) o.source=s;if (p) { o.partial='true';if (pt) o.partialTargets=pt;_submitPartialChange(f,v,o);} else submitForm(f,v,o); }</script>
            <select id="czUiNode_1" class="x4" onchange="_uixspu('DefaultFormName',1,'update','17840',0,'true',{'_FORM_SUBMIT_BUTTON':'_fwkActBtnName_17840_update','evtSrcRowIdx':'0','evtSrcRowId':'CZApplicationModule.OF_1_PG0row3'});return false;" name="czUiNode_1">
                <option></option>
                <option value="opt9432">[Text Source]</option>
                <option value="opt13683">[Text Source]</option>
                <option value="opt9433">[Excluded Items Prefix] [Text Source] [Excluded Items Suffix]</option>
            </select>
        </td>
    </tr>
</table>

Friday, July 27, 2012

Configurator Model Size - Node count of the model

Usually its a common question in Configurator Development like how large the model is. Model size is usually determined by number of nodes created under it and its referenced models. When model performance is raised as a question, first question asked by analyzer would be how big the model is. Here is the query you can use for the same. This query returns the node count of all the models which are under given folder. You can modify the query to get node count for given project.

Q1) Count of nodes in model which are directly created under model

SELECT rpf.name folder_name,
  p.name model_name,
  p.devl_project_id,
  COUNT(*) node_count
FROM cz_devl_projects p,
  cz_ps_nodes pn,
  cz_rp_entries rpp,
  cz_rp_entries rpf
WHERE 1                  =1
AND rpp.object_id        =p.devl_project_id
AND rpp.enclosing_folder = rpf.object_id
AND pn.devl_project_id   = p.devl_project_id
AND p.deleted_flag       =0
AND pn.deleted_flag      =0
AND rpp.object_type      ='PRJ'
AND rpf.object_type      = 'FLD'
  --AND P.DEVL_PROJECT_ID=1037298
AND RPF.NAME LIKE 'Division A Models'
GROUP BY rpf.name ,
  p.name,
  p.devl_project_id;

Q2) Count of nodes in model which are directly created under this model + nodes created in all the referenced models of this model

SELECT rpf.name folder_name,
  p.name model_name,
  p.devl_project_id,
  COUNT(*) node_count
FROM cz_devl_projects p,
  cz_ps_nodes pn,
  cz_rp_entries rpp,
  cz_rp_entries rpf
WHERE 1                  =1
AND rpp.object_id        =p.devl_project_id
AND rpp.enclosing_folder = rpf.object_id
AND pn.devl_project_id  IN
  (SELECT component_id
  FROM cz_model_ref_expls mr
  WHERE mr.model_id  =p.devl_project_id
  AND mr.deleted_flag=0
  )
AND p.deleted_flag  =0
AND pn.deleted_flag =0
AND rpp.object_type ='PRJ'
AND rpf.object_type = 'FLD'
  --AND P.DEVL_PROJECT_ID=1037298
AND RPF.NAME LIKE ' Division A Models'
GROUP BY rpf.name ,
  p.name,
  p.devl_project_id
  --order by node_count desc
  ;

Saturday, June 23, 2012

Configurator Table - CZ_SERVERS

Configurator schema has plenty of tables, but one of the important one is CZ_SERVERS. Although you will not need to look at it frequently, but when something is wrong with instance or after cloning/migration, you need to ensure that CZ_SERVERS table contains correct data.

You can get complete details of the columns from Oracle ETRM

Few useful information:
The table must contain one entry atleast for local_name="LOCAL" and server_local_id=0 value. This record identifies local host for the server. If you clone or create new instance, then please ensure that the hostname is updated with this value from that instance
select host_name from v$instance

Please ensure that all the db links are active for the servers which are you using (either for BOM Import or Publication target). The db link names should be available in FNDNAM_LINK_NAME column. Same should exists in dba_db_links table.

IMPORT_ENABLED
Should be set to 1 only for one record in the table.

SOURCE_SERVER_FLAG
This flag will be set to 1 for the server record from which the publication has been done. If Instance A is doing publication to Instance B, then B's cz_servers will contain value "1" for the row which contains entry of Instance A.
If this flag is set to 1 for any record in cz_servers, then you cannot launch Configurator Developer on the instance. The reason is - Configurator thinks that this instance is a publication target. Doing a development activity on the instance may cause data corruption.