コード例 #1
0
ファイル: HierarchyDAO.java プロジェクト: furion-np/TrackiT
  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);
  }
コード例 #2
0
ファイル: HierarchyDAO.java プロジェクト: furion-np/TrackiT
  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);
  }