protected function buildUrl(AbstractModel $subject, AbstractModel $parent = null, $appendUrl = null, $docType = null)
    {
        if (is_null($docType)) {
            $docType = substr($this->mapper->getContentType(), strpos($this->mapper->getContentType(), '/') + 1);
        }

        $url = $this->baseUri;
        if (!is_null($parent) && intval($parent->getId()) > 0) {
            $url .= '/' . $this->mapTypeName($parent) . '/' . $parent->getId();
        }
        $url .= '/' . $this->mapTypeName($subject);
        if (intval($subject->getId()) > 0) {
            $url .= '/' . $subject->getId();
        }
        if (!is_null($appendUrl)) {
            $url .= $appendUrl;
        }
        return $url . '.' . $docType;
    }