Write page to disk.

@param pageID page id
@param page the page which has to be written to disk
545981
@Override
  public void writePage(int pageID, P page) {
    if (page.isDirty()) {
      try {
        countWrite();
        byte[] array = pageToByteArray(page);
        file.getRecordBuffer(pageID).put(array);
        page.setDirty(false);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
162936
@Override
	public void seekPageForWrite(PAGE_TYPE type, int pageId) {
		//isAutoPaging = false;
		writeData();
		isWriting = true;
		currentPage = pageId;
		buf.clear();
		currentDataType = type;
		if (type != PAGE_TYPE.DB_HEADER) {
			writeHeader();
		}
	}
585283
public void writeEndPage() throws IOException {
		writer.openElement("document");
		writer.textElement("id", Integer.toString(_page.Id));
		writer.textElement("group", "0");
		writer.textElement("timestamp", formatTimestamp(_rev.Timestamp));
		writer.textElement("title", _page.Title.toString());
		writer.textElement("body", _rev.Text);
		writer.closeElement();
		_rev = null;
		_page = null;
	}
343433
public static void deletePageOrResource(Resource resource) {
    Page configPage = resource.adaptTo(Page.class);
    if (configPage != null) {
      try {
        log.trace("! Delete page {}", configPage.getPath());
        PageManager pageManager = configPage.getPageManager();
        pageManager.delete(configPage, false);
      }
      catch (WCMException ex) {
        throw convertWCMException("Unable to delete configuration page at " + resource.getPath(), ex);
      }
    }
    else {
      try {
        log.trace("! Delete resource {}", resource.getPath());
        resource.getResourceResolver().delete(resource);
      }
      catch (PersistenceException ex) {
        throw convertPersistenceException("Unable to delete configuration resource at " + resource.getPath(), ex);
      }
    }
  }
414079
public void setPage(int page) {

        if (m_collectorParameter != null) {
            int pos = m_collectorParameter.indexOf(I_CmsListResourceCollector.PARAM_PAGE);
            if (pos >= 0) {
                String params = "";
                int endPos = m_collectorParameter.indexOf(I_CmsListResourceCollector.SEP_PARAM, pos);
                if (pos > 0) {
                    pos -= I_CmsListResourceCollector.SEP_PARAM.length(); // remove also the SEP_PARAM
                    params += m_collectorParameter.substring(0, pos);
                }
                if (endPos >= 0) {
                    if (pos == 0) {
                        endPos += I_CmsListResourceCollector.SEP_PARAM.length(); // remove also the SEP_PARAM
                    }
                    params += m_collectorParameter.substring(endPos, m_collectorParameter.length());
                }
                m_collectorParameter = params;
            }
        }
        if (m_collectorParameter == null) {
            m_collectorParameter = "";
        } else if (m_collectorParameter.length() > 0) {
            m_collectorParameter += I_CmsListResourceCollector.SEP_PARAM;
        }
        m_collectorParameter += I_CmsListResourceCollector.PARAM_PAGE + I_CmsListResourceCollector.SEP_KEYVAL + page;
        synchronized (this) {
            m_resources = null;
        }
    }
1244797
@Override
  public void write(byte[] buf, int off, int len) throws IOException {
    addBookKeeperEntry(buf, off, len);
  }
915112
public static void sendPageView(String pageWithParameters){
		if (analytics == null){
			return;
		}
		analytics.sendPageView().documentPath(pageWithParameters).go();
	}
171245
public function editPage($page_id = null)
    {
        $this->setPage($page_id);
        $this->setTitleEditPage();
        $this->setBreadcrumbEditPage();

        $this->setData('page', $this->data_page);
        $this->setData('languages', $this->language->getList(array('enabled' => true)));

        $this->submitEditPage();
        $this->setDataImagesEditPage();
        $this->setDataCategoriesEditPage();
        $this->outputEditPage();
    }
846184
public void document_id_DELETE(String id) throws IOException {
		String qPath = "/me/document/{id}";
		StringBuilder sb = path(qPath, id);
		exec(qPath, "DELETE", sb.toString(), null);
	}
207934
protected function updatePage($page_id)
    {
        if (!$this->isError() && !$this->page->update($page_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
417108
public synchronized ListenableFuture<?> add(Page page)
    {
        checkState(!isFull(), "PageBuffer is full!");
        pages.offer(page);
        if (isFull()) {
            if (settableFuture == null) {
                settableFuture = SettableFuture.create();
            }
            return settableFuture;
        }
        return NOT_FULL;
    }
392985
public void document_id_PUT(String id, OvhDocument body) throws IOException {
		String qPath = "/me/document/{id}";
		StringBuilder sb = path(qPath, id);
		exec(qPath, "PUT", sb.toString(), body);
	}
286429
final void preallocatePagesForWriteMap(Map<AbstractIndexPage, Integer> map, 
			FreeSpaceManager fsm) {
		getRoot().createWriteMap(map, fsm);
	}
350701
protected function setPage($page_id)
    {
        $this->data_page = $this->page->get($page_id);

        if (empty($this->data_page)) {
            $this->outputHttpStatus(404);
        }

        $this->controlAccessPage();
        $this->preparePage($this->data_page);
    }
787803
public static <E> Page<E> startPage(int pageNum, int pageSize, String orderBy) {
        Page<E> page = startPage(pageNum, pageSize);
        page.setOrderBy(orderBy);
        return page;
    }
604443
private void processModifiedPage(PageModificationContext context) {
        PageWrapper page = context.getPageWrapper();
        boolean emptyPage = page.getPage().getCount() == 0;
        ByteArraySegment pageKey = page.getPageKey();
        if (emptyPage && page.getParent() != null) {
            // This page is empty. Remove it from the PageCollection (so we don't write it back to our data source)
            // and remember its Page Key so we can delete its pointer from its parent page.
            context.getPageCollection().remove(page);
            context.setDeletedPageKey(pageKey);
        } else {
            // This page needs to be kept around.
            if (emptyPage && page.getPage().getConfig().isIndexPage()) {
                // We have an empty Index Root Page. We must convert this to a Leaf Page before moving on.
                page.setPage(createEmptyLeafPage());
            }

            // Assign a new offset to the page and record its new Page Pointer.
            context.pageCollection.complete(page);
            page.setMinOffset(calculateMinOffset(page));
            context.updatePagePointer(new PagePointer(pageKey, page.getOffset(), page.getPage().getLength(), page.getMinOffset()));
        }
    }
194145
public void addPage(WizardPage<DATA> page) {
		if (!started) {
			WizardPage<DATA> lastPage = pages.size() > 0 ? pages.get(pages.size() - 1) : null;
			if (lastPage != null) {
				lastPage.setNextPage(page);
				page.setPreviousPage(lastPage);
			}
			pages.add(page);
			wizardView.addPageToView(page);
		}
	}