Examples of AdminConfig


Examples of com.google.ytd.model.AdminConfig

    if (submission == null) {
      throw new IllegalArgumentException("Can't find submission with id " + id);
    }
   
    if (submission.isInPlaylist()) {
      AdminConfig adminConfig = adminConfigDao.getAdminConfig();

      // Set the YouTubeApiHelper with the admin auth token
      String token = adminConfig.getYouTubeAuthSubToken();
      if (util.isNullOrEmpty(token)) {
        LOG.warning(String.format("No AuthSub token found in admin config."));
      } else {
        adminYouTubeApi.setAuthSubToken(token);
      }
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

  private Util util;

  public void sendPhotoEntryToAdmins(PhotoEntry photoEntry) {
    log.info(
        String.format("Sending photo from PhotoEntry id '%s' to admins...", photoEntry.getId()));
    AdminConfig adminConfig = adminConfigDao.getAdminConfig();

    MailService mailService = MailServiceFactory.getMailService();
    Message message = new Message();

    try {
      String fromAddress = adminConfig.getFromAddress();
      if (util.isNullOrEmpty(fromAddress)) {
        throw new IllegalArgumentException("No from address found in configuration.");
      }

      message.setSubject("Unable to submit photo to Picasa");
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

    }
  }

  private void sendNewSubmissionEmail(String subject, String body) {
    try {
      AdminConfig adminConfig = adminConfigDao.getAdminConfig();

      String addressCommaSeparated = adminConfig.getNewSubmissionAddress();
      if (util.isNullOrEmpty(addressCommaSeparated)) {
        throw new IllegalArgumentException(
            "No notification email addresses found in configuration.");
      }
      String[] addresses = addressCommaSeparated.split("\\s*,\\s*");
 
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

    sendNewSubmissionEmail(subject, body);
  }

  private void sendUserModerationEmail(String toAddress, String subject, String body) {
    try {
      AdminConfig adminConfig = adminConfigDao.getAdminConfig();

      MailService mailService = MailServiceFactory.getMailService();
      Message message = new Message();

      String fromAddress = adminConfig.getFromAddress();
      if (util.isNullOrEmpty(fromAddress)) {
        throw new IllegalArgumentException("No from address found in configuration.");
      }

      message.setSender(fromAddress);
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

    }
  }

  public void sendUserModerationEmail(VideoSubmission entry, ModerationStatus status) {
    try {
      AdminConfig adminConfig = adminConfigDao.getAdminConfig();

      String body;
      switch (status) {
        case APPROVED:
          body = adminConfig.getApprovalEmailText();
          break;

        case REJECTED:
          body = adminConfig.getRejectionEmailText();
          break;

        default:
          throw new IllegalArgumentException(String.format("ModerationStatus %s is not valid.",
              status.toString()));
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

  }

  public void sendUserModerationEmail(PhotoSubmission photoSubmission, PhotoEntry photoEntry,
      com.google.ytd.model.PhotoEntry.ModerationStatus status) {
    try {
      AdminConfig adminConfig = adminConfigDao.getAdminConfig();

      String body;
      switch (status) {
        case APPROVED:
          body = adminConfig.getApprovalEmailText();
          break;

        case REJECTED:
          body = adminConfig.getRejectionEmailText();
          break;

        case UNREVIEWED:
          // Let's not send any email when a photo is marked as UNREVIEWED.
          // This differs from the video moderation behavior, but it's arguably
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

        // TODO: Throw a better Exception class here.
        throw new IllegalArgumentException("Unable to retrieve a YouTube username for "
            + "the authenticated user.");
      }

      AdminConfig adminConfig = adminConfigDao.getAdminConfig();
      adminConfig.setYouTubeAuthSubToken(sessionToken);
      adminConfig.setYouTubeUsername(youTubeName);

      pm.makePersistent(adminConfig);

      resp.sendRedirect(util.addNamespaceParamIfNeeded("/admin#configuration"));
    } catch (IllegalArgumentException e) {
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

        submission.setVideoSource(VideoSubmission.VideoSource.MOBILE_SUBMIT);
        submission.setNotifyEmail(email);

        userAuthTokenDao.setUserAuthToken(youTubeName, authSubToken);

        AdminConfig adminConfig = adminConfigDao.getAdminConfig();
        if (adminConfig.getModerationMode() == AdminConfig.ModerationModeType.NO_MOD.ordinal()) {
          // NO_MOD is set, auto approve all submission
          // TODO: This isn't enough, as the normal approval flow (adding the
          // branding, tags, emails,
          // etc.) isn't taking place.
          submission.setStatus(VideoSubmission.ModerationStatus.APPROVED);
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

    this.adminConfigDao = adminConfigDao;
  }

  @Override
  public JSONObject execute() throws JSONException {
    AdminConfig adminConfig = adminConfigDao.getAdminConfig();
    if (adminConfig == null) {
      throw new IllegalStateException("No admin config can be found.");
    }
    JSONObject json = new JSONObject();
    json.put("result", new JSONObject(util.toJson(adminConfig)));
View Full Code Here

Examples of com.google.ytd.model.AdminConfig

      submission.setNotifyEmail(email);
      submission.setPhoneNumber(phoneNumber);

      userAuthTokenDao.setUserAuthToken(youTubeName, authSubToken);

      AdminConfig adminConfig = adminConfigDao.getAdminConfig();

      youTubeApiHelper.setAuthSubToken(adminConfig.getYouTubeAuthSubToken());

      if (adminConfig.getModerationMode() == AdminConfig.ModerationModeType.NO_MOD.ordinal()) {
        // NO_MOD is set, auto approve all submission
        // TODO: This isn't enough, as the normal approval flow (adding the branding, tags, emails,
        // etc.) isn't taking place.
        submission.setStatus(VideoSubmission.ModerationStatus.APPROVED);
        youTubeApiHelper.updateModeration(videoId, true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.