Writes a review.
11349
public function WriteReview()
    {
        //validate user input...
        $oGlobal = TGlobal::instance();
        $aUserData = array();
        if ($this->AllowWriteReview()) {
            $aUserData = $this->GetReviewWriteData();
            $oGlobal->GetuserData(TdbShopArticleReview::INPUT_BASE_NAME);
            if ($this->ValidateWriteReviewData($aUserData)) {
                $oArticle = $this->GetArticleToReview();
                $oReviewItem = $this->CreateReview($aUserData, $oArticle);
                $oArticle->UpdateStatsReviews();
                $oReviewItem->SendNewReviewNotification();
                $oMsgManager = TCMSMessageManager::GetInstance();
                $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-SUBMITTED', $aUserData);
                $this->RedirectToItemPage();
            }
        }
        $this->RedirectToItemPage(null, array(TdbShopArticleReview::INPUT_BASE_NAME => $aUserData), true);
    }
158589
private void submitWriteTask(String action,
                                 String spaceId,
                                 String contentId,
                                 String contentChecksum,
                                 String contentMimetype,
                                 String contentSize,
                                 Map<String, String> contentProperties,
                                 String spaceACLs,
                                 String sourceSpaceId,
                                 String sourceContentId) {
        AuditTask task = new AuditTask();
        task.setAction(action);
        task.setUserId(getUserId());
        task.setDateTime(String.valueOf(System.currentTimeMillis()));
        task.setAccount(account);
        task.setStoreId(storeId);
        task.setStoreType(storeType);
        task.setSpaceId(spaceId);
        task.setSpaceACLs(spaceACLs);
        task.setContentId(contentId);
        task.setContentChecksum(contentChecksum);
        task.setContentMimetype(contentMimetype);
        task.setContentSize(contentSize);
        task.setContentProperties(contentProperties);
        task.setSourceSpaceId(sourceSpaceId);
        task.setSourceContentId(sourceContentId);

        Task writeTask = task.writeTask();
        taskQueue.put(writeTask);
        writeLogger.log(writeTask);
    }
473188
public function submit(Bookboon $bookboon, string $bookId) : void
    {
        if (Entity::isValidUUID($bookId)) {
            $bookboon->rawRequest("/books/$bookId/review", $this->getData(), ClientInterface::HTTP_POST);
        }
    }
414277
public function listReview()
    {
        $this->actionListReview();
        $this->setTitleListReview();
        $this->setBreadcrumbListReview();
        $this->setFilterListReview();
        $this->setPagerListReview();

        $this->setData('reviews', $this->getListReview());

        $this->outputListReview();
    }
1145789
void writeJavadocComment(String methodComment, Writer writer) throws IOException {
		// From javadoc
		if (methodComment != null) {
			methodComment = methodComment.split("@")[0];
			int lastIndexOf = methodComment.lastIndexOf("\n");
			if (lastIndexOf >= 0) {
				methodComment = methodComment.substring(0, lastIndexOf);
			}
			String comment = methodComment.replaceAll("\n", CR+TAB2+" *");
			writer.append(TAB2).append(" *").append(comment).append(CR);
		}
	}
