<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def folderitems(self):
 """Custom folderitems for Worksheet ARs """

        items = []
        for ar, pos in self.get_container_mapping().items():
            ar = api.get_object_by_uid(ar)
            ar_id = api.get_id(ar)
            ar_uid = api.get_uid(ar)
            ar_url = api.get_url(ar)
            ar_title = api.get_title(ar)
            url = api.get_url(ar)
            client = ar.getClient()
            client_url = api.get_url(client)
            client_title = api.get_title(client)

            item = {
                "obj": ar,
                "id": ar_id,
                "uid": ar_uid,
                "title": ar_title,
                "type_class": "contenttype-AnalysisRequest",
                "url": url,
                "relative_url": url,
                "view_url": url,
                "Position": pos,
                "RequestID": ar_id,
                "Client": client_title,
                "created": self.ulocalized_time(ar.created(), long_format=1),
                "replace": {
                    "Client": get_link(client_url, value=client_title),
                    "RequestID": get_link(ar_url, value=ar_title),
                },
                "before": {},
                "after": {},
                "choices": {},
                "class": {},
                "state_class": "state-active",
                "allow_edit": [],
                "required": [],
            }
            items.append(item)
        items = sorted(items, key=itemgetter("Position"))
        return items