Exemple #1
0
void AOSAdminCommand_modify::_process(AOSAdminCommandContext& context)
{
  AString objectName;
  if (!context.useRequestHeader().useUrl().useParameterPairs().get(ASW("object",6), objectName))
  {
    context.useModel().useRoot().addElement(ASW("error",5), ASW("Please specify which 'object=' to modify",40));
  }
  else
  {
    //a_Display object specific list
    AOSAdminInterface *pAdminObject = m_Services.useAdminRegistry().getAdminObject(objectName);
    
    //a_Add methods if any
    if (pAdminObject)
    {
      AXmlElement& eObject = context.useModel().useRoot().addElement(ASW("object",6)).addAttribute(ASW("name",4), objectName);
      pAdminObject->adminProcessAction(eObject, context.useRequestHeader());
      pAdminObject->adminEmitXml(eObject, context.useRequestHeader());
    }
    else
    {
      context.useModel().useRoot().addElement(ASW("error",5), ASW("Unknown object",14));
    }
  }
}
Exemple #2
0
void AOSAdminCommand_list::_process(AOSAdminCommandContext& context)
{
  //a_Display list of objects
  LIST_AString objectNames;
  m_Services.useAdminRegistry().listAdminObjects(objectNames);

  LIST_AString::iterator it = objectNames.begin();
  while (it != objectNames.end())
  {
    AXmlElement& e = context.useModel().useRoot().addElement(ASW("object",6));
    e.addAttribute(ASW("name",4), *it);

    ++it;
  }
}
Exemple #3
0
void AOSAdminCommand_display::_insertStylesheet(AOSAdminCommandContext& context)
{
  AString stylesheet("/xsl/_command/display",21);
  AString objectName;
  if (context.useRequestHeader().useUrl().useParameterPairs().get("object", objectName))
  {
    stylesheet.append('_');
    stylesheet.append(objectName);
  }
  stylesheet.append(".xsl",4);

  AFilename fn(m_Services.useConfiguration().getAdminBaseHttpDir(), stylesheet, false);
  if (!AFileSystem::exists(fn))
  {
    //a_Fallback on default
    stylesheet.assign("/xsl/_command/display.xsl",25);
  }

  context.useModel().addInstruction(AXmlInstruction::XML_STYLESHEET)
    .addAttribute(ASW("type",4), ASW("text/xsl",8))
    .addAttribute(ASW("href",4), stylesheet);
}
Exemple #4
0
void AOSAdminCommand_list::_insertStylesheet(AOSAdminCommandContext& context)
{
  context.useModel().addInstruction(AXmlInstruction::XML_STYLESHEET)
    .addAttribute(ASW("type",4), ASW("text/xsl",8))
    .addAttribute(ASW("href",4), ASW("/xsl/_command/list.xsl",22));
}