Menu

Showing FunctionalCI in Customer Portal

2024-10-21
2024-10-21
  • Mendrix Manlangit

    I am trying to show the specific Functional CI a user has and for admins they are shown every CI in the and contact in the platform. Here is my extension:

    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
      <portals>
        <portal id="itop-portal" _delta="must_exist">
          <!-- ID must match module_design[id] -->
          <url>
            pages/exec.php?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal</url>
          <!-- portal_id must match module_design[id] -->
          <rank>1.0</rank>
          <handler />
          <allow>
          </allow>
          <deny />
        </portal>
      </portals>
      <module_designs>
        <module_design id="itop-portal" xsi:type="portal" _delta="must_exist">
          <bricks>
            <brick id="portal-asset-brick" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick"
              _delta="define">
              <active>true</active>
              <rank>
                <default>50</default>
              </rank>
              <width>12</width>
              <title>
                <navigation_menu>Assets</navigation_menu>
                <home>Assets</home>
              </title>
              <description>Find all of your assets here!</description>
              <levels>
                <level id="1">
                  <class>Organization</class>
                  <title>Class:Organization</title>
                  <parent_att />
                  <actions>
                    <action id="drilldown" xsi:type="drilldown" />
                  </actions>
                  <levels>
                    <level id="1">
                      <class>Contact</class>
                      <title>Class:Person</title>
                      <parent_att>org_id</parent_att>
                      <fields>
                        <field id="first_name" />
                        <field id="function" />
                      </fields>
                      <actions>
                        <action id="view" xsi:type="view" />
                      </actions>
                      <levels />
                    </level>
                  </levels>
                </level>
              </levels>
              <browse_modes>
                <availables>
                  <mode id="list" />
                  <mode id="tree" />
                </availables>
                <default>list</default>
              </browse_modes>
              <data_loading>full</data_loading>
            </brick>
          </bricks>
          <classes>
        <!-- This breaks when I enter functionalCI class -->
            <class id="FunctionalCI">
              <scopes>
                <scope id="all">
                  <oql_view><![CDATA[SELECT FunctionalCI]]></oql_view>
                  <ignore_silos>true</ignore_silos>
                </scope>
              </scopes>
            </class>
            <class id="Organization">
              <scopes>
                <scope id="all">
                  <oql_view><![CDATA[SELECT Organization]]></oql_view>
                  <ignore_silos>true</ignore_silos>
                </scope>
              </scopes>
            </class>
            <class id="Contact">
              <scopes>
                <scope id="all">
                  <oql_view><![CDATA[SELECT Contact]]></oql_view>
                  <ignore_silos>true</ignore_silos>
                </scope>
              </scopes>
            </class>
          </classes>
        </module_design>
      </module_designs>
    
    </itop_design>
    

    When I tried entering the snippet below it gives an error saying: Symfony\Component\Routing\Router::generate(): Argument #1 ($name) must be of type string, null given, called in /var/www/html/itop/env-production/itop-portal-base/portal/src/Routing/UrlGenerator.php on line 55

    <class id="FunctionalCI">
              <scopes>
                <scope id="all">
                  <oql_view><![CDATA[SELECT FunctionalCI]]></oql_view>
                  <ignore_silos>true</ignore_silos>
                </scope>
              </scopes>
            </class>
    

    How can add the functional ci without having this error

     
  • Vincent @ Combodo

    Hi Mentrix,
    I am not to sure of the root cause, but for sure your XML has issues.
    The first part related to <portals>, as it contains no delta = "define" or "redefine" or "force", will be "merged" by iTop loosing all values inside tag. Why do you specify this portion?
    Same thing for <classes>, you should check if you must create a new tag in the tree or redefine an existing tag, otherwise the values inside the tags are ignored by the "merge"</classes></portals>

     
  • samrexs

    samrexs - 2024-10-21

    Thanks it very helpful.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.