Examples of ModelInstance


Examples of com.adaptrex.core.ext.ModelInstance

    try {
      ObjectContext objectContext = getObjectContext();
      Class<?> clazz = extConfig.getEntityClass();
      Object entity = objectContext.newObject(clazz);
      this.updateEntity(objectContext, clazz, entity, data);
      return new ModelInstance(extConfig, entity);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of com.adaptrex.core.ext.ModelInstance

    Class<?> clazz = extConfig.getEntityClass();
    Object entity = id != null
        ? this.getEntity(objectContext, clazz, id)
        : this.getEntity(objectContext, clazz, key, value);
    this.updateEntity(objectContext, clazz, entity, data);
    return new ModelInstance(extConfig, entity);
  }
View Full Code Here

Examples of com.adaptrex.core.ext.data.ModelInstance

   
    /*
     * We need to do some formatting on the response
     */
    Map<String,Object> response = new HashMap<String,Object>();
    ModelInstance modelInstance = model.getModelInstance();
   
    response.put("data", modelInstance.getData());
    response.put("id", modelInstance.getData().get("id"))// TODO: We should have a way to get id's named other than "id"
    response.put("success", true);
   
    printStream.print(StringUtilities.json(response));
    printStream.close();
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.g3d.ModelInstance

      ModelBuilder builder = new ModelBuilder();
      Model   xyzModel = builder.createXYZCoordinates(10, new Material(), Usage.Position|Usage.ColorPacked),
        planeModel = builder.createLineGrid(10, 10, 1, 1, new Material(ColorAttribute.createDiffuse(Color.WHITE)), Usage.Position);
      models.add(xyzModel);
      models.add(planeModel);
      xyzInstance = new ModelInstance(xyzModel);
      xzPlaneInstance = new ModelInstance(planeModel);
      xyPlaneInstance = new ModelInstance(planeModel);
      xyPlaneInstance.transform.rotate(1f, 0f, 0f, 90f);

      setDrawXYZ(true);
      setDrawXZPlane(true);
View Full Code Here

Examples of it.eng.spagobi.kpi.model.bo.ModelInstance

    return toReturn;
  }
  public OrganizationalUnitGrant toOrganizationalUnitGrant(
      SbiOrgUnitGrant hibGrant, Session aSession) {
    OrganizationalUnitHierarchy hierarchy = toOrganizationalUnitHierarchy(hibGrant.getSbiOrgUnitHierarchies());
    ModelInstance modelInstance = ModelInstanceDAOImpl.toModelInstanceWithoutChildren(hibGrant.getSbiKpiModelInst(), aSession);
    OrganizationalUnitGrant grant = new OrganizationalUnitGrant(hibGrant.getId(), hibGrant.getIsAvailable(), modelInstance,
        hierarchy, hibGrant.getStartDate(), hibGrant.getEndDate(), hibGrant.getLabel(),
        hibGrant.getName(), hibGrant.getDescription());
    return grant;
  }
View Full Code Here

