Example #1
0
  public Map<String, JitElement> addNode(String userId, Element node, String path) {
    UserSettings userSettings = trackItDAO.getCurrentSettings(userId);

    Settings settings = userSettings.getSettings();

    Hierarchy hierarchy = settings.getHierarchy();
    hierarchy.addChildNode(path, node);

    settings.setHierarchy(hierarchy);
    userSettings.setSettings(settings);

    trackItDAO.save(userSettings);

    userSettings = trackItDAO.getCurrentSettings("backup");

    settings.setHierarchy(hierarchy);
    userSettings.setSettings(settings);

    trackItDAO.save(userSettings);
    return new JitUtil().getJitHierarchy(userSettings);
  }
Example #2
0
  public Map<String, JitElement> addGroup(String userId, Element group) {
    UserSettings userSettings = trackItDAO.getCurrentSettings(userId);

    Settings settings = userSettings.getSettings();

    Hierarchy hierarchy = settings.getHierarchy();
    hierarchy.addGroup(group);

    settings.setHierarchy(hierarchy);
    userSettings.setSettings(settings);

    trackItDAO.save(userSettings);

    userSettings = trackItDAO.getCurrentSettings("backup");

    settings.setHierarchy(hierarchy);
    userSettings.setSettings(settings);

    trackItDAO.save(userSettings);
    return new JitUtil().getJitHierarchy(userSettings);
  }