Package org.openqreg.bean

Examples of org.openqreg.bean.CentreKey


      // we must have a relation to the user to read it (on any centre)
      if (UserRelation.hasUserRelationToUserToEditOnAnyCentre(con, user,
          userToEdit)) {
        fetch.addMapReplaceExistingValues(userToEdit.getTreeMap());
        fetch.addValue(((CentreBean) CentreFinderBase.findByPrimaryKey(
            con, new CentreKey(userToEdit.getCentreid())))
            .getCountryid(), "USER_COUNTRYID");

        if (userGroups.get(userToEdit.getGroupid()).getUseucr()
            .intValue() == 1) {
          // userToEdit is an Ucr-User
View Full Code Here


  public void testGetCentreString(){
    String centreid = "TESTSE";
    Centre c1 = dispatcher.getCentre(centreid);
   
    try {
      Centre c2 = (Centre)CentreFinderBase.findByPrimaryKey(new CentreKey(centreid));
      assertEquals("Centreid should be the same", c1, c2);
    } catch (SQLException e) {
      fail("Database exception: "+ e.getMessage());
    }
   
View Full Code Here

       * must be on the same centre as before<br/>
       * OR have ADMINMYSELF_CENTREID AND be in the same country<br/>
       * OR must have ADMINMYSELF_COUNTRYID
       */
      CentreBean oldCentre = (CentreBean) CentreFinderBase
          .findByPrimaryKey(con, new CentreKey(user.getCentreid()));
      CentreBean newCentre = (CentreBean) CentreFinderBase
          .findByPrimaryKey(con, new CentreKey(myself.getCentreid()));

      if (oldCentre.getId().equals(newCentre.getId())
          || (disp.checkAccess(user.getId(), "ADMINMYSELF_CENTREID") && oldCentre
              .getCountryid().equals(newCentre.getCountryid()))
          || disp.checkAccess(user.getId(), "ADMINMYSELF_COUNTRYID")) {
View Full Code Here

    if (null != myself) {
      fetch.addMapReplaceExistingValues(Converter.changeKeyPrefix(myself
          .getTreeMap(), "USER_", "MYSELF_"));
      try {
        fetch.addValue(((CentreBean) CentreFinderBase.findByPrimaryKey(
            con, new CentreKey(myself.getCentreid())))
            .getCountryid(), "MYSELF_COUNTRYID");
        for (String key : myself.getAttributes().keySet()) {
          fetch.addValue(myself.getAttribute(key),
              (attributeprefix + key).toUpperCase());
        }
View Full Code Here

   *
   * @see org.openqreg.tag.AbstractStepHandlerTag#populateKeysAndBeans()
   */
  @Override
  protected void populateKeysAndBeans(Connection con) throws SQLException {
    centreBean = (CentreBean) CentreFinderBase.findByPrimaryKey(con, new CentreKey(centreid));
   
    if(centreBean == null){
      centreBean = disp.createCentre();
    }
  }
View Full Code Here

        .indexOf("</id>"));

    CentreBean centreBean = null;
    try {
      centreBean = (CentreBean) CentreFinderBase
          .findByPrimaryKey(new CentreKey(centreId));

      // write out about mainPic
      res.getWriter().write("<centre>\n");
      res.getWriter().write(centreBean.toString());
      res.getWriter().write("<id>");
View Full Code Here

TOP

Related Classes of org.openqreg.bean.CentreKey

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.