Allow a page to be published if it is dynamic. This allows the page
to be published, but the pages service has the logic to not create
a _uri to point to the page

@param  {String} uri
@param  {Boolean|Undefined} _dynamic
@return {Promise}
975503
function _checkForDynamicPage(uri, { _dynamic }) {
  if (!_dynamic || typeof _dynamic !== 'boolean') {
    return bluebird.reject(new Error('Page is not dynamic and requires a url'));
  }

  return bluebird.resolve(_dynamic);
}
875973
function addPagesTooling( api ) {
   let pagesTooling;
   Object.defineProperty( api, 'pages', {
      get() {
         if( !pagesTooling ) {
            pagesTooling = createPagesTooling( api );
            pagesTooling.enable();
            api.destroy = () => {
               pagesTooling.disable();
            };
         }
         return pagesTooling;
      }
   } );
}
493660
function(uri) {
        var route = this.defined(uri);
        if (route !== false) {

            if (this._routes[route].method === null) {
                var f = this._routes[route].handler.bind(this._routes[route].handler);
                f(this.params(route));
            } else {
                var Obj = this._routes[route].handler;
                var method = this._routes[route].method;
                Obj[method](this.params(route));
            }

        } else {
            console.error('Route "' + uri + '" is not defined.');
            return false;
        }
    }
352730
function(userId) {
    return new Promise((resolve, reject) => {
      this._start()
          .uri('/api/user')
          .urlSegment(userId)
          .get()
          .go(this._responseHandler(resolve, reject));
    });
  }
1303093
function (req, res) {
    var error = new errors.NotFound('Page Does Not Exist');
    if (req.accepts('html') && (req.url.indexOf('/api/') !== 0)) {
      this.renderErrorPage('404', error, req, res);
    } else {
      this.renderError(error, req, res);
    }
  }
1240217
def loadTopicPageFromER(self, uri):
        
        params = {
            "action": "getTopicPageJson",
            "includeConceptDescription": True,
            "includeTopicPageDefinition": True,
            "includeTopicPageOwner": True,
            "uri": uri
        }
        self.topicPage = self._createEmptyTopicPage()
        self.concept = self.eventRegistry.jsonRequest("/json/topicPage", params)
        self.topicPage.update(self.concept.get("topicPage", {}))
860047
function create(uri, data, locals) {
  const layoutReference = data && data.layout,
    pageData = data && references.omitPageConfiguration(data),
    prefix = getPrefix(uri),
    pageReference = `${prefix}/_pages/${uid.get()}`,
    user = locals && locals.user;

  if (!layoutReference || !isLayout(layoutReference)) {
    throw new Error('Client: Data missing layout reference.');
  }

  return layouts.get(layoutReference, locals) // check to make sure the layout 200's
    .then(() => {
      return getPageClonePutOperations(pageData, locals)
        .then(ops => {
          pageData.layout = layoutReference;
          return addOp(pageReference, pageData, ops);
        });
    })
    .then(applyBatch)
    .then(newPage => {
      newPage._ref = pageReference;

      return meta.createPage(newPage._ref, user)
        .then(() => {
          bus.publish('createPage', { uri: pageReference, data: newPage, user });

          return newPage;
        });
    });
}
682098
function(uri) {
    const scheme = this.getScheme(uri);

    if (PUBLIC === scheme || TEMPORARY === scheme) {
      return '/' + this.resolvePath(uri);
    }

    return uri;
  }
357389
static function pageAction($uri)
    {
        $write = R::is('POST') and R::get('confirm');
        $page = page($uri);
        $builder = new Builder();
        $data = [
            'mode'    => 'page',
            'error'   => false,
            'confirm' => $write,
            'summary' => []
        ];
        if (!$page) {
            $data['error'] = "Error: Cannot find page for \"$uri\"";
        }
        else {
            $builder->run($page, $write);
            $data['summary'] = $builder->summary;
        }
        return $builder->htmlReport($data);
    }
