// Show runs the show action.
497200
func (c *UsersController) Show(ctx *app.ShowUsersContext) error {
	tenantSA := token.IsSpecificServiceAccount(ctx, token.Tenant)
	isServiceAccount := tenantSA || token.IsSpecificServiceAccount(ctx, token.Notification)

	var identity *accountrepo.Identity
	err := transaction.Transactional(c.app, func(tr transaction.TransactionalResources) error {
		identityID, err := uuid.FromString(ctx.ID)
		if err != nil {
			return errors.NewBadParameterError("identity_id", ctx.ID)
		}
		identity, err = tr.Identities().LoadWithUser(ctx.Context, identityID)
		if err != nil {
			return err
		}

		if tenantSA && identity.User.Banned {
			// Don't return banned users for calls made by Tenant SA
			// TODO we should disable notifications for such users too but if we just return 401 for notification service request we may break it
			ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
			ctx.ResponseData.Header().Set("WWW-Authenticate", "DEPROVISIONED description=\"Account has been banned\"")
			return errors.NewUnauthorizedError("Account has been banned")
		}

		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalRequest(identity.User, c.config.GetCacheControlUser, func() error {
		return ctx.OK(ConvertToAppUser(ctx.RequestData, &identity.User, identity, isServiceAccount))
	})
}
958281
func (icon *Icon) Show(prefix string) {
	icon.fshow(os.Stdout, prefix)
}
1370395
func (v *ShowView) Render(m trees.Markup) {
	//if we are allowed to query for styles then check and change display
	if ds, err := trees.GetStyle(m, "display"); err == nil {
		if strings.Contains(ds.Value, "none") {
			ds.Value = "block"
		}
	}
}
1169975
func (c *NamedspacesController) Show(ctx *app.ShowNamedspacesContext) error {
	if ctx.UserName == "" {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound("not found, userName=%v", ctx.UserName))
	}

	if ctx.SpaceName == "" {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound("not found, spaceName=%v", ctx.SpaceName))
	}

	var s *space.Space
	err := application.Transactional(c.db, func(appl application.Application) error {
		identity, err := loadKeyCloakIdentityByUserName(ctx, appl, ctx.UserName)
		if err != nil {
			return goa.ErrNotFound("not found, userName=%v", ctx.UserName)
		}
		s, err = appl.Spaces().LoadByOwnerAndName(ctx.Context, &identity.ID, &ctx.SpaceName)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	spaceData, err := ConvertSpaceFromModel(ctx.Request, *s, IncludeBacklogTotalCount(ctx.Context, c.db))
	if err != nil {
		return err
	}
	resp := app.SpaceSingle{
		Data: spaceData,
	}
	return ctx.OK(&resp)
}
1127823
func (c *ResourceController) Show(ctx *app.ShowResourceContext) error {

	if !token.IsServiceAccount(ctx) {
		log.Error(ctx, map[string]interface{}{}, "Unable to read resource. Not a service account")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("not a service account"))
	}

	svc := c.app.ResourceService()
	res, err := svc.Read(ctx, ctx.ResourceID)
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"resource_id": ctx.ResourceID,
		}, "unable to read resource")
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	return ctx.OK(res)
}
824561
func (c *AreaController) ShowChildren(ctx *app.ShowChildrenAreaContext) error {
	id, err := uuid.FromString(ctx.ID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
	}
	var children []area.Area
	err = application.Transactional(c.db, func(appl application.Application) error {
		parentArea, err := appl.Areas().Load(ctx, id)
		if err != nil {
			return err
		}
		children, err = appl.Areas().ListChildren(ctx, parentArea)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	return ctx.ConditionalEntities(children, c.config.GetCacheControlAreas, func() error {
		res := &app.AreaList{}
		res.Data = ConvertAreas(c.db, ctx.Request, children, addResolvedPath)
		return ctx.OK(res)
	})
}
203832
func (s *ListsService) Show(params *ListsShowParams) (*List, *http.Response, error) {
	list := new(List)
	apiError := new(APIError)
	resp, err := s.sling.New().Get("show.json").QueryStruct(params).Receive(list, apiError)
	return list, resp, relevantError(err, *apiError)
}
120621
func (c *AreaController) Show(ctx *app.ShowAreaContext) error {
	id, err := uuid.FromString(ctx.ID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
	}
	var a *area.Area
	err = application.Transactional(c.db, func(appl application.Application) error {
		a, err = appl.Areas().Load(ctx, id)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalRequest(*a, c.config.GetCacheControlArea, func() error {
		res := &app.AreaSingle{}
		res.Data = ConvertArea(c.db, ctx.Request, *a, addResolvedPath)
		return ctx.OK(res)
	})
}
303976
func (c *SearchController) Show(ctx *app.ShowSearchContext) error {
	offset, limit := computePagingLimits(ctx.PageOffset, ctx.PageLimit)
	// TODO: Keep URL registeration central somehow.
	hostString := ctx.Request.Host
	if hostString == "" {
		hostString = c.configuration.GetHTTPAddress()
	}
	urlRegexString := fmt.Sprintf("(?P<domain>%s)(?P<path>/work-item/list/detail/)(?P<id>\\d*)", hostString)
	search.RegisterAsKnownURL(search.HostRegistrationKeyForListWI, urlRegexString)
	urlRegexString = fmt.Sprintf("(?P<domain>%s)(?P<path>/work-item/board/detail/)(?P<id>\\d*)", hostString)
	search.RegisterAsKnownURL(search.HostRegistrationKeyForBoardWI, urlRegexString)

	if ctx.FilterExpression != nil {
		var result []workitem.WorkItem
		var count int
		var ancestors link.AncestorList
		var childLinks link.WorkItemLinkList
		err := application.Transactional(c.db, func(appl application.Application) error {
			var err error
			result, count, ancestors, childLinks, err = appl.SearchItems().Filter(ctx.Context, *ctx.FilterExpression, ctx.FilterParentexists, &offset, &limit)
			if err != nil {
				cause := errs.Cause(err)
				switch cause.(type) {
				case errors.BadParameterError:
					return goa.ErrBadRequest(fmt.Sprintf("error listing work items for expression '%s': %s", *ctx.FilterExpression, err))
				default:
					log.Error(ctx, map[string]interface{}{
						"err":               err,
						"filter_expression": *ctx.FilterExpression,
					}, "unable to list the work items")
					return goa.ErrInternal(fmt.Sprintf("unable to list the work items: %s", err))
				}
			}
			return nil

		})
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		matchingWorkItemIDs := make(id.Slice, len(result))
		for i, wi := range result {
			matchingWorkItemIDs[i] = wi.ID
		}
		hasChildren := workItemIncludeHasChildren(ctx, c.db, childLinks)
		includeParent := includeParentWorkItem(ctx, ancestors, childLinks)
		// Load all work item types
		wits, err := loadWorkItemTypesFromArr(ctx.Context, c.db, result)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, errs.Wrap(err, "failed to load work item types"))
		}

		wis, err := ConvertWorkItems(ctx.Request, wits, result, hasChildren, includeParent)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		response := app.SearchWorkItemList{
			Links: &app.PagingLinks{},
			Meta: &app.WorkItemListResponseMeta{
				TotalCount: count,
			},
			Data: wis,
		}
		err = c.enrichWorkItemList(ctx, ancestors, matchingWorkItemIDs, childLinks, &response, hasChildren) // append parentWI and ancestors (if not empty) in response
		if err != nil {
			return errs.Wrap(err, "failed to enrich work item list")
		}
		setPagingLinks(response.Links, buildAbsoluteURL(ctx.Request), len(result), offset, limit, count, "filter[expression]="+*ctx.FilterExpression)

		// Sort "data" by name or ID if no title given
		var data WorkItemPtrSlice = response.Data
		sort.Sort(data)
		response.Data = data

		// Sort work items in the "included" array by ID or title
		var included WorkItemInterfaceSlice = response.Included
		sort.Sort(included)
		response.Included = included

		// build up list of sorted ancestor IDs from already sorted work items
		ancestorIDs := ancestors.GetDistinctAncestorIDs().ToMap()
		sortedAncestorIDs := make(id.Slice, len(ancestorIDs))
		i := 0
		for _, wi := range response.Data {
			if len(ancestorIDs) <= 0 {
				break
			}
			_, ok := ancestorIDs[*wi.ID]
			if ok {
				sortedAncestorIDs[i] = *wi.ID
				i++
				delete(ancestorIDs, *wi.ID)
			}
		}
		for _, ifObj := range response.Included {
			if len(ancestorIDs) <= 0 {
				break
			}
			var wi *app.WorkItem
			switch v := ifObj.(type) {
			case app.WorkItem:
				wi = &v
			case *app.WorkItem:
				wi = v
			default:
				continue
			}
			_, ok := ancestorIDs[*wi.ID]
			if ok {
				sortedAncestorIDs[i] = *wi.ID
				i++
				delete(ancestorIDs, *wi.ID)
			}
		}
		response.Meta.AncestorIDs = sortedAncestorIDs
		return ctx.OK(&response)
	}
	var result []workitem.WorkItem
	var count int
	err := application.Transactional(c.db, func(appl application.Application) error {
		if ctx.Q == nil || *ctx.Q == "" {
			return goa.ErrBadRequest("empty search query not allowed")
		}
		var err error
		result, count, err = appl.SearchItems().SearchFullText(ctx.Context, *ctx.Q, &offset, &limit, ctx.SpaceID)
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"err":        err,
				"expression": *ctx.Q,
			}, "unable to list the work items")
			return errs.Wrapf(err, "unable to list the work items for expression: %s", *ctx.Q)
		}
		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	wits, err := loadWorkItemTypesFromArr(ctx.Context, c.db, result)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	wis, err := ConvertWorkItems(ctx.Request, wits, result)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	response := app.SearchWorkItemList{
		Links: &app.PagingLinks{},
		Meta:  &app.WorkItemListResponseMeta{TotalCount: count},
		Data:  wis,
	}
	setPagingLinks(response.Links, buildAbsoluteURL(ctx.Request), len(result), offset, limit, count, "q="+*ctx.Q)
	return ctx.OK(&response)
}
607367
func (v GifmsResource) Show(c buffalo.Context) error {
	// Get the DB connection from the context
	tx, ok := c.Value("tx").(*pop.Connection)
	if !ok {
		return errors.WithStack(errors.New("no transaction found"))
	}

	// Allocate an empty Gifm
	gifm := &models.Gifm{}

	// To find the Gifm the parameter gifm_id is used.
	if err := tx.Find(gifm, c.Param("gifm_id")); err != nil {
		return c.Error(404, err)
	}

	return c.Render(200, r.Auto(c, gifm))
}
202339
func (s *SSD1306Driver) Display() (err error) {
	s.command(ssd1306ColumnAddr)
	s.command(0)
	s.command(uint8(s.DisplayWidth) - 1)
	s.command(ssd1306PageAddr)
	s.command(0)
	s.command(uint8(s.pageSize) - 1)
	if err = s.dcDriver.DigitalWrite(1); err != nil {
		return err
	}
	return s.connection.Tx(append([]byte{0x40}, s.buffer.buffer...), nil)
}
554513
func Show(cmd *cli.Cmd) {
	uuid := cmd.String(cli.StringArg{
		Name:      "UUID",
		Desc:      "Application UUID",
		HideValue: true,
	})

	cmd.Action = func() {
		app := application.Application{
			UUID: *uuid,
		}

		application, resp, errs := app.Show()

		if errs != nil {
			log.Fatalf("Could not retrieve application: %s", errs)
		}

		if resp.StatusCode != 200 {
			log.Fatalf("Could not retrieve application: %s", resp.Status)
		}

		printAppDetail(application)
	}
}
770098
func (c *QueryController) Show(ctx *app.ShowQueryContext) error {
	currentUserIdentityID, err := login.ContextIdentity(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))
	}
	var q *query.Query
	err = application.Transactional(c.db, func(appl application.Application) error {
		err := appl.Spaces().CheckExists(ctx, ctx.SpaceID)
		if err != nil {
			return errs.WithStack(err)
		}
		q, err = appl.Queries().Load(ctx, ctx.QueryID, ctx.SpaceID)
		return errs.WithStack(err)
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	if *currentUserIdentityID != q.Creator {
		log.Warn(ctx, map[string]interface{}{
			"query_id":     ctx.QueryID,
			"creator":      q.Creator,
			"current_user": *currentUserIdentityID,
		}, "user is not the query creator")
		return jsonapi.JSONErrorResponse(ctx, errors.NewForbiddenError("user is not the query creator"))
	}
	res := &app.QuerySingle{
		Data: ConvertQuery(ctx.Request, *q),
	}
	return ctx.OK(res)
}
186245
func Show(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "show", Listener: listener}
}
174263
func (n Notification) Show() (id uint32, err error) {
	conn, err := dbus.SessionBus()
	if err != nil {
		return
	}

	// We need to convert the interface type of the map to dbus.Variant as
	// people dont want to have to import the dbus package just to make use
	// of the notification hints.
	hints := map[string]dbus.Variant{}
	for k, v := range n.Hints {
		hints[k] = dbus.MakeVariant(v)
	}

	obj := conn.Object(DbusInterfacePath, DbusObjectPath)
	call := obj.Call(
		CallNotify,
		0,
		n.AppName,
		n.ReplacesID,
		n.AppIcon,
		n.Summary,
		n.Body,
		n.Actions,
		hints,
		n.Timeout)
	if err = call.Err; err != nil {
		return
	}

	err = call.Store(&id)
	return
}
1043906
func (m *Matrix) Show() {
	for y := 0; y < int(m.Rows); y++ {
		for x := 0; x < int(m.Cols); x++ {
			fmt.Printf("%f ", m.M[y][x])
		}
		fmt.Println()
	}
}
127850
func (v *View) Hide() {
	if v.HideState == nil {
		v.HideState = &HideView{}
	}
	v.activeState = v.HideState
}