Exemplo n.º 1
0
 public static String removeCategory(Connection conn, String marketId, String catKey)
     throws SQLException {
   String catValue =
       CategoryFactory.getValueforCategoryKey(
           CategoryFactory.getCategories(conn, marketId), catKey);
   CategoryFactory.removeCategory(conn, marketId, catKey);
   String res = XMLFactory.getMessageElement("marketid", marketId);
   res += XMLFactory.getMessageElement("catkey", catKey);
   res += XMLFactory.getMessageElement("catvalue", catValue);
   return res;
 }
Exemplo n.º 2
0
  public static String addCategory(Connection conn, String marketId, String catKey, String catValue)
      throws SQLException {
    Category category = new Category();
    category.marketId = marketId;
    category.categoryKey = catKey;
    category.categoryValue = catValue;
    try {
      CategoryFactory.save(conn, category);
    } catch (MySQLIntegrityConstraintViolationException e) {
      return "<errmsg>Category already in the list.</errmsg>";
    }

    String res = XMLFactory.getMessageElement("marketid", marketId);
    res += XMLFactory.getMessageElement("catkey", catKey);
    res += XMLFactory.getMessageElement("catvalue", catValue);
    return res;
  }
Exemplo n.º 3
0
 public static String updateStyle(Connection conn, Style style) throws SQLException {
   StyleFactory.remove(conn, style.marketId);
   StyleFactory.save(conn, style);
   return (XMLFactory.getMessageElement("message", "Style updated successfully"));
 }