1150153
function makeUrl(name, data) {

        if (! data['summary']){
            data['summary'] = data['description'];
        }

        return templates[name].replace(/\{\{(\w)(\w*)\}\}/g, function (m, fix, key) {
            var nameKey = name + fix + key.toLowerCase();
            key = (fix + key).toLowerCase();

            return encodeURIComponent((data[nameKey] === undefined ? data[key] : data[nameKey]) || '');
        });
    }
1099185
function pagedGet ({source, method, skip = 0, aggregatedResponse = null, query = null}) {
  const fullQuery = Object.assign({},
    {
      skip: skip,
      limit: pageLimit,
      order: 'sys.createdAt,sys.id'
    },
    query
  )

  return source[method](fullQuery)
    .then((response) => {
      if (!aggregatedResponse) {
        aggregatedResponse = response
      } else {
        aggregatedResponse.items = aggregatedResponse.items.concat(response.items)
      }
      const page = Math.ceil(skip / pageLimit) + 1
      const pages = Math.ceil(response.total / pageLimit)
      logEmitter.emit('info', `Fetched ${aggregatedResponse.items.length} of ${response.total} items (Page ${page}/${pages})`)
      if (skip + pageLimit <= response.total) {
        return pagedGet({source, method, skip: skip + pageLimit, aggregatedResponse, query})
      }
      return aggregatedResponse
    })
}
255090
public RouteBuilder on(String uri) {
        if (!uri.startsWith("/")) {
            this.uri = "/" + uri;
        } else {
            this.uri = uri;
        }
        return this;
    }
818454
function Router_add(route) {
        var rule;
        if (Array.isArray(route)) {
            route.forEach(Router_add.bind(this));
            return;
        }
        if (route.dynamic) {
            if (Type.isFunction(route.constructor)) {
                rule = new route.constructor();
            } else {
                throw new error.HttpError(500, {route: route}, 'Router.add: dynamic route is not function');
            }
        } else {
            rule = new RouteRule(route);
        }

        if (!(rule instanceof RouteRuleInterface)) {
            throw new error.HttpError(500, {rule: rule, route: route}, 'Router.add: rule must be instance of RouteRuleInterface');
        }

        logger.info('Router.add:', route);

        this.routes.push(rule);
    }
521796
async function getPages(srcDir) {
  config = config || (await asyncConfig());
  /** @type Array<String> */
  const allPaths = await globby([
    path.join(srcDir, '**/*.{md,html}'),
    '!**/_*/**/*.{md,html}',
    '!**/pattern-lab/**/*',
    '!**/_*.{md,html}',
  ]);

  return Promise.all(allPaths.map(getPage)).then(pages => {
    if (config.verbosity > 4) {
      log.dim('All data for Static pages:');
      console.log(pages);
      log.dim('END: All data for Static pages.');
    }
    return pages;
  });
}
838232
function ( uri ) {
		var cached = cache.get( uri, false ),
		    bit    = !cached ? 0 : cached.permission,
		    result = {allows: [], bit: bit, map: {partial: 8, read: 4, write: 2, "delete": 1, unknown: 0}};

		if ( bit & 1) {
			result.allows.push( "DELETE" );
		}

		if ( bit & 2) {
			result.allows.push( "POST" );
			result.allows.push( "PUT" );
		}

		if ( bit & 4) {
			result.allows.push( "GET" );
		}

		if ( bit & 8) {
			result.allows.push( "PATCH" );
		}

		return result;
	}
824457
function createDocumentLoader(promise) {
    return function(url, callback) {
      promise(url).then(
        // success
        function(remoteDocument) {
          callback(null, remoteDocument);
        },
        // failure
        callback
      );
    };
  }
1253902
function(options) {
                var queryParams = '';
                if (options && options.avoidNotification) {
                    queryParams = '?avoidnotification=true';
                }
                console.log('iamInterface.user.delete');
                corbel.validate.value('id', this.id);
                return this.request({
                    url: this._buildUriWithDomain(this.uri, this.id) + queryParams,
                    method: corbel.request.method.DELETE
                });
            }