Package org.openbp.core.model

Examples of org.openbp.core.model.ModelException


        {
          url = res.getURL();
        }
        catch (IOException e1)
        {
          throw new ModelException("ClassPathOperation", "Error accessing item URL '" + res.getDescription() + "'.");
        }
        String itemPath = url.toString();
        int folderIndex = itemPath.lastIndexOf(StringUtil.FOLDER_SEP_CHAR);
        int dotIndex = itemPath.lastIndexOf(".");
        if (folderIndex > 0 && dotIndex > 0)
View Full Code Here


  {
    // Add all item types in the server/config/componenttype directory
    loadItemTypeDescriptors(CoreConstants.FOLDER_COMPONENTTYPE);

    if (getItemTypeDescriptors(ItemTypeRegistry.SKIP_MODEL | ItemTypeRegistry.SKIP_INVISIBLE) == null)
      throw new ModelException("Initialization", "No standard component types present in resource location '"
        + CoreConstants.FOLDER_COMPONENTTYPE + "'");
  }
View Full Code Here

    {
      resources = resMgr.findResources(resourcePattern);
    }
    catch (ResourceMgrException e)
    {
      throw new ModelException("MissingItemTypeDescriptors", "No item type files found matching '" + resourcePattern + "'.");
    }

    if (resources.length == 0)
      throw new ModelException("MissingItemTypeDescriptors", "No item type files found matching '" + resourcePattern + "'.");

    XMLDriver driver = XMLDriver.getInstance();
    ItemTypeDescriptor itd;

    for (int i = 0; i < resources.length; i++)
    {
      // Deserialize item descriptor file
      try
      {
        itd = (ItemTypeDescriptor) driver.deserializeResource(ItemTypeDescriptor.class, resources[i]);
      }
      catch (XMLDriverException pe)
      {
        throw new ModelException("Initialization", "Error reading component type descriptor resource '" + resources[i].getDescription()
          + "': " + pe.getMessage());
      }

      // Add the item to the model
      addItemTypeDescriptor(itd);
View Full Code Here

    {
      resources = resMgr.findResources(resourcePattern);
    }
    catch (ResourceMgrException e)
    {
      throw new ModelException("MissingItemTypeDescriptors", "No item type files found matching '" + resourcePattern + "'.");
    }

    if (resources.length == 0)
      throw new ModelException("MissingItemTypeDescriptors", "No skin definitions found in resource path '" + CockpitConstants.SKIN + "'.");

    ArrayList errorMsgs = new ArrayList();
    for (int i = 0; i < resources.length; i++)
    {
      Skin skin = null;
View Full Code Here

      return getParentModelMgr().getModelByQualifier(modelQualifier);
    }

    Model model = internalGetModelByQualifier(modelQualifier);
    if (model == null)
      throw new ModelException("ObjectNotFound", "Model '" + modelQualifier + "' does not exist");
    return model;
  }
View Full Code Here

    model.setModelMgr(this);

    // Check if model already exists
    ModelQualifier qualifier = model.getQualifier();
    if (allModels.get(qualifier) != null)
      throw new ModelException("Operation", "Model '" + qualifier + "' already exists");

    addModelToStore(model);

    registerModel(model);
View Full Code Here

      currentModel.setModel(parentModel);
      currentModel.maintainReferences(ModelObject.RESOLVE_GLOBAL_REFS | ModelObject.RESOLVE_LOCAL_REFS);
    }
    catch (CloneNotSupportedException e)
    {
      throw new ModelException("Clone", "Cannot update model '" + currentModel.getQualifier() + "': " + e.getMessage());
    }

    // Save changes to the model persistence store
    saveModelToStore(currentModel);
  }
View Full Code Here

   * @throws OpenBPException On error
   */
  public Item getItemByQualifier(ModelQualifier qualifier, boolean required)
  {
    if (qualifier.getModel() == null)
      throw new ModelException("Operation", "Missing model name");
    if (qualifier.getItem() == null)
      throw new ModelException("Operation", "Missing component name");

    Model model = null;
    if (required)
    {
      model = getModelByQualifier(ModelQualifier.constructModelQualifier(qualifier.getModel()));
View Full Code Here

      currentItem.setModel(currentModel);
      currentItem.maintainReferences(ModelObject.RESOLVE_GLOBAL_REFS | ModelObject.RESOLVE_LOCAL_REFS);
    }
    catch (CloneNotSupportedException e)
    {
      throw new ModelException("Clone", "Cannot update component '" + currentItem.getQualifier() + "': " + e.getMessage());
    }

    // Save the item file
    saveItemToStore(currentItem);
View Full Code Here

    if (errMsg != null && errMsg.equals(""))
      errMsg = null;
    getMsgContainer().clearMsgs();

    if (errMsg != null)
      throw new ModelException("ModelValidationFailedAfterreload", "Model validation failed after reload:\n" + errMsg);
  }
View Full Code Here

TOP

Related Classes of org.openbp.core.model.ModelException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.