Pass through to provider ResourceLookupSession.use_plenary_resource_view
2872
def use_plenary_resource_view(self):
        """"""
        self._object_views['resource'] = PLENARY
        # self._get_provider_session('resource_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_resource_view()
            except AttributeError:
                pass
1355469
def use_plenary_assessment_part_item_view(self):
        """"""
        self._object_views['assessment_part_item'] = PLENARY
        # self._get_provider_session('assessment_part_item_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_assessment_part_item_view()
            except AttributeError:
                pass
147394
def call(self, name, request=None, **params):
        
        if name not in self.resources:
            raise exceptions.HttpError(
                'Unknown method \'%s\'' % name,
                status=status.HTTP_501_NOT_IMPLEMENTED)
        request = request or HttpRequest()
        resource = self.resources[name]
        view = resource.as_view(api=self)
        return view(request, **params)
199097
@Nullable static View getView(Context context, int resourceId, View view) {
    LayoutInflater inflater = LayoutInflater.from(context);
    if (view != null) {
      return view;
    }
    if (resourceId != INVALID) {
      view = inflater.inflate(resourceId, null);
    }
    return view;
  }
716981
private void readResource(Document.Resources.Resource resource)
   {
      Resource mpxjResource = m_projectFile.addResource();
      mpxjResource.setName(resource.getName());
      mpxjResource.setResourceCalendar(m_calendarMap.get(resource.getCalendarID()));
      mpxjResource.setStandardRate(new Rate(resource.getCost(), resource.getCostTimeUnit()));
      mpxjResource.setEmailAddress(resource.getEMail());
      mpxjResource.setGroup(resource.getGroup());
      //resource.getHyperlinks()
      mpxjResource.setUniqueID(resource.getID());
      //resource.getMarkerID()
      mpxjResource.setNotes(resource.getNote());
      mpxjResource.setID(Integer.valueOf(resource.getOutlineNumber()));
      //resource.getStyleProject()
      mpxjResource.setType(resource.getSubType() == null ? resource.getType() : resource.getSubType());
   }
923228
private ModelNode readResourceOp(String addressTemplate) {
        final ResourceAddress op = new ResourceAddress(addressTemplate, statementContext);
        op.get(OP).set(READ_RESOURCE_OPERATION);
        op.get(INCLUDE_RUNTIME).set(true);
        op.get("attributes-only").set(true);
        return op;
    }
1181666
def custom_resource(self, name, restype, factclass, props):
	
		
		
		return CustomResource(self.__endpoint, name, restype, factclass, props)
189390
def access_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:view', **{
        'unicorn': ctx.repo.create_secure_service('unicorn'),
        'service': name,
    })
755964
void displayResourceInfo(CmsResultItemBean info) {

        if (m_hasImage) {
            setImagePreview(info.getPath(), info.getViewLink());
            m_resourceInfoPanel.add(new CmsImageInfo(info, info.getDimension()));
        } else {
            CmsListItemWidget widget = new CmsListItemWidget(info);
            OpenCloseHandler handler = new OpenCloseHandler();
            widget.addCloseHandler(handler);
            widget.addOpenHandler(handler);
            m_resourceInfoPanel.add(widget);
            int width = m_resourceInfoPanel.getOffsetWidth();
            if (width > 0) {
                widget.truncate("STANDARD", width);
            }
        }
        fireResize();
    }
1136652
def resource_to_url(resource, request=None, quote=False):
    
    if request is None:
        request = get_current_request()
#    cnv = request.registry.getAdapter(request, IResourceUrlConverter)
    reg = get_current_registry()
    cnv = reg.getAdapter(request, IResourceUrlConverter)
    return cnv.resource_to_url(resource, quote=quote)
1335618
private void readResources()
   {
      for (MapRow row : getTable("RTAB"))
      {
         Resource resource = m_projectFile.addResource();
         setFields(RESOURCE_FIELDS, row, resource);
         m_eventManager.fireResourceReadEvent(resource);
         // TODO: Correctly handle calendar
      }
   }
824996
def get(provider_name, node_type_name)
      name = "#{provider_name}/#{node_type_name}/"
      response = http_get(resource_url(name))
      format_object(response, TYPE)
    end
165292
def register_resource(mod, view, **kwargs):
    """"""
    resource_name = view.__name__.lower()[:-8]
    endpoint = kwargs.get('endpoint', "{}_api".format(resource_name))
    plural_resource_name = inflect.engine().plural(resource_name)
    path = kwargs.get('url', plural_resource_name).strip('/')
    url = '/{}'.format(path)
    setattr(view, '_url', url)  # need this for 201 location header
    view_func = view.as_view(endpoint)

    mod.add_url_rule(url, view_func=view_func,
                     methods=['GET', 'POST', 'OPTIONS'])
    mod.add_url_rule('{}/<obj_id>'.format(url),
                     view_func=view_func,
                     methods=['GET', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'])
93626
def use_comparative_resource_view(self):
        """"""
        self._object_views['resource'] = COMPARATIVE
        # self._get_provider_session('resource_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_comparative_resource_view()
            except AttributeError:
                pass
643478
def use_plenary_proficiency_view(self):
        """"""
        self._object_views['proficiency'] = PLENARY
        # self._get_provider_session('proficiency_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_proficiency_view()
            except AttributeError:
                pass
206918
def _set_repository_view(self, session):
        """"""
        if self._repository_view == COMPARATIVE:
            try:
                session.use_comparative_repository_view()
            except AttributeError:
                pass
        else:
            try:
                session.use_plenary_repository_view()
            except AttributeError:
                pass
1239805
def get_resource_relationships_for_source_resource_on_date(self, source_resource_id, from_, to):
        """"""
        # Implemented from azosid template for -
        # osid.relationship.RelationshipLookupSession.get_relationships_for_source_on_date_template
        if self._can('lookup'):
            return self._provider_session.get_resource_relationships_for_source_resource_on_date(source_resource_id, from_, to)
        self._check_lookup_conditions()  # raises PermissionDenied
        query = self._query_session.get_resource_relationship_query()
        query.match_source_id(source_resource_id, match=True)
        query.match_date(from_, to, match=True)
        return self._try_harder(query)