Ejemplo n.º 1
0
 public void execute() {
   Object[] paramValues = {
     user.getId(), mediaInst.getUri(), mediaInst.getMediaType(), artistInst.getUri()
   };
   WebService.getInstance()
       .runFunction(ServerParam.INTERESET_GP_URL, "delInterest", paramValues);
 }
Ejemplo n.º 2
0
 public void execute() {
   int sex = 0;
   if (user.getSex().equals("male")) sex = 1;
   Object[] paramValues = {
     user.getId(),
     user.getName(),
     sex,
     mediaInst.getUri(),
     mediaInst.getMediaType(),
     artistInst.getUri()
   };
   WebService.getInstance()
       .runFunction(ServerParam.INTERESET_GP_URL, "addInterest", paramValues);
 }
Ejemplo n.º 3
0
 public static List<UriInstance> viewFavoredArtist(User user, UriInstance mediaInst) {
   List<UriInstance> artists = new ArrayList<UriInstance>();
   Object[] paramValues = {user.getId(), mediaInst.getUri()};
   String naiveAritsts =
       WebService.getInstance()
           .runFunction(ServerParam.INTERESET_GP_URL, "getFavoredArtist", paramValues);
   if (naiveAritsts.equals(ServerParam.NETWORK_ERROR1)) return artists;
   if (naiveAritsts.length() == 0) return artists;
   List<String> naiveAritstList = SetSerialization.deserialize2(naiveAritsts);
   for (String naiveArtist : naiveAritstList) {
     List<String> naiveTermList = SetSerialization.deserialize1(naiveArtist);
     if (naiveTermList.size() == 3) {
       UriInstance inst =
           RdfFactory.getInstance()
               .createInstance(
                   naiveTermList.get(0),
                   mediaInst.getMediaType(),
                   naiveTermList.get(2),
                   SetSerialization.instNameNomalize(naiveTermList.get(1)));
       artists.add(inst);
     }
   }
   return artists;
 }