Esempio n. 1
0
  @Override
  protected AreaIncludesWs2 getDefaultIncludes() {

    AreaIncludesWs2 inc = new AreaIncludesWs2();

    inc.setUrlRelations(true);
    inc.setLabelRelations(true);
    inc.setArtistRelations(true);
    inc.setReleaseGroupRelations(true);
    inc.setReleaseRelations(true);
    inc.setRecordingRelations(true);
    inc.setWorkRelations(false);
    inc.setAreaRelations(true);
    inc.setPlaceRelations(true);
    inc.setInstrumentRelations(true);
    inc.setSeriesRelations(true);

    inc.setTags(false);
    inc.setRatings(false);
    inc.setUserTags(false);
    inc.setUserRatings(false);

    inc.setAnnotation(true);
    inc.setAliases(false);
    inc.setArtists(false);
    inc.setLabels(false);
    inc.setReleases(false);
    inc.setPlaces(false);

    inc.setArtistCredits(false);
    inc.setDiscids(false);
    inc.setIsrcs(false);
    inc.setMedia(false);
    inc.setPuids(false);

    return inc;
  }
Esempio n. 2
0
  public AreaWs2 lookUp(String id) throws MBWS2Exception {

    AreaIncludesWs2 inc = getIncrementalInc(new AreaIncludesWs2());

    // LookUp is limited by 25 linked entities, to be sure
    // is better perform a Browse (you could also get first 25
    // at lookUp time just hiitting areaInclude.setReleases(true),
    // check if there could be  more releases left and in case perform
    // the Browse... worry about sort order...).

    inc.setArtists(false); // handled via a browse.
    inc.setLabels(false); // handled via a browse.
    inc.setReleases(false); // handled via a browse.
    inc.setPlaces(false); // handled via a browse.

    // the following inc params are meaningless if not inc.isRelease() or
    // inc.isRecordings().

    inc.setMedia(false);
    inc.setDiscids(false);
    inc.setIsrcs(false);
    inc.setPuids(false);

    // Sanity check.
    // if(inc.isArtistCredits()) inc.setReleases(true); // to avoid the artist credits exceptions.

    inc.setArtistCredits(false); // invalid request

    inc.setRecordingLevelRelations(false); // invalid request
    inc.setWorkLevelRelations(false); // invalid request

    if (needsLookUp(inc)) {
      setLookUp(new LookUpWs2(getQueryWs()));

      AreaWs2 transit = null;
      transit = getLookUp().getAreaById(id, inc);

      if (transit == null) return null;

      if (getArea() == null || !getArea().equals(transit)) // area is changed.
      {
        setEntity(transit);
        setIncluded(inc);

        artistBrowse = null;
        labelBrowse = null;
        releaseBrowse = null;
        placeBrowse = null;

      } else {
        updateEntity(getArea(), transit, inc);
        if (inc.isAliases()) {
          getArea().setAliases(transit.getAliases());
          getIncluded().setAliases(true);
        }
      }
    }
    if (inc.isAnnotation()) loadAnnotation(getArea());

    initBrowses();

    return getArea();
  }