Package org.jresearch.flexess.core.model.impl

Examples of org.jresearch.flexess.core.model.impl.ModelMetaInfo


    dynamicRoleDAO.deleteRole(applicationId, roleId);
  }

  @Override
  public IDynamicRoleMetaInfo getDynamicRoleImpl(String modelId) throws ObjectNotFoundException {
    ModelMetaInfo mm = (ModelMetaInfo) modelService.getSerializedModel(modelId);
    if (mm == null) {
      throw new ObjectNotFoundException(MessageFormat.format("Model {0} is not found", modelId), modelId); //$NON-NLS-1$
    }
    DynamicRoleMetaInfo newRole = new DynamicRoleMetaInfo();
    newRole.setModelId(modelId);
View Full Code Here


    }
  }

  public void putModel(SecurityModel model, String modelString) throws ModelChangeException {
    String modelId = model.getId();
    ModelMetaInfo modelMetaInfo = (ModelMetaInfo) modelService.getSerializedModel(modelId);
    modelChanger.checkModel(model);
    if (modelMetaInfo == null) {
      modelMetaInfo = new ModelMetaInfo();
      modelMetaInfo.setId(model.getId());
      modelMetaInfo.setModel(modelString);
      modelService.addTransientModel(modelMetaInfo);
      // this is a new model, we need to create an application
      String newAppId = APPLICATION_PREFIX + model.getId();
      IApplicationMetaInfo application = applicationService.getApplication(newAppId);
      if (application == null) {
        application = applicationService.getApplicationImpl(modelMetaInfo);
        application.setName(model.getName());
        application.setId(newAppId);
      }
      // assign the first configured UMI as default if application hasn't
      // any others
      if (application.getUmiSettings() == null) {
        List<? extends ISettings> list = umiSettingsManager.getSettingsList();
        if (!list.isEmpty()) {
          application.setUmiSettings(list.get(0));
        }
      }
      try {
        application = applicationService.saveApplication(application);
      } catch (DataModelException e) {
        throw new ModelChangeException(application, "Application with such name already exists."); //$NON-NLS-1$
      }
    } else {
      modelMetaInfo.setModel(modelString);
      modelService.addTransientModel(modelMetaInfo);
    }
  }
View Full Code Here

    String secModel = modelRegistry.getOriginalModel(id);
    if (secModel == null) {
      return null;
    }
    SecurityModel model = modelRegistry.getModel(id);
    ModelMetaInfo mm = new ModelMetaInfo();
    mm.setId(id);
    mm.setModel(secModel);
    mm.setDescription(EcoreUtil.getAnnotation(model, UamPackage.eNS_URI, IPObjectConstant.DESCRIPTION_ATTR));
    return mm;
  }
View Full Code Here

TOP

Related Classes of org.jresearch.flexess.core.model.impl.ModelMetaInfo

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.