828130
protected function updateReview($review_id)
    {
        if (!$this->isError() && !$this->review->update($review_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1007350
private void submitRevisions(final RevisionList changes) {
        int remaining = changes.size();
        int size = batcher.getCapacity();
        int start = 0;
        while (remaining > 0) {
            if (size > remaining)
                size = remaining;
            RevisionList subChanges = new RevisionList(changes.subList(start, start + size));
            batcher.queueObjects(subChanges);
            start += size;
            remaining -= size;
            pauseOrResume();
            waitIfPaused();
            // if not running state anymore, exit from loop.
            if (!isRunning())
                break;
        }
    }
613607
def do_write(self, msg):
        """"""
        self.stream = self.do_open()
        stream = self.stream
        stream.write(msg)
        if self.terminator:
            stream.write(self.terminator)
        stream.flush()
        self._close()
        return
1061751
public function onAfterWrite()
    {
        parent::onAfterWrite();

        foreach ($this->Categories() as $category) {
            /**
             * @var BlogCategory $category
             */
            $category->BlogID = $this->ParentID;
            $category->write();
        }

        foreach ($this->Tags() as $tag) {
            /**
             * @var BlogTag $tag
             */
            $tag->BlogID = $this->ParentID;
            $tag->write();
        }
    }
413972
def write(self, data):
        """"""
        self.request(
            url="write",
            method='POST',
            params=None,
            data=data,
            expected_response_code=200
        )
        return True
25857
public void postComment(int id, int rating, String comment) {
        ClientResource resource = new ClientResource(Route.ADD_COMMENT.url(id));
        resource.setChallengeResponse(this.auth.toChallenge());

        Form form = new Form();
        if (id > 0)
            form.add("rating", String.valueOf(rating));
        if (comment != null && comment.length() > 0)
            form.add("comment", comment);

        resource.post(form);
    }
4901
function addRating(rating, config, conn) {

  // validate
  if (!rating.uri || rating.uri === '') {
    return 'You must enter a valid uri'
  }
  if (!rating.reviewer || rating.reviewer === '') {
    return 'You must enter a valid reviewer'
  }
  if (isNaN(rating.rating)) {
    return 'You must enter a valid rating'
  }

  // defaults
  config = config || require('../config/config.js')

  debug(rating)

  // main
  return new Promise((resolve, reject) => {

    if (!conn) {
      var conn = wc_db.getConnection(config.db)
    }

    insertRating(rating, config, conn).then(function(ret) {
      return resolve({"ret": ret, "conn": conn})
    }).catch(function(err) {
      debug('addRating', 'updating instead of insert')
      return updateRating(rating, config, conn)
    }).then(function(ret){
      return resolve({"ret": ret, "conn": conn})
    }).catch(function(){
      return reject({"ret": ret, "conn": conn})
    })


  })

}
957487
function writePrompt () {
        charm.position(1,1);
        charm.display('bright');
        charm.write(promptStart);
        charm.write(' ');
        charm.display('reset');
    }
398836
protected function addReview()
    {
        $this->controlAccess('review_add');

        if ($this->review->add($this->getSubmitted())) {
            $this->redirect('admin/content/review', $this->text('Review has been added'), 'success');
        }

        $this->redirect('', $this->text('Review has not been added'), 'warning');
    }
639623
def output(review)
      unless review.respond_to?(:warnings)
        puts review; return
      end

      context = 3

      print_fn = lambda { |fn| ansi_print(fn, :red, nil, :bold) }
      print_rule = lambda { |warn| ansi_print(warn, :cyan, nil, :bold) }
      print_line = lambda { |line| ansi_print(line, nil, :red, :bold) }

      key_by_file_and_line(review).each do |fn, warnings|
        print_fn.call fn
        unless File.exist?(fn)
          print_rule.call warnings[1].to_a.join("\n")
          next
        end

        # Set of line numbers with warnings
        warn_lines = warnings.keys.to_set
        # Moving set of line numbers within the context of our position
        context_set = (0..context).to_set
        # The last line number we printed a warning for
        last_warn = -1

        File.open(fn) do |file|
          file.each do |line|
            context_set.add(file.lineno + context)
            context_set.delete(file.lineno - context - 1)

            # Find the first warning within our context
            context_warns = context_set & warn_lines
            next_warn = context_warns.min
            # We may need to interrupt the trailing context
            # of a previous warning
            next_warn = file.lineno if warn_lines.include? file.lineno

            # Display a warning
            if next_warn && next_warn > last_warn
              print_rule.call warnings[next_warn].to_a.join("\n")
              last_warn = next_warn
            end

            # Display any relevant lines
            if warn_lines.include? file.lineno
              print "%4i|" % file.lineno
              print_line.call line.chomp
            elsif not context_warns.empty?
              print "%4i|" % file.lineno
              puts line.chomp
            end
          end
        end
      end
    end
255872
private static IReview createReviewFromActivity(JSONObject activity) throws JSONException{
		Review review = new Review();
		review.setComment(activity.getString("content"));
		return review;
	}
140383
def reviewed_badge(user, talk):
    """"""
    context = {
        'reviewed': False,
    }

    review = None
    if user and not user.is_anonymous():
        review = talk.reviews.filter(reviewer=user).first()

    if review:
        context['reviewed'] = True
        context['review_is_current'] = review.is_current()

    return context