Главная > OA Framework, Oracle e-Business Suite > OAF: Вывести список VO и значения атрибутов


OAF: Вывести список VO и значения атрибутов

Вывести все View Objects (VO) и значения атрибутов для OAApplicationModule

    // Вывод всех значений VO
    public void printALLVO(OAApplicationModule am)
    {
      OADBTransaction tr = am.getOADBTransaction();
      if(tr.isLoggingEnabled(1)) 
      {
        tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " ",1);
        tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " AM "+am.getName(), 1);
      }
      String[] rootViewNames = am.getViewObjectNames();
      if(tr.isLoggingEnabled(1)) 
      {  
        tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " count of VOs from AM = " +rootViewNames.length,1 );
      }
      for (int j =0 ;j < rootViewNames.length ;j++ )
      {
        if(tr.isLoggingEnabled(1)) 
        {  
          tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " ",1);
          tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", "================",1);
          tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " VO "+rootViewNames[j],1 );
        }
     
        oracle.jbo.ViewObject lVO = (oracle.jbo.ViewObject)am.findViewObject(rootViewNames[j]);
        if (lVO!=null && lVO.isExecuted()) {
          oracle.jbo.server.ViewRowImpl lVORow;
          int numRow = 1;
          for(lVORow = (oracle.jbo.server.ViewRowImpl)lVO.first(); lVORow != null;
              lVORow = (oracle.jbo.server.ViewRowImpl)lVO.next())
          {
              if (lVORow!=null) {
                  int attrCount = lVORow.getAttributeCount();
                  if(tr.isLoggingEnabled(1)) 
                  {              
                    tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " ",1);
                    tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " [row "+numRow+"]",1);
                    tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " count of attributes = "+attrCount,1);
                  }
     
                  String[] attributeNames = lVORow.getAttributeNames();
                  for (int i = 0 ;i< attributeNames.length ;i++ )
                  {
                    if(tr.isLoggingEnabled(1)) 
                    {              
                      tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", attributeNames[i]
                      +" = "
                      +lVORow.getAttribute(i),1);
                    }
                  }
              }
              numRow ++;
          }
          if (numRow==1) {
            if(tr.isLoggingEnabled(1)) 
            {          
              tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " not exists rows",1);
            }
          }
        }
        else {
          if(tr.isLoggingEnabled(1)) 
          {                
            tr.writeDiagnostics(this.getClass().getName() + ".printALLVO XX", " not executed",1);
          }
        }
      }              
     
    }

Цикл по вложенным Application Modules (текущий AM не входит во вложенные AM)

String nestedAMArray[]=oapagecontext.getRootApplicationModule().getApplicationModuleNames();
for(int i = 0; i < nestedAMArray.length; i++)
{
    String amName = nestedAMArray[i];
    OAApplicationModule amIter = (OAApplicationModule)am.findApplicationModule(amName);
    oapagecontext.writeDiagnostics(this,"Nested AM Name=>"+amName,1);
}    

Похожие записи:

  1. Пока что нет комментариев.
  1. Пока что нет уведомлений.