Examples of it.eng.spagobi.kpi.model.bo.ModelInstance

      List sbiKpiModelInstanceList = crit.list();
      for (Iterator iterator = sbiKpiModelInstanceList.iterator(); iterator
      .hasNext();) {
        SbiKpiModelInst sbiKpiModelInst = (SbiKpiModelInst) iterator
        .next();
        ModelInstance aModelInst = toModelInstanceWithoutChildren(
            sbiKpiModelInst, aSession);
        toReturn.add(aModelInst);
      }
    } catch (HibernateException he) {
      logException(he);
View Full Code Here

Examples of it.eng.spagobi.kpi.model.bo.ModelInstance

  }

  public static ModelInstance toModelInstanceWithoutChildren(SbiKpiModelInst value,
      Session aSession) {
    logger.debug("IN");
    ModelInstance toReturn = new ModelInstance();

    String name = value.getName();
    String description = value.getDescription();
    String label = value.getLabel();
    Date startDate = value.getStartDate();
    Date endDate = value.getEndDate();
    Integer id = value.getKpiModelInst();
    SbiKpiModel sbiKpiModel = value.getSbiKpiModel();
    String modelUUID = value.getModelUUID();

    // insert Parent
    if (value.getSbiKpiModelInst() != null) {
      toReturn.setParentId(value.getSbiKpiModelInst().getKpiModelInst());
    }

    // load with Dao to get also domains
    try {
      SbiKpiModel sbiKpiModel2 = null;
      IModelDAO modelDao = (IModelDAO) DAOFactory.getModelDAO();
      Integer modelId = sbiKpiModel.getKpiModelId();
      // sbiKpiModel2=modelDao.l(modelId);

    } catch (EMFUserError e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    Model aModel = ModelDAOImpl.toModelWithoutChildren(sbiKpiModel,
        aSession);
    SbiKpiInstance sbiKpiInstance = value.getSbiKpiInstance();

    if (sbiKpiInstance != null) {
      // toKpiInstance
      KpiInstance aKpiInstance = new KpiInstance();
      aKpiInstance.setKpiInstanceId(sbiKpiInstance.getIdKpiInstance());
      aKpiInstance.setKpi(sbiKpiInstance.getSbiKpi().getKpiId());
      if (sbiKpiInstance.getSbiThreshold() != null) {
        aKpiInstance.setThresholdId(sbiKpiInstance.getSbiThreshold()
            .getThresholdId());
      }
      if (sbiKpiInstance.getChartType() != null) {
        aKpiInstance.setChartTypeId(sbiKpiInstance.getChartType()
            .getValueId());
      }
      // TODO
      if (sbiKpiInstance.getSbiKpiInstPeriods() != null
          && !(sbiKpiInstance.getSbiKpiInstPeriods().isEmpty())) {
        SbiKpiInstPeriod instPeriod = (SbiKpiInstPeriod) sbiKpiInstance
        .getSbiKpiInstPeriods().toArray()[0];

        aKpiInstance.setPeriodicityId(instPeriod.getSbiKpiPeriodicity()
            .getIdKpiPeriodicity());
      } //
      aKpiInstance.setWeight(sbiKpiInstance.getWeight());
      aKpiInstance.setTarget(sbiKpiInstance.getTarget());
      aKpiInstance.setD(sbiKpiInstance.getBeginDt());
      //
      toReturn.setKpiInstance(aKpiInstance);
    }

    toReturn.setId(id);
    toReturn.setName(name);
    toReturn.setDescription(description);
    toReturn.setLabel(label);
    toReturn.setStartDate(startDate);
    toReturn.setEndDate(endDate);
    toReturn.setModel(aModel);
    toReturn.setModelUUID(modelUUID);

    logger.debug("OUT");
    return toReturn;
  }
View Full Code Here

Examples of it.eng.spagobi.kpi.model.bo.ModelInstance

  }

  public ModelInstance loadModelInstanceWithoutChildrenById(Integer id)
  throws EMFUserError {
    logger.debug("IN");
    ModelInstance toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

Examples of it.eng.spagobi.kpi.model.bo.ModelInstance

  }

  public ModelInstance loadModelInstanceWithoutChildrenByLabel(String label)
  throws EMFUserError {
    logger.debug("IN");
    ModelInstance toReturn = null;
    Session aSession = null;
    Transaction tx = null;

    try {
      aSession = getSession();
View Full Code Here

Examples of it.eng.spagobi.kpi.model.bo.ModelInstance

  public ModelInstance loadModelInstanceWithChildrenById(Integer id)
  throws EMFUserError {
    logger.debug("IN");
    Session aSession = null;
    Transaction tx = null;
    ModelInstance toReturn = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiKpiModelInst hibSbiKpiModelInst = (SbiKpiModelInst) aSession
      .load(SbiKpiModelInst.class, id);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.