Example #1
0
  private ReleaseIncludesWs2 getDefaultReleaseInclude(AreaIncludesWs2 areainc) {

    ReleaseIncludesWs2 inc = new ReleaseIncludesWs2();

    inc.setArtistCredits(true);
    inc.setLabel(false);
    inc.setMedia(false);
    inc.setReleaseGroups(true);
    inc.setRecordings(false);

    inc.setUrlRelations(false);
    inc.setLabelRelations(false);
    inc.setArtistRelations(false);
    inc.setReleaseGroupRelations(false);
    inc.setReleaseRelations(false);
    inc.setRecordingRelations(false);
    inc.setWorkRelations(false);

    inc.setAreaRelations(false);
    inc.setPlaceRelations(false);
    inc.setInstrumentRelations(false);
    inc.setSeriesRelations(false);

    if (areainc == null) return inc;

    if (areainc.isDiscids()) inc.setDiscids(true);
    // if (areainc.isRecordingLevelRelations()) inc.setRecordingLevelRelations(true);
    // if (areainc.isWorkLevelRelations()) inc.setWorkLevelRelations(true);

    return inc;
  }
Example #2
0
  protected AreaIncludesWs2 getIncrementalInc(AreaIncludesWs2 inc) {

    inc = (AreaIncludesWs2) super.getIncrementalInc(inc);
    if (getIncludes().isAliases() && !getIncluded().isAliases()) inc.setAliases(true);

    // if (getIncludes().isArtists() && !getIncluded().isArtists()) inc.setArtists(true);
    // if (getIncludes().isLabels() && !getIncluded().isLabels()) inc.setLabels(true);
    //  if (getIncludes().isReleases() && !getIncluded().isReleases()) inc.setReleases(true);
    //  if (getIncludes().isPlaces() && !getIncluded().isPlaces()) inc.setPlaces(true);

    return inc;
  }
Example #3
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();
  }
Example #4
0
  private boolean needsLookUp(AreaIncludesWs2 inc) {

    return (getArea() == null || super.needsLookUp(inc) || inc.isAliases());
  }
Example #5
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;
  }