repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java | DeleteManager.applyDelete | private static boolean applyDelete(Element delete, Document ilf) {
String nodeID = delete.getAttribute(Constants.ATT_NAME);
Element e = ilf.getElementById(nodeID);
if (e == null) return false;
String deleteAllowed = e.getAttribute(Constants.ATT_DELETE_ALLOWED);
if (deleteAllow... | java | private static boolean applyDelete(Element delete, Document ilf) {
String nodeID = delete.getAttribute(Constants.ATT_NAME);
Element e = ilf.getElementById(nodeID);
if (e == null) return false;
String deleteAllowed = e.getAttribute(Constants.ATT_DELETE_ALLOWED);
if (deleteAllow... | [
"private",
"static",
"boolean",
"applyDelete",
"(",
"Element",
"delete",
",",
"Document",
"ilf",
")",
"{",
"String",
"nodeID",
"=",
"delete",
".",
"getAttribute",
"(",
"Constants",
".",
"ATT_NAME",
")",
";",
"Element",
"e",
"=",
"ilf",
".",
"getElementById",... | Attempt to apply a single delete command and return true if it succeeds or false otherwise.
If the delete is disallowed or the target element no longer exists in the document the delete
command fails and returns false. | [
"Attempt",
"to",
"apply",
"a",
"single",
"delete",
"command",
"and",
"return",
"true",
"if",
"it",
"succeeds",
"or",
"false",
"otherwise",
".",
"If",
"the",
"delete",
"is",
"disallowed",
"or",
"the",
"target",
"element",
"no",
"longer",
"exists",
"in",
"th... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java#L88-L102 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java | DeleteManager.getDeleteSet | private static Element getDeleteSet(Document plf, IPerson person, boolean create)
throws PortalException {
Node root = plf.getDocumentElement();
Node child = root.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_DELETE_SET)) return (E... | java | private static Element getDeleteSet(Document plf, IPerson person, boolean create)
throws PortalException {
Node root = plf.getDocumentElement();
Node child = root.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_DELETE_SET)) return (E... | [
"private",
"static",
"Element",
"getDeleteSet",
"(",
"Document",
"plf",
",",
"IPerson",
"person",
",",
"boolean",
"create",
")",
"throws",
"PortalException",
"{",
"Node",
"root",
"=",
"plf",
".",
"getDocumentElement",
"(",
")",
";",
"Node",
"child",
"=",
"ro... | Get the delete set if any stored in the root of the document or create it is passed in create
flag is true. | [
"Get",
"the",
"delete",
"set",
"if",
"any",
"stored",
"in",
"the",
"root",
"of",
"the",
"document",
"or",
"create",
"it",
"is",
"passed",
"in",
"create",
"flag",
"is",
"true",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java#L108-L137 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java | DeleteManager.addDeleteDirective | private static void addDeleteDirective(
Element compViewNode, String elementID, IPerson person, Document plf, Element delSet)
throws PortalException {
String ID = null;
try {
ID = getDLS().getNextStructDirectiveId(person);
} catch (Exception e) {
... | java | private static void addDeleteDirective(
Element compViewNode, String elementID, IPerson person, Document plf, Element delSet)
throws PortalException {
String ID = null;
try {
ID = getDLS().getNextStructDirectiveId(person);
} catch (Exception e) {
... | [
"private",
"static",
"void",
"addDeleteDirective",
"(",
"Element",
"compViewNode",
",",
"String",
"elementID",
",",
"IPerson",
"person",
",",
"Document",
"plf",
",",
"Element",
"delSet",
")",
"throws",
"PortalException",
"{",
"String",
"ID",
"=",
"null",
";",
... | This method does the actual work of adding a delete directive and then recursively calling
itself for any incoporated children that need to be deleted as well. | [
"This",
"method",
"does",
"the",
"actual",
"work",
"of",
"adding",
"a",
"delete",
"directive",
"and",
"then",
"recursively",
"calling",
"itself",
"for",
"any",
"incoporated",
"children",
"that",
"need",
"to",
"be",
"deleted",
"as",
"well",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java#L159-L190 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAResetAttribute.java | LPAResetAttribute.perform | @Override
public void perform() throws PortalException {
/*
* push the change into the PLF
*/
if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
// remove the parm edit
EditManager.removeEditDirective(nodeId, name, person);
}
/*
... | java | @Override
public void perform() throws PortalException {
/*
* push the change into the PLF
*/
if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
// remove the parm edit
EditManager.removeEditDirective(nodeId, name, person);
}
/*
... | [
"@",
"Override",
"public",
"void",
"perform",
"(",
")",
"throws",
"PortalException",
"{",
"/*\n * push the change into the PLF\n */",
"if",
"(",
"nodeId",
".",
"startsWith",
"(",
"Constants",
".",
"FRAGMENT_ID_USER_PREFIX",
")",
")",
"{",
"// remove the ... | Reset a parameter to not override the value specified by a fragment. This is done by removing
the parm edit in the PLF and setting the value in the ILF to the passed-in fragment value. | [
"Reset",
"a",
"parameter",
"to",
"not",
"override",
"the",
"value",
"specified",
"by",
"a",
"fragment",
".",
"This",
"is",
"done",
"by",
"removing",
"the",
"parm",
"edit",
"in",
"the",
"PLF",
"and",
"setting",
"the",
"value",
"in",
"the",
"ILF",
"to",
... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAResetAttribute.java#L42-L59 | train |
Jasig/uPortal | uPortal-groups/uPortal-groups-local/src/main/java/org/apereo/portal/groups/local/searchers/PortletDefinitionSearcher.java | PortletDefinitionSearcher.searchForEntities | @Override
public EntityIdentifier[] searchForEntities(String query, SearchMethod method)
throws GroupsException {
boolean allowPartial = true;
switch (method) {
case DISCRETE:
allowPartial = false;
break;
case STARTS_WITH:
... | java | @Override
public EntityIdentifier[] searchForEntities(String query, SearchMethod method)
throws GroupsException {
boolean allowPartial = true;
switch (method) {
case DISCRETE:
allowPartial = false;
break;
case STARTS_WITH:
... | [
"@",
"Override",
"public",
"EntityIdentifier",
"[",
"]",
"searchForEntities",
"(",
"String",
"query",
",",
"SearchMethod",
"method",
")",
"throws",
"GroupsException",
"{",
"boolean",
"allowPartial",
"=",
"true",
";",
"switch",
"(",
"method",
")",
"{",
"case",
... | Internal search, so shouldn't be called as case insensitive. | [
"Internal",
"search",
"so",
"shouldn",
"t",
"be",
"called",
"as",
"case",
"insensitive",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-local/src/main/java/org/apereo/portal/groups/local/searchers/PortletDefinitionSearcher.java#L43-L85 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/PermissionTargetProviderRegistryImpl.java | PermissionTargetProviderRegistryImpl.setProviders | public void setProviders(Map<String, IPermissionTargetProvider> providers) {
this.providers.clear();
for (Map.Entry<String, IPermissionTargetProvider> provider : providers.entrySet()) {
this.providers.put(provider.getKey(), provider.getValue());
}
} | java | public void setProviders(Map<String, IPermissionTargetProvider> providers) {
this.providers.clear();
for (Map.Entry<String, IPermissionTargetProvider> provider : providers.entrySet()) {
this.providers.put(provider.getKey(), provider.getValue());
}
} | [
"public",
"void",
"setProviders",
"(",
"Map",
"<",
"String",
",",
"IPermissionTargetProvider",
">",
"providers",
")",
"{",
"this",
".",
"providers",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"IPermissionTargetProvider"... | Construct a new target provider registry and initialize it with the supplied map of key ->
provider pairs.
@param providers | [
"Construct",
"a",
"new",
"target",
"provider",
"registry",
"and",
"initialize",
"it",
"with",
"the",
"supplied",
"map",
"of",
"key",
"-",
">",
"provider",
"pairs",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/PermissionTargetProviderRegistryImpl.java#L42-L47 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/portlet/PortletSpELServiceImpl.java | PortletSpELServiceImpl.parseString | @Override
public String parseString(String expressionString, PortletRequest request) {
return getValue(expressionString, request, String.class);
} | java | @Override
public String parseString(String expressionString, PortletRequest request) {
return getValue(expressionString, request, String.class);
} | [
"@",
"Override",
"public",
"String",
"parseString",
"(",
"String",
"expressionString",
",",
"PortletRequest",
"request",
")",
"{",
"return",
"getValue",
"(",
"expressionString",
",",
"request",
",",
"String",
".",
"class",
")",
";",
"}"
] | Primary method used assuming all defaults. | [
"Primary",
"method",
"used",
"assuming",
"all",
"defaults",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/portlet/PortletSpELServiceImpl.java#L72-L75 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/portlet/PortletSpELServiceImpl.java | PortletSpELServiceImpl.getEvaluationContext | protected EvaluationContext getEvaluationContext(PortletRequest request) {
Map<String, String> userInfo =
(Map<String, String>) request.getAttribute(PortletRequest.USER_INFO);
final SpELEnvironmentRoot root =
new SpELEnvironmentRoot(new PortletWebRequest(request), userInf... | java | protected EvaluationContext getEvaluationContext(PortletRequest request) {
Map<String, String> userInfo =
(Map<String, String>) request.getAttribute(PortletRequest.USER_INFO);
final SpELEnvironmentRoot root =
new SpELEnvironmentRoot(new PortletWebRequest(request), userInf... | [
"protected",
"EvaluationContext",
"getEvaluationContext",
"(",
"PortletRequest",
"request",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"userInfo",
"=",
"(",
"Map",
"<",
"String",
",",
"String",
">",
")",
"request",
".",
"getAttribute",
"(",
"PortletRe... | Return a SpEL evaluation context for the supplied portlet request.
@param request PortletRequest
@return SpEL evaluation context for the supplied portlet request | [
"Return",
"a",
"SpEL",
"evaluation",
"context",
"for",
"the",
"supplied",
"portlet",
"request",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/portlet/PortletSpELServiceImpl.java#L120-L129 | train |
Jasig/uPortal | uPortal-tools/src/main/java/org/apereo/portal/version/dao/jpa/JpaVersionDao.java | JpaVersionDao.getSimpleVersion | private Version getSimpleVersion(String product) {
final Tuple coreNumbers;
try {
final TypedQuery<Tuple> coreNumbersQuery =
this.createQuery(this.findCoreVersionNumbers);
coreNumbersQuery.setParameter(this.productParameter, product);
coreNumbers =... | java | private Version getSimpleVersion(String product) {
final Tuple coreNumbers;
try {
final TypedQuery<Tuple> coreNumbersQuery =
this.createQuery(this.findCoreVersionNumbers);
coreNumbersQuery.setParameter(this.productParameter, product);
coreNumbers =... | [
"private",
"Version",
"getSimpleVersion",
"(",
"String",
"product",
")",
"{",
"final",
"Tuple",
"coreNumbers",
";",
"try",
"{",
"final",
"TypedQuery",
"<",
"Tuple",
">",
"coreNumbersQuery",
"=",
"this",
".",
"createQuery",
"(",
"this",
".",
"findCoreVersionNumbe... | Load a Version object with direct field queries. Used to deal with DB upgrades where not all
of the fields have been loaded | [
"Load",
"a",
"Version",
"object",
"with",
"direct",
"field",
"queries",
".",
"Used",
"to",
"deal",
"with",
"DB",
"upgrades",
"where",
"not",
"all",
"of",
"the",
"fields",
"have",
"been",
"loaded"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-tools/src/main/java/org/apereo/portal/version/dao/jpa/JpaVersionDao.java#L109-L149 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/dynamicskin/DynamicRespondrSkinViewController.java | DynamicRespondrSkinViewController.calculateDynamicSkinUrlPathToUse | private String calculateDynamicSkinUrlPathToUse(PortletRequest request, String lessfileBaseName)
throws IOException {
final DynamicSkinInstanceData data = new DefaultDynamicSkinInstanceDataImpl(request);
if (!service.skinCssFileExists(data)) {
// Trigger the LESS compilation
... | java | private String calculateDynamicSkinUrlPathToUse(PortletRequest request, String lessfileBaseName)
throws IOException {
final DynamicSkinInstanceData data = new DefaultDynamicSkinInstanceDataImpl(request);
if (!service.skinCssFileExists(data)) {
// Trigger the LESS compilation
... | [
"private",
"String",
"calculateDynamicSkinUrlPathToUse",
"(",
"PortletRequest",
"request",
",",
"String",
"lessfileBaseName",
")",
"throws",
"IOException",
"{",
"final",
"DynamicSkinInstanceData",
"data",
"=",
"new",
"DefaultDynamicSkinInstanceDataImpl",
"(",
"request",
")"... | Calculate the default skin URL path or the path to a skin CSS file that is specific to the
set of portlet preference values currently defined.
@param request
@return
@throws IOException | [
"Calculate",
"the",
"default",
"skin",
"URL",
"path",
"or",
"the",
"path",
"to",
"a",
"skin",
"CSS",
"file",
"that",
"is",
"specific",
"to",
"the",
"set",
"of",
"portlet",
"preference",
"values",
"currently",
"defined",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/dynamicskin/DynamicRespondrSkinViewController.java#L137-L145 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/resource/CachingResourceLoaderImpl.java | CachingResourceLoaderImpl.getLastModified | protected long getLastModified(Resource resource) {
try {
return resource.lastModified();
} catch (IOException e) {
this.logger.warn(
"Could not determine lastModified for "
+ resource
+ ". This resource ... | java | protected long getLastModified(Resource resource) {
try {
return resource.lastModified();
} catch (IOException e) {
this.logger.warn(
"Could not determine lastModified for "
+ resource
+ ". This resource ... | [
"protected",
"long",
"getLastModified",
"(",
"Resource",
"resource",
")",
"{",
"try",
"{",
"return",
"resource",
".",
"lastModified",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"this",
".",
"logger",
".",
"warn",
"(",
"\"Could not dete... | Determine the last modified time stamp for the resource | [
"Determine",
"the",
"last",
"modified",
"time",
"stamp",
"for",
"the",
"resource"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/resource/CachingResourceLoaderImpl.java#L178-L190 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/user/UserInstanceManagerImpl.java | UserInstanceManagerImpl.getUserInstance | @Override
public IUserInstance getUserInstance(HttpServletRequest request) throws PortalException {
try {
request = this.portalRequestUtils.getOriginalPortalRequest(request);
} catch (IllegalArgumentException iae) {
// ignore, just means that this isn't a wrapped request
... | java | @Override
public IUserInstance getUserInstance(HttpServletRequest request) throws PortalException {
try {
request = this.portalRequestUtils.getOriginalPortalRequest(request);
} catch (IllegalArgumentException iae) {
// ignore, just means that this isn't a wrapped request
... | [
"@",
"Override",
"public",
"IUserInstance",
"getUserInstance",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"PortalException",
"{",
"try",
"{",
"request",
"=",
"this",
".",
"portalRequestUtils",
".",
"getOriginalPortalRequest",
"(",
"request",
")",
";",
"}",... | Returns the UserInstance object that is associated with the given request.
@param request Incoming HttpServletRequest
@return UserInstance object associated with the given request | [
"Returns",
"the",
"UserInstance",
"object",
"that",
"is",
"associated",
"with",
"the",
"given",
"request",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/user/UserInstanceManagerImpl.java#L99-L168 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/PortletTabIdResolver.java | PortletTabIdResolver.containsElmentWithId | private boolean containsElmentWithId(Node node, String id) {
String nodeName = node.getNodeName();
if ("channel".equals(nodeName) || "folder".equals(nodeName)) {
Element e = (Element) node;
if (id.equals(e.getAttribute("ID"))) {
return true;
}
... | java | private boolean containsElmentWithId(Node node, String id) {
String nodeName = node.getNodeName();
if ("channel".equals(nodeName) || "folder".equals(nodeName)) {
Element e = (Element) node;
if (id.equals(e.getAttribute("ID"))) {
return true;
}
... | [
"private",
"boolean",
"containsElmentWithId",
"(",
"Node",
"node",
",",
"String",
"id",
")",
"{",
"String",
"nodeName",
"=",
"node",
".",
"getNodeName",
"(",
")",
";",
"if",
"(",
"\"channel\"",
".",
"equals",
"(",
"nodeName",
")",
"||",
"\"folder\"",
".",
... | Recursevly find out whether node contains a folder or channel with given identifier.
@param node Where to search.
@param id Identifier to search for.
@return true if node or any of its descendats contain an element with given identifier, false
otherwise. | [
"Recursevly",
"find",
"out",
"whether",
"node",
"contains",
"a",
"folder",
"or",
"channel",
"with",
"given",
"identifier",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/PortletTabIdResolver.java#L79-L97 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/web/PortalWebUtils.java | PortalWebUtils.currentRequestContextPath | public static String currentRequestContextPath() {
final RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (null == requestAttributes) {
throw new IllegalStateException(
"Request attributes are not bound. "
... | java | public static String currentRequestContextPath() {
final RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (null == requestAttributes) {
throw new IllegalStateException(
"Request attributes are not bound. "
... | [
"public",
"static",
"String",
"currentRequestContextPath",
"(",
")",
"{",
"final",
"RequestAttributes",
"requestAttributes",
"=",
"RequestContextHolder",
".",
"getRequestAttributes",
"(",
")",
";",
"if",
"(",
"null",
"==",
"requestAttributes",
")",
"{",
"throw",
"ne... | Get the request context path from the current request. Copes with both HttpServletRequest and
PortletRequest and so usable when handling Spring-processed Servlet or Portlet requests.
Requires that Spring have bound the request, as in the case of dispatcher servlet or portlet
or when the binding filter or listener is ac... | [
"Get",
"the",
"request",
"context",
"path",
"from",
"the",
"current",
"request",
".",
"Copes",
"with",
"both",
"HttpServletRequest",
"and",
"PortletRequest",
"and",
"so",
"usable",
"when",
"handling",
"Spring",
"-",
"processed",
"Servlet",
"or",
"Portlet",
"requ... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/web/PortalWebUtils.java#L132-L160 | train |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImpl.java | RequestAttributeServiceImpl.getExpectedUserAttributes | protected List<? extends UserAttribute> getExpectedUserAttributes(
HttpServletRequest request, final IPortletWindow portletWindow) {
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
... | java | protected List<? extends UserAttribute> getExpectedUserAttributes(
HttpServletRequest request, final IPortletWindow portletWindow) {
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
... | [
"protected",
"List",
"<",
"?",
"extends",
"UserAttribute",
">",
"getExpectedUserAttributes",
"(",
"HttpServletRequest",
"request",
",",
"final",
"IPortletWindow",
"portletWindow",
")",
"{",
"final",
"IPortletEntity",
"portletEntity",
"=",
"portletWindow",
".",
"getPortl... | Get the list of user attributes the portlet expects.
@param request The current request.
@param portletWindow The window to get the expected user attributes for.
@return The List of expected user attributes for the portlet | [
"Get",
"the",
"list",
"of",
"user",
"attributes",
"the",
"portlet",
"expects",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImpl.java#L129-L138 | train |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/AuthorizationPrincipalHelper.java | AuthorizationPrincipalHelper.principalFromUser | public static IAuthorizationPrincipal principalFromUser(final IPerson user) {
Validate.notNull(user, "Cannot determine an authorization principal for null user.");
final EntityIdentifier userEntityIdentifier = user.getEntityIdentifier();
Validate.notNull(user, "The user object is defective: la... | java | public static IAuthorizationPrincipal principalFromUser(final IPerson user) {
Validate.notNull(user, "Cannot determine an authorization principal for null user.");
final EntityIdentifier userEntityIdentifier = user.getEntityIdentifier();
Validate.notNull(user, "The user object is defective: la... | [
"public",
"static",
"IAuthorizationPrincipal",
"principalFromUser",
"(",
"final",
"IPerson",
"user",
")",
"{",
"Validate",
".",
"notNull",
"(",
"user",
",",
"\"Cannot determine an authorization principal for null user.\"",
")",
";",
"final",
"EntityIdentifier",
"userEntityI... | Convenience method for converting an IPerson to an IAuthorizationPrincipal.
@param user a non-null valid IPerson
@return an IAuthorizationPrincipal representing that user
@throws IllegalArgumentException if the user object is null or defective.
@since 4.1 | [
"Convenience",
"method",
"for",
"converting",
"an",
"IPerson",
"to",
"an",
"IAuthorizationPrincipal",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/AuthorizationPrincipalHelper.java#L39-L55 | train |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/PersonDirNameFinder.java | PersonDirNameFinder.primGetName | private String primGetName(String key) {
String name = key;
final IPersonAttributes personAttributes = this.paDao.getPerson(name);
if (personAttributes != null) {
Object displayName = personAttributes.getAttributeValue("displayName");
String displayNameStr = "";
... | java | private String primGetName(String key) {
String name = key;
final IPersonAttributes personAttributes = this.paDao.getPerson(name);
if (personAttributes != null) {
Object displayName = personAttributes.getAttributeValue("displayName");
String displayNameStr = "";
... | [
"private",
"String",
"primGetName",
"(",
"String",
"key",
")",
"{",
"String",
"name",
"=",
"key",
";",
"final",
"IPersonAttributes",
"personAttributes",
"=",
"this",
".",
"paDao",
".",
"getPerson",
"(",
"name",
")",
";",
"if",
"(",
"personAttributes",
"!=",
... | Actually lookup a user name using the underlying IPersonAttributeDao.
@param key - entity key which in this case is a unique identifier for a user
@return the display name for the identified user | [
"Actually",
"lookup",
"a",
"user",
"name",
"using",
"the",
"underlying",
"IPersonAttributeDao",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/PersonDirNameFinder.java#L70-L84 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AnyUnblockedGrantPermissionPolicy.java | AnyUnblockedGrantPermissionPolicy.removeInactivePermissions | private Set<IPermission> removeInactivePermissions(final IPermission[] perms) {
Date now = new Date();
Set<IPermission> rslt = new HashSet<>(1);
for (int i = 0; i < perms.length; i++) {
IPermission p = perms[i];
if ((p.getEffective() == null || !p.getEffective().after(... | java | private Set<IPermission> removeInactivePermissions(final IPermission[] perms) {
Date now = new Date();
Set<IPermission> rslt = new HashSet<>(1);
for (int i = 0; i < perms.length; i++) {
IPermission p = perms[i];
if ((p.getEffective() == null || !p.getEffective().after(... | [
"private",
"Set",
"<",
"IPermission",
">",
"removeInactivePermissions",
"(",
"final",
"IPermission",
"[",
"]",
"perms",
")",
"{",
"Date",
"now",
"=",
"new",
"Date",
"(",
")",
";",
"Set",
"<",
"IPermission",
">",
"rslt",
"=",
"new",
"HashSet",
"<>",
"(",
... | Returns a Set containing those IPermission instances where the present date is neither after
the permission expiration if present nor before the permission start date if present. Only
permissions objects that have been filtered by this method should be checked.
@return Potentially empty non-null Set of active permissi... | [
"Returns",
"a",
"Set",
"containing",
"those",
"IPermission",
"instances",
"where",
"the",
"present",
"date",
"is",
"neither",
"after",
"the",
"permission",
"expiration",
"if",
"present",
"nor",
"before",
"the",
"permission",
"start",
"date",
"if",
"present",
"."... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AnyUnblockedGrantPermissionPolicy.java#L360-L375 | train |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java | RequestParameterPolicyEnforcementFilter.throwIfUnrecognizedParamName | static void throwIfUnrecognizedParamName(Enumeration initParamNames) throws ServletException {
final Set<String> recognizedParameterNames = new HashSet<String>();
recognizedParameterNames.add(ALLOW_MULTI_VALUED_PARAMETERS);
recognizedParameterNames.add(PARAMETERS_TO_CHECK);
recognizedPar... | java | static void throwIfUnrecognizedParamName(Enumeration initParamNames) throws ServletException {
final Set<String> recognizedParameterNames = new HashSet<String>();
recognizedParameterNames.add(ALLOW_MULTI_VALUED_PARAMETERS);
recognizedParameterNames.add(PARAMETERS_TO_CHECK);
recognizedPar... | [
"static",
"void",
"throwIfUnrecognizedParamName",
"(",
"Enumeration",
"initParamNames",
")",
"throws",
"ServletException",
"{",
"final",
"Set",
"<",
"String",
">",
"recognizedParameterNames",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"recognizedParam... | Examines the Filter init parameter names and throws ServletException if they contain an
unrecognized init parameter name.
<p>This is a stateless static method.
<p>This method is an implementation detail and is not exposed API. This method is only
non-private to allow JUnit testing.
@param initParamNames init param n... | [
"Examines",
"the",
"Filter",
"init",
"parameter",
"names",
"and",
"throws",
"ServletException",
"if",
"they",
"contain",
"an",
"unrecognized",
"init",
"parameter",
"name",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java#L257-L276 | train |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java | RequestParameterPolicyEnforcementFilter.parseParametersToCheck | static Set<String> parseParametersToCheck(final String initParamValue) {
final Set<String> parameterNames = new HashSet<String>();
if (null == initParamValue) {
return parameterNames;
}
final String[] tokens = initParamValue.split("\\s+");
if (0 == tokens.length) ... | java | static Set<String> parseParametersToCheck(final String initParamValue) {
final Set<String> parameterNames = new HashSet<String>();
if (null == initParamValue) {
return parameterNames;
}
final String[] tokens = initParamValue.split("\\s+");
if (0 == tokens.length) ... | [
"static",
"Set",
"<",
"String",
">",
"parseParametersToCheck",
"(",
"final",
"String",
"initParamValue",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"parameterNames",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"null",
"==",
"i... | Parse the whitespace delimited String of parameters to check.
<p>If the String is null, return the empty set. If the whitespace delimited String contains
no tokens, throw IllegalArgumentException. If the sole token is an asterisk, return the empty
set. If the asterisk token is encountered among other tokens, throw Ill... | [
"Parse",
"the",
"whitespace",
"delimited",
"String",
"of",
"parameters",
"to",
"check",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java#L328-L362 | train |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java | RequestParameterPolicyEnforcementFilter.requireNotMultiValued | static void requireNotMultiValued(final Set<String> parametersToCheck, final Map parameterMap) {
for (final String parameterName : parametersToCheck) {
if (parameterMap.containsKey(parameterName)) {
final String[] values = (String[]) parameterMap.get(parameterName);
... | java | static void requireNotMultiValued(final Set<String> parametersToCheck, final Map parameterMap) {
for (final String parameterName : parametersToCheck) {
if (parameterMap.containsKey(parameterName)) {
final String[] values = (String[]) parameterMap.get(parameterName);
... | [
"static",
"void",
"requireNotMultiValued",
"(",
"final",
"Set",
"<",
"String",
">",
"parametersToCheck",
",",
"final",
"Map",
"parameterMap",
")",
"{",
"for",
"(",
"final",
"String",
"parameterName",
":",
"parametersToCheck",
")",
"{",
"if",
"(",
"parameterMap",... | For each parameter to check, verify that it has zero or one value.
<p>The Set of parameters to check MAY be empty. The parameter map MAY NOT contain any given
parameter to check.
<p>This method is an implementation detail and is not exposed API. This method is only
non-private to allow JUnit testing.
<p>Static, stat... | [
"For",
"each",
"parameter",
"to",
"check",
"verify",
"that",
"it",
"has",
"zero",
"or",
"one",
"value",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java#L434-L449 | train |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/ChainingSecurityContext.java | ChainingSecurityContext.authenticate | @Override
public synchronized void authenticate() throws PortalSecurityException {
int i;
Enumeration e = mySubContexts.elements();
while (e.hasMoreElements()) {
ISecurityContext sctx = ((Entry) e.nextElement()).getCtx();
// The principal and credential are now set f... | java | @Override
public synchronized void authenticate() throws PortalSecurityException {
int i;
Enumeration e = mySubContexts.elements();
while (e.hasMoreElements()) {
ISecurityContext sctx = ((Entry) e.nextElement()).getCtx();
// The principal and credential are now set f... | [
"@",
"Override",
"public",
"synchronized",
"void",
"authenticate",
"(",
")",
"throws",
"PortalSecurityException",
"{",
"int",
"i",
";",
"Enumeration",
"e",
"=",
"mySubContexts",
".",
"elements",
"(",
")",
";",
"while",
"(",
"e",
".",
"hasMoreElements",
"(",
... | We walk the chain of subcontexts assigning principals and opaqueCredentials from the parent.
Note that the contexts themselves should resist actually performing the assignment if an
assignment has already been made to either the credentials or the UID. | [
"We",
"walk",
"the",
"chain",
"of",
"subcontexts",
"assigning",
"principals",
"and",
"opaqueCredentials",
"from",
"the",
"parent",
".",
"Note",
"that",
"the",
"contexts",
"themselves",
"should",
"resist",
"actually",
"performing",
"the",
"assignment",
"if",
"an",
... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/ChainingSecurityContext.java#L80-L111 | train |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/ChainingSecurityContext.java | ChainingSecurityContext.getSubContexts | @Override
public synchronized Enumeration getSubContexts() {
Enumeration e = mySubContexts.elements();
class Adapter implements Enumeration {
Enumeration base;
public Adapter(Enumeration e) {
this.base = e;
}
@Override
pub... | java | @Override
public synchronized Enumeration getSubContexts() {
Enumeration e = mySubContexts.elements();
class Adapter implements Enumeration {
Enumeration base;
public Adapter(Enumeration e) {
this.base = e;
}
@Override
pub... | [
"@",
"Override",
"public",
"synchronized",
"Enumeration",
"getSubContexts",
"(",
")",
"{",
"Enumeration",
"e",
"=",
"mySubContexts",
".",
"elements",
"(",
")",
";",
"class",
"Adapter",
"implements",
"Enumeration",
"{",
"Enumeration",
"base",
";",
"public",
"Adap... | be returned in the order they appeared in the properties file. | [
"be",
"returned",
"in",
"the",
"order",
"they",
"appeared",
"in",
"the",
"properties",
"file",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/ChainingSecurityContext.java#L162-L183 | train |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/ChainingSecurityContext.java | ChainingSecurityContext.getSubContextNames | @Override
public synchronized Enumeration getSubContextNames() {
Vector scNames = new Vector();
for (int i = 0; i < mySubContexts.size(); i++) {
Entry entry = (Entry) mySubContexts.get(i);
if (entry.getKey() != null) {
scNames.add(entry.getKey());
... | java | @Override
public synchronized Enumeration getSubContextNames() {
Vector scNames = new Vector();
for (int i = 0; i < mySubContexts.size(); i++) {
Entry entry = (Entry) mySubContexts.get(i);
if (entry.getKey() != null) {
scNames.add(entry.getKey());
... | [
"@",
"Override",
"public",
"synchronized",
"Enumeration",
"getSubContextNames",
"(",
")",
"{",
"Vector",
"scNames",
"=",
"new",
"Vector",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mySubContexts",
".",
"size",
"(",
")",
";",
"i",
... | Returns an Enumeration of the names of the subcontexts. | [
"Returns",
"an",
"Enumeration",
"of",
"the",
"names",
"of",
"the",
"subcontexts",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/ChainingSecurityContext.java#L273-L283 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/favorites/FavoritesController.java | FavoritesController.initializeView | @RenderMapping
public String initializeView(PortletRequest req, Model model) {
final IUserInstance ui =
userInstanceManager.getUserInstance(portalRequestUtils.getCurrentPortalRequest());
final UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
f... | java | @RenderMapping
public String initializeView(PortletRequest req, Model model) {
final IUserInstance ui =
userInstanceManager.getUserInstance(portalRequestUtils.getCurrentPortalRequest());
final UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
f... | [
"@",
"RenderMapping",
"public",
"String",
"initializeView",
"(",
"PortletRequest",
"req",
",",
"Model",
"model",
")",
"{",
"final",
"IUserInstance",
"ui",
"=",
"userInstanceManager",
".",
"getUserInstance",
"(",
"portalRequestUtils",
".",
"getCurrentPortalRequest",
"(... | Handles all Favorites portlet VIEW mode renders. Populates model with user's favorites and
selects a view to display those favorites.
<p>View selection:
<p>Returns "jsp/Favorites/view" in the normal case where the user has at least one favorited
portlet or favorited collection.
<p>Returns "jsp/Favorites/view_zero" i... | [
"Handles",
"all",
"Favorites",
"portlet",
"VIEW",
"mode",
"renders",
".",
"Populates",
"model",
"with",
"user",
"s",
"favorites",
"and",
"selects",
"a",
"view",
"to",
"display",
"those",
"favorites",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/favorites/FavoritesController.java#L86-L151 | train |
Jasig/uPortal | uPortal-soffit/uPortal-soffit-connector/src/main/java/org/apereo/portal/soffit/connector/AbstractHeaderProvider.java | AbstractHeaderProvider.getExpiration | protected final Date getExpiration(RenderRequest renderRequest) {
// Expiration of the JWT
final PortletSession portletSession = renderRequest.getPortletSession();
final Date rslt =
new Date(
portletSession.getLastAccessedTime()
... | java | protected final Date getExpiration(RenderRequest renderRequest) {
// Expiration of the JWT
final PortletSession portletSession = renderRequest.getPortletSession();
final Date rslt =
new Date(
portletSession.getLastAccessedTime()
... | [
"protected",
"final",
"Date",
"getExpiration",
"(",
"RenderRequest",
"renderRequest",
")",
"{",
"// Expiration of the JWT",
"final",
"PortletSession",
"portletSession",
"=",
"renderRequest",
".",
"getPortletSession",
"(",
")",
";",
"final",
"Date",
"rslt",
"=",
"new",... | Point at which the JWT expires | [
"Point",
"at",
"which",
"the",
"JWT",
"expires"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-soffit/uPortal-soffit-connector/src/main/java/org/apereo/portal/soffit/connector/AbstractHeaderProvider.java#L48-L56 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.canPrincipalManage | @Override
@RequestCache
public boolean canPrincipalManage(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
final String owner = IPermission.PORTAL_PUBLISH;
final String target = IPermission.PORTLET_PREFIX + portletDefinitionId;
... | java | @Override
@RequestCache
public boolean canPrincipalManage(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
final String owner = IPermission.PORTAL_PUBLISH;
final String target = IPermission.PORTLET_PREFIX + portletDefinitionId;
... | [
"@",
"Override",
"@",
"RequestCache",
"public",
"boolean",
"canPrincipalManage",
"(",
"IAuthorizationPrincipal",
"principal",
",",
"String",
"portletDefinitionId",
")",
"throws",
"AuthorizationException",
"{",
"final",
"String",
"owner",
"=",
"IPermission",
".",
"PORTAL... | Answers if the principal has permission to MANAGE this Channel.
@param principal IAuthorizationPrincipal The user who wants to manage the portlet
@param portletDefinitionId The Id of the portlet being managed
@return True if the specified user is allowed to manage the specified portlet; otherwise
false
@exception Auth... | [
"Answers",
"if",
"the",
"principal",
"has",
"permission",
"to",
"MANAGE",
"this",
"Channel",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L273-L332 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.canPrincipalRender | @Override
@RequestCache
public boolean canPrincipalRender(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
// This code simply assumes that anyone who can subscribe to a channel
// should be able to render it. In the future, we'd like to... | java | @Override
@RequestCache
public boolean canPrincipalRender(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
// This code simply assumes that anyone who can subscribe to a channel
// should be able to render it. In the future, we'd like to... | [
"@",
"Override",
"@",
"RequestCache",
"public",
"boolean",
"canPrincipalRender",
"(",
"IAuthorizationPrincipal",
"principal",
",",
"String",
"portletDefinitionId",
")",
"throws",
"AuthorizationException",
"{",
"// This code simply assumes that anyone who can subscribe to a channel"... | Answers if the principal has permission to RENDER this Channel. This implementation currently
delegates to the SUBSCRIBE permission.
@return boolean
@param principal IAuthorizationPrincipal
@param portletDefinitionId
@exception AuthorizationException indicates authorization information could not be retrieved. | [
"Answers",
"if",
"the",
"principal",
"has",
"permission",
"to",
"RENDER",
"this",
"Channel",
".",
"This",
"implementation",
"currently",
"delegates",
"to",
"the",
"SUBSCRIBE",
"permission",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L405-L413 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.canPrincipalSubscribe | @Override
@RequestCache
public boolean canPrincipalSubscribe(
IAuthorizationPrincipal principal, String portletDefinitionId) {
String owner = IPermission.PORTAL_SUBSCRIBE;
// retrieve the indicated channel from the channel registry store and
// determine its current lifecycl... | java | @Override
@RequestCache
public boolean canPrincipalSubscribe(
IAuthorizationPrincipal principal, String portletDefinitionId) {
String owner = IPermission.PORTAL_SUBSCRIBE;
// retrieve the indicated channel from the channel registry store and
// determine its current lifecycl... | [
"@",
"Override",
"@",
"RequestCache",
"public",
"boolean",
"canPrincipalSubscribe",
"(",
"IAuthorizationPrincipal",
"principal",
",",
"String",
"portletDefinitionId",
")",
"{",
"String",
"owner",
"=",
"IPermission",
".",
"PORTAL_SUBSCRIBE",
";",
"// retrieve the indicated... | Answers if the principal has permission to SUBSCRIBE to this Channel.
@return boolean
@param principal IAuthorizationPrincipal
@param portletDefinitionId
@exception AuthorizationException indicates authorization information could not be retrieved. | [
"Answers",
"if",
"the",
"principal",
"has",
"permission",
"to",
"SUBSCRIBE",
"to",
"this",
"Channel",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L473-L514 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.newPrincipal | @Override
public IAuthorizationPrincipal newPrincipal(String key, Class type) {
final Tuple<String, Class> principalKey = new Tuple<>(key, type);
final Element element = this.principalCache.get(principalKey);
// principalCache is self populating, it can never return a null entry
retu... | java | @Override
public IAuthorizationPrincipal newPrincipal(String key, Class type) {
final Tuple<String, Class> principalKey = new Tuple<>(key, type);
final Element element = this.principalCache.get(principalKey);
// principalCache is self populating, it can never return a null entry
retu... | [
"@",
"Override",
"public",
"IAuthorizationPrincipal",
"newPrincipal",
"(",
"String",
"key",
",",
"Class",
"type",
")",
"{",
"final",
"Tuple",
"<",
"String",
",",
"Class",
">",
"principalKey",
"=",
"new",
"Tuple",
"<>",
"(",
"key",
",",
"type",
")",
";",
... | Factory method for IAuthorizationPrincipal. First check the principal cache, and if not
present, create the principal and cache it.
@return org.apereo.portal.security.IAuthorizationPrincipal
@param key java.lang.String
@param type java.lang.Class | [
"Factory",
"method",
"for",
"IAuthorizationPrincipal",
".",
"First",
"check",
"the",
"principal",
"cache",
"and",
"if",
"not",
"present",
"create",
"the",
"principal",
"and",
"cache",
"it",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L928-L934 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.primGetPermissionsForPrincipal | private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal)
throws AuthorizationException {
if (!this.cachePermissions) {
return getUncachedPermissionsForPrincipal(principal, null, null, null);
}
IPermissionSet ps = null;
// Check the ... | java | private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal)
throws AuthorizationException {
if (!this.cachePermissions) {
return getUncachedPermissionsForPrincipal(principal, null, null, null);
}
IPermissionSet ps = null;
// Check the ... | [
"private",
"IPermission",
"[",
"]",
"primGetPermissionsForPrincipal",
"(",
"IAuthorizationPrincipal",
"principal",
")",
"throws",
"AuthorizationException",
"{",
"if",
"(",
"!",
"this",
".",
"cachePermissions",
")",
"{",
"return",
"getUncachedPermissionsForPrincipal",
"(",... | Returns permissions for a principal. First check the entity caching service, and if the
permissions have not been cached, retrieve and cache them.
@return IPermission[]
@param principal org.apereo.portal.security.IAuthorizationPrincipal | [
"Returns",
"permissions",
"for",
"a",
"principal",
".",
"First",
"check",
"the",
"entity",
"caching",
"service",
"and",
"if",
"the",
"permissions",
"have",
"not",
"been",
"cached",
"retrieve",
"and",
"cache",
"them",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L974-L995 | train |
Jasig/uPortal | uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java | PortletDefinitionImporterExporter.getUsernameForUserId | private String getUsernameForUserId(int id) {
if (id > 0) {
String username = userIdentityStore.getPortalUserName(id);
if (username != null) {
return username;
}
logger.warn(
"Invalid userID {} found when exporting a portlet; re... | java | private String getUsernameForUserId(int id) {
if (id > 0) {
String username = userIdentityStore.getPortalUserName(id);
if (username != null) {
return username;
}
logger.warn(
"Invalid userID {} found when exporting a portlet; re... | [
"private",
"String",
"getUsernameForUserId",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"id",
">",
"0",
")",
"{",
"String",
"username",
"=",
"userIdentityStore",
".",
"getPortalUserName",
"(",
"id",
")",
";",
"if",
"(",
"username",
"!=",
"null",
")",
"{",
... | Returns the username for a valid userId, else the system username | [
"Returns",
"the",
"username",
"for",
"a",
"valid",
"userId",
"else",
"the",
"system",
"username"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java#L170-L181 | train |
Jasig/uPortal | uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java | PortletDefinitionImporterExporter.savePortletDefinition | private IPortletDefinition savePortletDefinition(
IPortletDefinition definition,
List<PortletCategory> categories,
Map<ExternalPermissionDefinition, Set<IGroupMember>> permissionMap) {
boolean newChannel = (definition.getPortletDefinitionId() == null);
// save the ch... | java | private IPortletDefinition savePortletDefinition(
IPortletDefinition definition,
List<PortletCategory> categories,
Map<ExternalPermissionDefinition, Set<IGroupMember>> permissionMap) {
boolean newChannel = (definition.getPortletDefinitionId() == null);
// save the ch... | [
"private",
"IPortletDefinition",
"savePortletDefinition",
"(",
"IPortletDefinition",
"definition",
",",
"List",
"<",
"PortletCategory",
">",
"categories",
",",
"Map",
"<",
"ExternalPermissionDefinition",
",",
"Set",
"<",
"IGroupMember",
">",
">",
"permissionMap",
")",
... | Save a portlet definition.
@param definition the portlet definition
@param categories the list of categories for the portlet
@param permissionMap a map of permission name -> list of groups who are granted that
permission (Note: for now, only grant is supported and only for the FRAMEWORK_OWNER perm
manager) | [
"Save",
"a",
"portlet",
"definition",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java#L219-L306 | train |
Jasig/uPortal | uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java | PortletDefinitionImporterExporter.getCalendar | private static Calendar getCalendar(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar;
} | java | private static Calendar getCalendar(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar;
} | [
"private",
"static",
"Calendar",
"getCalendar",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"calendar",
".",
"setTime",
"(",
"date",
")",
";",
"return",
"calendar",
";",
"}"
] | Utility method to convert a date to a calendar. | [
"Utility",
"method",
"to",
"convert",
"a",
"date",
"to",
"a",
"calendar",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java#L363-L367 | train |
Jasig/uPortal | uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java | PortletDefinitionImporterExporter.toGroupMembers | private Set<IGroupMember> toGroupMembers(List<String> groupNames, String fname) {
final Set<IGroupMember> groups = new HashSet<>();
for (String groupName : groupNames) {
// Assumes the groupName case matches the DB values.
EntityIdentifier[] gs =
GroupService.... | java | private Set<IGroupMember> toGroupMembers(List<String> groupNames, String fname) {
final Set<IGroupMember> groups = new HashSet<>();
for (String groupName : groupNames) {
// Assumes the groupName case matches the DB values.
EntityIdentifier[] gs =
GroupService.... | [
"private",
"Set",
"<",
"IGroupMember",
">",
"toGroupMembers",
"(",
"List",
"<",
"String",
">",
"groupNames",
",",
"String",
"fname",
")",
"{",
"final",
"Set",
"<",
"IGroupMember",
">",
"groups",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"... | Convert a list of group names to a list of groups.
@param groupNames the list of group names - case sensitive.
@return the list of groups. | [
"Convert",
"a",
"list",
"of",
"group",
"names",
"to",
"a",
"list",
"of",
"groups",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java#L521-L545 | train |
Jasig/uPortal | uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java | PortletDefinitionImporterExporter.toExternalPermissionDefinition | private ExternalPermissionDefinition toExternalPermissionDefinition(
String system, String activity) {
ExternalPermissionDefinition def = ExternalPermissionDefinition.find(system, activity);
if (def != null) {
return def;
}
String delim = "";
StringBuilde... | java | private ExternalPermissionDefinition toExternalPermissionDefinition(
String system, String activity) {
ExternalPermissionDefinition def = ExternalPermissionDefinition.find(system, activity);
if (def != null) {
return def;
}
String delim = "";
StringBuilde... | [
"private",
"ExternalPermissionDefinition",
"toExternalPermissionDefinition",
"(",
"String",
"system",
",",
"String",
"activity",
")",
"{",
"ExternalPermissionDefinition",
"def",
"=",
"ExternalPermissionDefinition",
".",
"find",
"(",
"system",
",",
"activity",
")",
";",
... | Check that a permission type from the XML file matches with a real permission.
@param system The name of the permission manager
@param activity The name of the permission to search for.
@return the permission type string to use
@throws IllegalArgumentException if an unsupported permission type is specified | [
"Check",
"that",
"a",
"permission",
"type",
"from",
"the",
"XML",
"file",
"matches",
"with",
"a",
"real",
"permission",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-io/uPortal-io-types/src/main/java/org/apereo/portal/io/xml/portlet/PortletDefinitionImporterExporter.java#L555-L578 | train |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/cache/PortletCachingHeaderUtils.java | PortletCachingHeaderUtils.setCachingHeaders | public static void setCachingHeaders(
int maxAge,
boolean publicScope,
long lastModified,
PortletResourceOutputHandler portletResourceOutputHandler) {
if (maxAge != 0) {
portletResourceOutputHandler.setDateHeader("Last-Modified", lastModified);
... | java | public static void setCachingHeaders(
int maxAge,
boolean publicScope,
long lastModified,
PortletResourceOutputHandler portletResourceOutputHandler) {
if (maxAge != 0) {
portletResourceOutputHandler.setDateHeader("Last-Modified", lastModified);
... | [
"public",
"static",
"void",
"setCachingHeaders",
"(",
"int",
"maxAge",
",",
"boolean",
"publicScope",
",",
"long",
"lastModified",
",",
"PortletResourceOutputHandler",
"portletResourceOutputHandler",
")",
"{",
"if",
"(",
"maxAge",
"!=",
"0",
")",
"{",
"portletResour... | Set the Last-Modified, CacheControl, and Expires headers based on the maxAge, publicScope and
lastModified.
@param maxAge Maximum age for the content, follows the portlet rules (-1 cache forever, 0
cache never, N cache seconds)
@param publicScope If the content is public
@param lastModified The last modification times... | [
"Set",
"the",
"Last",
"-",
"Modified",
"CacheControl",
"and",
"Expires",
"headers",
"based",
"on",
"the",
"maxAge",
"publicScope",
"and",
"lastModified",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/cache/PortletCachingHeaderUtils.java#L58-L81 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAEditRestriction.java | LPAEditRestriction.perform | @Override
public void perform() throws PortalException {
Element plfNode = HandlerUtils.getPLFNode(ilfNode, person, false, false);
if (plfNode == null) return;
changeRestriction(Constants.ATT_MOVE_ALLOWED, plfNode, moveAllowed);
changeRestriction(Constants.ATT_MOVE_ALLOWED, ilfNode... | java | @Override
public void perform() throws PortalException {
Element plfNode = HandlerUtils.getPLFNode(ilfNode, person, false, false);
if (plfNode == null) return;
changeRestriction(Constants.ATT_MOVE_ALLOWED, plfNode, moveAllowed);
changeRestriction(Constants.ATT_MOVE_ALLOWED, ilfNode... | [
"@",
"Override",
"public",
"void",
"perform",
"(",
")",
"throws",
"PortalException",
"{",
"Element",
"plfNode",
"=",
"HandlerUtils",
".",
"getPLFNode",
"(",
"ilfNode",
",",
"person",
",",
"false",
",",
"false",
")",
";",
"if",
"(",
"plfNode",
"==",
"null",... | Pushes the indicated restriction attribute changes into both the ILF and PLF versions of the
layouts since this will only be done when editing a fragment. | [
"Pushes",
"the",
"indicated",
"restriction",
"attribute",
"changes",
"into",
"both",
"the",
"ILF",
"and",
"PLF",
"versions",
"of",
"the",
"layouts",
"since",
"this",
"will",
"only",
"be",
"done",
"when",
"editing",
"a",
"fragment",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAEditRestriction.java#L49-L68 | train |
Jasig/uPortal | uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/portlet/container/services/CasTicketUserInfoService.java | CasTicketUserInfoService.getProxyTicket | private String getProxyTicket(PortletRequest request) {
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
// try to determine the URL for our portlet
String targetService = null;
try {
URL url = null;
... | java | private String getProxyTicket(PortletRequest request) {
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
// try to determine the URL for our portlet
String targetService = null;
try {
URL url = null;
... | [
"private",
"String",
"getProxyTicket",
"(",
"PortletRequest",
"request",
")",
"{",
"final",
"HttpServletRequest",
"httpServletRequest",
"=",
"this",
".",
"portalRequestUtils",
".",
"getPortletHttpRequest",
"(",
"request",
")",
";",
"// try to determine the URL for our portl... | Attempt to get a proxy ticket for the current portlet.
@param request portlet request
@return a proxy ticket, or <code>null</code> if we were unsuccessful | [
"Attempt",
"to",
"get",
"a",
"proxy",
"ticket",
"for",
"the",
"current",
"portlet",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/portlet/container/services/CasTicketUserInfoService.java#L177-L238 | train |
Jasig/uPortal | uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/portlet/container/services/CasTicketUserInfoService.java | CasTicketUserInfoService.getCasContext | @SuppressWarnings("unchecked")
private static ISecurityContext getCasContext(ISecurityContext context) {
if (context instanceof ICasSecurityContext) {
return context;
}
Enumeration contextEnum = context.getSubContexts();
while (contextEnum.hasMoreElements()) {
... | java | @SuppressWarnings("unchecked")
private static ISecurityContext getCasContext(ISecurityContext context) {
if (context instanceof ICasSecurityContext) {
return context;
}
Enumeration contextEnum = context.getSubContexts();
while (contextEnum.hasMoreElements()) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"ISecurityContext",
"getCasContext",
"(",
"ISecurityContext",
"context",
")",
"{",
"if",
"(",
"context",
"instanceof",
"ICasSecurityContext",
")",
"{",
"return",
"context",
";",
"}",
"Enumerati... | Looks for a security context
@param context the principal security context
@return the CAS security context, or null if not found. | [
"Looks",
"for",
"a",
"security",
"context"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/portlet/container/services/CasTicketUserInfoService.java#L246-L259 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/aggr/AggregationIntervalHelperImpl.java | AggregationIntervalHelperImpl.getAcademicTermsAfter | protected List<AcademicTermDetail> getAcademicTermsAfter(DateTime start) {
final List<AcademicTermDetail> terms =
this.eventAggregationManagementDao.getAcademicTermDetails();
final int index =
Collections.binarySearch(
terms,
... | java | protected List<AcademicTermDetail> getAcademicTermsAfter(DateTime start) {
final List<AcademicTermDetail> terms =
this.eventAggregationManagementDao.getAcademicTermDetails();
final int index =
Collections.binarySearch(
terms,
... | [
"protected",
"List",
"<",
"AcademicTermDetail",
">",
"getAcademicTermsAfter",
"(",
"DateTime",
"start",
")",
"{",
"final",
"List",
"<",
"AcademicTermDetail",
">",
"terms",
"=",
"this",
".",
"eventAggregationManagementDao",
".",
"getAcademicTermDetails",
"(",
")",
";... | Return a sorted list of AcademicTermDetail objects where the the first element of the list
where the first element is the first term that starts after the specified start DateTime. | [
"Return",
"a",
"sorted",
"list",
"of",
"AcademicTermDetail",
"objects",
"where",
"the",
"the",
"first",
"element",
"of",
"the",
"list",
"where",
"the",
"first",
"element",
"is",
"the",
"first",
"term",
"that",
"starts",
"after",
"the",
"specified",
"start",
... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/aggr/AggregationIntervalHelperImpl.java#L248-L262 | train |
Jasig/uPortal | uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java | FileSystemGroupStore.getFileRoot | protected File getFileRoot(Class type) {
String path = getGroupsRootPath() + type.getName();
File f = new File(path);
return (f.exists()) ? f : null;
} | java | protected File getFileRoot(Class type) {
String path = getGroupsRootPath() + type.getName();
File f = new File(path);
return (f.exists()) ? f : null;
} | [
"protected",
"File",
"getFileRoot",
"(",
"Class",
"type",
")",
"{",
"String",
"path",
"=",
"getGroupsRootPath",
"(",
")",
"+",
"type",
".",
"getName",
"(",
")",
";",
"File",
"f",
"=",
"new",
"File",
"(",
"path",
")",
";",
"return",
"(",
"f",
".",
"... | Returns a File that is the root for groups of the given type. | [
"Returns",
"a",
"File",
"that",
"is",
"the",
"root",
"for",
"groups",
"of",
"the",
"given",
"type",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java#L572-L576 | train |
Jasig/uPortal | uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java | FileSystemGroupStore.primGetAllDirectoriesBelow | private void primGetAllDirectoriesBelow(File dir, Set allDirectories) {
File[] files = dir.listFiles(fileFilter);
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
primGetAllDirectoriesBelow(files[i], allDirectories);
allDirectories.add(fi... | java | private void primGetAllDirectoriesBelow(File dir, Set allDirectories) {
File[] files = dir.listFiles(fileFilter);
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
primGetAllDirectoriesBelow(files[i], allDirectories);
allDirectories.add(fi... | [
"private",
"void",
"primGetAllDirectoriesBelow",
"(",
"File",
"dir",
",",
"Set",
"allDirectories",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"dir",
".",
"listFiles",
"(",
"fileFilter",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"files",... | Returns all directories under dir. | [
"Returns",
"all",
"directories",
"under",
"dir",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java#L706-L714 | train |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/security/remoting/PermissionAssignmentMapController.java | PermissionAssignmentMapController.deletePermission | @RequestMapping(value = "/deletePermission", method = RequestMethod.POST)
public void deletePermission(
@RequestParam("principal") String principal,
@RequestParam("owner") String owner,
@RequestParam("activity") String activity,
@RequestParam("target") String target,
... | java | @RequestMapping(value = "/deletePermission", method = RequestMethod.POST)
public void deletePermission(
@RequestParam("principal") String principal,
@RequestParam("owner") String owner,
@RequestParam("activity") String activity,
@RequestParam("target") String target,
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/deletePermission\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"void",
"deletePermission",
"(",
"@",
"RequestParam",
"(",
"\"principal\"",
")",
"String",
"principal",
",",
"@",
"RequestParam",
... | Deletes a specific permission
@param principal
@param assignment
@param owner
@param activity
@param target
@param request
@param response
@throws Exception | [
"Deletes",
"a",
"specific",
"permission"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/security/remoting/PermissionAssignmentMapController.java#L156-L193 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java | PortletExecutionManager.cancelWorker | protected void cancelWorker(
HttpServletRequest request, IPortletExecutionWorker<?> portletExecutionWorker) {
final IPortletWindowId portletWindowId = portletExecutionWorker.getPortletWindowId();
final IPortletWindow portletWindow =
this.portletWindowRegistry.getPortletWindow... | java | protected void cancelWorker(
HttpServletRequest request, IPortletExecutionWorker<?> portletExecutionWorker) {
final IPortletWindowId portletWindowId = portletExecutionWorker.getPortletWindowId();
final IPortletWindow portletWindow =
this.portletWindowRegistry.getPortletWindow... | [
"protected",
"void",
"cancelWorker",
"(",
"HttpServletRequest",
"request",
",",
"IPortletExecutionWorker",
"<",
"?",
">",
"portletExecutionWorker",
")",
"{",
"final",
"IPortletWindowId",
"portletWindowId",
"=",
"portletExecutionWorker",
".",
"getPortletWindowId",
"(",
")"... | Cancel the worker and add it to the hung workers queue | [
"Cancel",
"the",
"worker",
"and",
"add",
"it",
"to",
"the",
"hung",
"workers",
"queue"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java#L258-L273 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java | PortletExecutionManager.startPortletHeaderRender | @Override
public void startPortletHeaderRender(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
if (doesPortletNeedHeaderWorker(portletWindowId, request)) {
this.startPortletHeaderRenderInternal(portletWindowId, re... | java | @Override
public void startPortletHeaderRender(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
if (doesPortletNeedHeaderWorker(portletWindowId, request)) {
this.startPortletHeaderRenderInternal(portletWindowId, re... | [
"@",
"Override",
"public",
"void",
"startPortletHeaderRender",
"(",
"IPortletWindowId",
"portletWindowId",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"if",
"(",
"doesPortletNeedHeaderWorker",
"(",
"portletWindowId",
",",
"reque... | Only actually starts rendering the head if the portlet has the 'javax.portlet.renderHeaders'
container-runtime-option present and set to "true."
@see
IPortletExecutionManager#startPortletHeaderRender(org.apereo.portal.portlet.om.IPortletWindowId,
javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletRes... | [
"Only",
"actually",
"starts",
"rendering",
"the",
"head",
"if",
"the",
"portlet",
"has",
"the",
"javax",
".",
"portlet",
".",
"renderHeaders",
"container",
"-",
"runtime",
"-",
"option",
"present",
"and",
"set",
"to",
"true",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java#L518-L530 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java | PortletExecutionManager.getPortletRenderResult | protected PortletRenderResult getPortletRenderResult(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
final IPortletRenderExecutionWorker tracker =
getRenderedPortletBodyWorker(portletW... | java | protected PortletRenderResult getPortletRenderResult(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
final IPortletRenderExecutionWorker tracker =
getRenderedPortletBodyWorker(portletW... | [
"protected",
"PortletRenderResult",
"getPortletRenderResult",
"(",
"IPortletWindowId",
"portletWindowId",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{",
"final",
"IPortletRenderExecutionWorker",
"tracker",
"=",
"... | Returns the PortletRenderResult waiting up to the portlet's timeout
@return The PortletRenderResult from the portlet's execution
@throws TimeoutException If the portlet's timeout was hit before a result was returned
@throws Exception The exception thrown by the portlet during execution | [
"Returns",
"the",
"PortletRenderResult",
"waiting",
"up",
"to",
"the",
"portlet",
"s",
"timeout"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java#L909-L918 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java | PortletExecutionManager.startPortletHeaderRenderInternal | protected IPortletRenderExecutionWorker startPortletHeaderRenderInternal(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
IPortletRenderExecutionWorker portletHeaderRenderWorker =
this.portletWorkerFactory.createRe... | java | protected IPortletRenderExecutionWorker startPortletHeaderRenderInternal(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
IPortletRenderExecutionWorker portletHeaderRenderWorker =
this.portletWorkerFactory.createRe... | [
"protected",
"IPortletRenderExecutionWorker",
"startPortletHeaderRenderInternal",
"(",
"IPortletWindowId",
"portletWindowId",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"IPortletRenderExecutionWorker",
"portletHeaderRenderWorker",
"=",
"... | create and submit the portlet header rendering job to the thread pool
@param portletWindowId
@param request
@param response
@return | [
"create",
"and",
"submit",
"the",
"portlet",
"header",
"rendering",
"job",
"to",
"the",
"thread",
"pool"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java#L928-L942 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java | PortletExecutionManager.startPortletRenderInternal | protected IPortletRenderExecutionWorker startPortletRenderInternal(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
// first check to see if there is a Throwable in the session for this IPortletWindowId
final Map<IPortletW... | java | protected IPortletRenderExecutionWorker startPortletRenderInternal(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
// first check to see if there is a Throwable in the session for this IPortletWindowId
final Map<IPortletW... | [
"protected",
"IPortletRenderExecutionWorker",
"startPortletRenderInternal",
"(",
"IPortletWindowId",
"portletWindowId",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"// first check to see if there is a Throwable in the session for this IPortletW... | create and submit the portlet content rendering job to the thread pool | [
"create",
"and",
"submit",
"the",
"portlet",
"content",
"rendering",
"job",
"to",
"the",
"thread",
"pool"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletExecutionManager.java#L945-L984 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java | QualityOfServiceBlockingQueue.add | private boolean add(T e, boolean failWhenFull) {
final Queue<T> queue = this.getOrCreateQueue(e);
this.writeLock.lock();
try {
if (this.size == this.capacity) {
if (failWhenFull) {
throw new IllegalStateException("Queue is at capacity: " + this.ca... | java | private boolean add(T e, boolean failWhenFull) {
final Queue<T> queue = this.getOrCreateQueue(e);
this.writeLock.lock();
try {
if (this.size == this.capacity) {
if (failWhenFull) {
throw new IllegalStateException("Queue is at capacity: " + this.ca... | [
"private",
"boolean",
"add",
"(",
"T",
"e",
",",
"boolean",
"failWhenFull",
")",
"{",
"final",
"Queue",
"<",
"T",
">",
"queue",
"=",
"this",
".",
"getOrCreateQueue",
"(",
"e",
")",
";",
"this",
".",
"writeLock",
".",
"lock",
"(",
")",
";",
"try",
"... | Adds the element to the queue
@param failWhenFull If true and the queue is at capacity then this method throws a
IllegalStateException, if false then false is returned
@return true if the element was added, false if not | [
"Adds",
"the",
"element",
"to",
"the",
"queue"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java#L551-L573 | train |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/registry/PortletEntityRegistryImpl.java | PortletEntityRegistryImpl.deletePortletEntity | protected void deletePortletEntity(
HttpServletRequest request, IPortletEntity portletEntity, boolean cacheOnly) {
final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
// Remove from request cache
final PortletEntityCache<IPortletEntity> portletEntityMap =
... | java | protected void deletePortletEntity(
HttpServletRequest request, IPortletEntity portletEntity, boolean cacheOnly) {
final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
// Remove from request cache
final PortletEntityCache<IPortletEntity> portletEntityMap =
... | [
"protected",
"void",
"deletePortletEntity",
"(",
"HttpServletRequest",
"request",
",",
"IPortletEntity",
"portletEntity",
",",
"boolean",
"cacheOnly",
")",
"{",
"final",
"IPortletEntityId",
"portletEntityId",
"=",
"portletEntity",
".",
"getPortletEntityId",
"(",
")",
";... | Delete a portlet entity, removes it from the request, session and persistent stores | [
"Delete",
"a",
"portlet",
"entity",
"removes",
"it",
"from",
"the",
"request",
"session",
"and",
"persistent",
"stores"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/registry/PortletEntityRegistryImpl.java#L580-L613 | train |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/registry/PortletEntityRegistryImpl.java | PortletEntityRegistryImpl.getPortletEntity | protected IPortletEntity getPortletEntity(
HttpServletRequest request,
PortletEntityCache<IPortletEntity> portletEntityCache,
IPortletEntityId portletEntityId,
String layoutNodeId,
int userId) {
IPortletEntity portletEntity;
// First look in ... | java | protected IPortletEntity getPortletEntity(
HttpServletRequest request,
PortletEntityCache<IPortletEntity> portletEntityCache,
IPortletEntityId portletEntityId,
String layoutNodeId,
int userId) {
IPortletEntity portletEntity;
// First look in ... | [
"protected",
"IPortletEntity",
"getPortletEntity",
"(",
"HttpServletRequest",
"request",
",",
"PortletEntityCache",
"<",
"IPortletEntity",
">",
"portletEntityCache",
",",
"IPortletEntityId",
"portletEntityId",
",",
"String",
"layoutNodeId",
",",
"int",
"userId",
")",
"{",... | Lookup the portlet entity by layoutNodeId and userId | [
"Lookup",
"the",
"portlet",
"entity",
"by",
"layoutNodeId",
"and",
"userId"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/registry/PortletEntityRegistryImpl.java#L616-L718 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.getEditSet | private static Element getEditSet(Element node, Document plf, IPerson person, boolean create)
throws PortalException {
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_EDIT_SET)) return (Element) child;
child = c... | java | private static Element getEditSet(Element node, Document plf, IPerson person, boolean create)
throws PortalException {
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_EDIT_SET)) return (Element) child;
child = c... | [
"private",
"static",
"Element",
"getEditSet",
"(",
"Element",
"node",
",",
"Document",
"plf",
",",
"IPerson",
"person",
",",
"boolean",
"create",
")",
"throws",
"PortalException",
"{",
"Node",
"child",
"=",
"node",
".",
"getFirstChild",
"(",
")",
";",
"while... | Get the edit set if any stored in the passed in node. If not found and if the create flag is
true then create a new edit set and add it as a child to the passed in node. Then return it. | [
"Get",
"the",
"edit",
"set",
"if",
"any",
"stored",
"in",
"the",
"passed",
"in",
"node",
".",
"If",
"not",
"found",
"and",
"if",
"the",
"create",
"flag",
"is",
"true",
"then",
"create",
"a",
"new",
"edit",
"set",
"and",
"add",
"it",
"as",
"a",
"chi... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L54-L82 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.addEditDirective | static void addEditDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
addDirective(plfNode, attributeName, Constants.ELM_EDIT, person);
} | java | static void addEditDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
addDirective(plfNode, attributeName, Constants.ELM_EDIT, person);
} | [
"static",
"void",
"addEditDirective",
"(",
"Element",
"plfNode",
",",
"String",
"attributeName",
",",
"IPerson",
"person",
")",
"throws",
"PortalException",
"{",
"addDirective",
"(",
"plfNode",
",",
"attributeName",
",",
"Constants",
".",
"ELM_EDIT",
",",
"person"... | Create and append an edit directive to the edit set if not there. This only records that the
attribute was changed and the value in the plf copy node should be used, if allowed, during
the merge at login time. | [
"Create",
"and",
"append",
"an",
"edit",
"directive",
"to",
"the",
"edit",
"set",
"if",
"not",
"there",
".",
"This",
"only",
"records",
"that",
"the",
"attribute",
"was",
"changed",
"and",
"the",
"value",
"in",
"the",
"plf",
"copy",
"node",
"should",
"be... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L89-L92 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.addPrefsDirective | public static void addPrefsDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
addDirective(plfNode, attributeName, Constants.ELM_PREF, person);
} | java | public static void addPrefsDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
addDirective(plfNode, attributeName, Constants.ELM_PREF, person);
} | [
"public",
"static",
"void",
"addPrefsDirective",
"(",
"Element",
"plfNode",
",",
"String",
"attributeName",
",",
"IPerson",
"person",
")",
"throws",
"PortalException",
"{",
"addDirective",
"(",
"plfNode",
",",
"attributeName",
",",
"Constants",
".",
"ELM_PREF",
",... | Create and append a user preferences edit directive to the edit set if not there. This only
records that the attribute was changed. The value will be in the user preferences object for
the user. | [
"Create",
"and",
"append",
"a",
"user",
"preferences",
"edit",
"directive",
"to",
"the",
"edit",
"set",
"if",
"not",
"there",
".",
"This",
"only",
"records",
"that",
"the",
"attribute",
"was",
"changed",
".",
"The",
"value",
"will",
"be",
"in",
"the",
"u... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L99-L102 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.addDirective | private static void addDirective(
Element plfNode, String attributeName, String type, IPerson person)
throws PortalException {
Document plf = (Document) person.getAttribute(Constants.PLF);
Element editSet = getEditSet(plfNode, plf, person, true);
// see if attributes has... | java | private static void addDirective(
Element plfNode, String attributeName, String type, IPerson person)
throws PortalException {
Document plf = (Document) person.getAttribute(Constants.PLF);
Element editSet = getEditSet(plfNode, plf, person, true);
// see if attributes has... | [
"private",
"static",
"void",
"addDirective",
"(",
"Element",
"plfNode",
",",
"String",
"attributeName",
",",
"String",
"type",
",",
"IPerson",
"person",
")",
"throws",
"PortalException",
"{",
"Document",
"plf",
"=",
"(",
"Document",
")",
"person",
".",
"getAtt... | Create and append an edit directive to the edit set if not there. | [
"Create",
"and",
"append",
"an",
"edit",
"directive",
"to",
"the",
"edit",
"set",
"if",
"not",
"there",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L105-L140 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.applyEditSet | public static boolean applyEditSet(Element plfChild, Element original) {
// first get edit set if it exists
Element editSet = null;
try {
editSet = getEditSet(plfChild, null, null, false);
} catch (Exception e) {
// should never occur unless problem during create ... | java | public static boolean applyEditSet(Element plfChild, Element original) {
// first get edit set if it exists
Element editSet = null;
try {
editSet = getEditSet(plfChild, null, null, false);
} catch (Exception e) {
// should never occur unless problem during create ... | [
"public",
"static",
"boolean",
"applyEditSet",
"(",
"Element",
"plfChild",
",",
"Element",
"original",
")",
"{",
"// first get edit set if it exists",
"Element",
"editSet",
"=",
"null",
";",
"try",
"{",
"editSet",
"=",
"getEditSet",
"(",
"plfChild",
",",
"null",
... | Evaluate whether attribute changes exist in the ilfChild and if so apply them. Returns true
if some changes existed. If changes existed but matched those in the original node then they
are not applicable, are removed from the editSet, and false is returned. | [
"Evaluate",
"whether",
"attribute",
"changes",
"exist",
"in",
"the",
"ilfChild",
"and",
"if",
"so",
"apply",
"them",
".",
"Returns",
"true",
"if",
"some",
"changes",
"existed",
".",
"If",
"changes",
"existed",
"but",
"matched",
"those",
"in",
"the",
"origina... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L147-L212 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.removeDirective | private static void removeDirective(
String elementId, String attributeName, String type, IPerson person) {
Document plf = (Document) person.getAttribute(Constants.PLF);
Element node = plf.getElementById(elementId);
if (node == null) return;
Element editSet = null;
... | java | private static void removeDirective(
String elementId, String attributeName, String type, IPerson person) {
Document plf = (Document) person.getAttribute(Constants.PLF);
Element node = plf.getElementById(elementId);
if (node == null) return;
Element editSet = null;
... | [
"private",
"static",
"void",
"removeDirective",
"(",
"String",
"elementId",
",",
"String",
"attributeName",
",",
"String",
"type",
",",
"IPerson",
"person",
")",
"{",
"Document",
"plf",
"=",
"(",
"Document",
")",
"person",
".",
"getAttribute",
"(",
"Constants"... | Searches for a command of the passed-in type and if found removes it from the user's PLF. | [
"Searches",
"for",
"a",
"command",
"of",
"the",
"passed",
"-",
"in",
"type",
"and",
"if",
"found",
"removes",
"it",
"from",
"the",
"user",
"s",
"PLF",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L232-L272 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/PortletCookieServiceImpl.java | PortletCookieServiceImpl.removeExpiredPortletCookies | protected void removeExpiredPortletCookies(HttpServletRequest request) {
Map<String, SessionOnlyPortletCookieImpl> sessionOnlyCookies =
getSessionOnlyPortletCookieMap(request);
for (Entry<String, SessionOnlyPortletCookieImpl> entry : sessionOnlyCookies.entrySet()) {
String ke... | java | protected void removeExpiredPortletCookies(HttpServletRequest request) {
Map<String, SessionOnlyPortletCookieImpl> sessionOnlyCookies =
getSessionOnlyPortletCookieMap(request);
for (Entry<String, SessionOnlyPortletCookieImpl> entry : sessionOnlyCookies.entrySet()) {
String ke... | [
"protected",
"void",
"removeExpiredPortletCookies",
"(",
"HttpServletRequest",
"request",
")",
"{",
"Map",
"<",
"String",
",",
"SessionOnlyPortletCookieImpl",
">",
"sessionOnlyCookies",
"=",
"getSessionOnlyPortletCookieMap",
"(",
"request",
")",
";",
"for",
"(",
"Entry"... | Remove expired session only portlet cookies.
@param request | [
"Remove",
"expired",
"session",
"only",
"portlet",
"cookies",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/PortletCookieServiceImpl.java#L207-L217 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/DTDResolver.java | DTDResolver.resolveEntity | @Override
public InputSource resolveEntity(String publicId, String systemId) {
InputStream inStream = null;
// Check for a match on the systemId
if (systemId != null) {
if (dtdName != null && systemId.indexOf(dtdName) != -1) {
inStream = getResourceAsStream(dtdPa... | java | @Override
public InputSource resolveEntity(String publicId, String systemId) {
InputStream inStream = null;
// Check for a match on the systemId
if (systemId != null) {
if (dtdName != null && systemId.indexOf(dtdName) != -1) {
inStream = getResourceAsStream(dtdPa... | [
"@",
"Override",
"public",
"InputSource",
"resolveEntity",
"(",
"String",
"publicId",
",",
"String",
"systemId",
")",
"{",
"InputStream",
"inStream",
"=",
"null",
";",
"// Check for a match on the systemId",
"if",
"(",
"systemId",
"!=",
"null",
")",
"{",
"if",
"... | Sets up a new input source based on the dtd specified in the xml document
@param publicId the public ID
@param systemId the system ID
@return an input source based on the dtd specified in the xml document or null if we don't
have a dtd that matches systemId or publicId | [
"Sets",
"up",
"a",
"new",
"input",
"source",
"based",
"on",
"the",
"dtd",
"specified",
"in",
"the",
"xml",
"document"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/DTDResolver.java#L73-L107 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/url/PortalUrlProviderImpl.java | PortalUrlProviderImpl.verifyPortletWindowId | protected String verifyPortletWindowId(
HttpServletRequest request, IPortletWindowId portletWindowId) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final... | java | protected String verifyPortletWindowId(
HttpServletRequest request, IPortletWindowId portletWindowId) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final... | [
"protected",
"String",
"verifyPortletWindowId",
"(",
"HttpServletRequest",
"request",
",",
"IPortletWindowId",
"portletWindowId",
")",
"{",
"final",
"IUserInstance",
"userInstance",
"=",
"this",
".",
"userInstanceManager",
".",
"getUserInstance",
"(",
"request",
")",
";... | Verify the requested portlet window corresponds to a node in the user's layout and return the
corresponding layout node id | [
"Verify",
"the",
"requested",
"portlet",
"window",
"corresponds",
"to",
"a",
"node",
"in",
"the",
"user",
"s",
"layout",
"and",
"return",
"the",
"corresponding",
"layout",
"node",
"id"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/url/PortalUrlProviderImpl.java#L216-L241 | train |
Jasig/uPortal | uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/EntityNameFinderService.java | EntityNameFinderService.initialize | private synchronized void initialize() {
Iterator types = EntityTypesLocator.getEntityTypes().getAllEntityTypes();
String factoryName = null;
while (types.hasNext()) {
Class type = (Class) types.next();
if (type != Object.class) {
String factoryKey =
... | java | private synchronized void initialize() {
Iterator types = EntityTypesLocator.getEntityTypes().getAllEntityTypes();
String factoryName = null;
while (types.hasNext()) {
Class type = (Class) types.next();
if (type != Object.class) {
String factoryKey =
... | [
"private",
"synchronized",
"void",
"initialize",
"(",
")",
"{",
"Iterator",
"types",
"=",
"EntityTypesLocator",
".",
"getEntityTypes",
"(",
")",
".",
"getAllEntityTypes",
"(",
")",
";",
"String",
"factoryName",
"=",
"null",
";",
"while",
"(",
"types",
".",
"... | Gets all the entity types and tries to instantiate and cache a finder for each one. There
needn't be a finder for every entity type, so if there's no entry in the portal.properties,
we just log the fact and continue. | [
"Gets",
"all",
"the",
"entity",
"types",
"and",
"tries",
"to",
"instantiate",
"and",
"cache",
"a",
"finder",
"for",
"each",
"one",
".",
"There",
"needn",
"t",
"be",
"a",
"finder",
"for",
"every",
"entity",
"type",
"so",
"if",
"there",
"s",
"no",
"entry... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/EntityNameFinderService.java#L61-L98 | train |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java | ReferenceIndividualGroupService.synchronizeGroupMembersOnDelete | protected void synchronizeGroupMembersOnDelete(IEntityGroup group) throws GroupsException {
GroupMemberImpl gmi = null;
for (Iterator it = group.getChildren().iterator(); it.hasNext(); ) {
gmi = (GroupMemberImpl) it.next();
gmi.invalidateInParentGroupsCache(Collections.singleton... | java | protected void synchronizeGroupMembersOnDelete(IEntityGroup group) throws GroupsException {
GroupMemberImpl gmi = null;
for (Iterator it = group.getChildren().iterator(); it.hasNext(); ) {
gmi = (GroupMemberImpl) it.next();
gmi.invalidateInParentGroupsCache(Collections.singleton... | [
"protected",
"void",
"synchronizeGroupMembersOnDelete",
"(",
"IEntityGroup",
"group",
")",
"throws",
"GroupsException",
"{",
"GroupMemberImpl",
"gmi",
"=",
"null",
";",
"for",
"(",
"Iterator",
"it",
"=",
"group",
".",
"getChildren",
"(",
")",
".",
"iterator",
"(... | Remove the back pointers of the group members of the deleted group. Then update the cache to
invalidate copies on peer servers.
@param group ILockableEntityGroup | [
"Remove",
"the",
"back",
"pointers",
"of",
"the",
"group",
"members",
"of",
"the",
"deleted",
"group",
".",
"Then",
"update",
"the",
"cache",
"to",
"invalidate",
"copies",
"on",
"peer",
"servers",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java#L703-L713 | train |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java | ReferenceIndividualGroupService.synchronizeGroupMembersOnUpdate | protected void synchronizeGroupMembersOnUpdate(IEntityGroup group) throws GroupsException {
EntityGroupImpl egi = (EntityGroupImpl) group;
GroupMemberImpl gmi = null;
for (Iterator it = egi.getAddedMembers().values().iterator(); it.hasNext(); ) {
gmi = (GroupMemberImpl) it.next();
... | java | protected void synchronizeGroupMembersOnUpdate(IEntityGroup group) throws GroupsException {
EntityGroupImpl egi = (EntityGroupImpl) group;
GroupMemberImpl gmi = null;
for (Iterator it = egi.getAddedMembers().values().iterator(); it.hasNext(); ) {
gmi = (GroupMemberImpl) it.next();
... | [
"protected",
"void",
"synchronizeGroupMembersOnUpdate",
"(",
"IEntityGroup",
"group",
")",
"throws",
"GroupsException",
"{",
"EntityGroupImpl",
"egi",
"=",
"(",
"EntityGroupImpl",
")",
"group",
";",
"GroupMemberImpl",
"gmi",
"=",
"null",
";",
"for",
"(",
"Iterator",... | Adjust the back pointers of the updated group members to either add or remove the parent
group. Then update the cache to invalidate copies on peer servers.
@param group ILockableEntityGroup | [
"Adjust",
"the",
"back",
"pointers",
"of",
"the",
"updated",
"group",
"members",
"to",
"either",
"add",
"or",
"remove",
"the",
"parent",
"group",
".",
"Then",
"update",
"the",
"cache",
"to",
"invalidate",
"copies",
"on",
"peer",
"servers",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java#L721-L740 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/dao/jpa/ThreadContextClassLoaderAspect.java | ThreadContextClassLoaderAspect.doThreadContextClassLoaderUpdate | public Object doThreadContextClassLoaderUpdate(ProceedingJoinPoint pjp) throws Throwable {
final Thread currentThread = Thread.currentThread();
final ClassLoader previousClassLoader = currentThread.getContextClassLoader();
Deque<ClassLoader> deque = PREVIOUS_CLASS_LOADER.get();
if (deque... | java | public Object doThreadContextClassLoaderUpdate(ProceedingJoinPoint pjp) throws Throwable {
final Thread currentThread = Thread.currentThread();
final ClassLoader previousClassLoader = currentThread.getContextClassLoader();
Deque<ClassLoader> deque = PREVIOUS_CLASS_LOADER.get();
if (deque... | [
"public",
"Object",
"doThreadContextClassLoaderUpdate",
"(",
"ProceedingJoinPoint",
"pjp",
")",
"throws",
"Throwable",
"{",
"final",
"Thread",
"currentThread",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"final",
"ClassLoader",
"previousClassLoader",
"=",
"cur... | Wraps the targeted execution, switching the current thread's context class loader to this
classes class loader. Usage defined in persistanceContext.xml. | [
"Wraps",
"the",
"targeted",
"execution",
"switching",
"the",
"current",
"thread",
"s",
"context",
"class",
"loader",
"to",
"this",
"classes",
"class",
"loader",
".",
"Usage",
"defined",
"in",
"persistanceContext",
".",
"xml",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/dao/jpa/ThreadContextClassLoaderAspect.java#L50-L72 | train |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/ImportExportController.java | ImportExportController.deleteEntity | @RequestMapping(value = "/entity/{entityType}/{entityId}", method = RequestMethod.DELETE)
public void deleteEntity(
@PathVariable("entityType") String entityType,
@PathVariable("entityId") String entityId,
HttpServletRequest request,
HttpServletResponse response)
... | java | @RequestMapping(value = "/entity/{entityType}/{entityId}", method = RequestMethod.DELETE)
public void deleteEntity(
@PathVariable("entityType") String entityType,
@PathVariable("entityId") String entityId,
HttpServletRequest request,
HttpServletResponse response)
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/entity/{entityType}/{entityId}\"",
",",
"method",
"=",
"RequestMethod",
".",
"DELETE",
")",
"public",
"void",
"deleteEntity",
"(",
"@",
"PathVariable",
"(",
"\"entityType\"",
")",
"String",
"entityType",
",",
"@",
"Pat... | Delete an uPortal database object. This method provides a REST interface for uPortal database
object deletion.
<p>The path for this method is /entity/type/identifier. The identifier generally a string
that may be used as a unique identifier, but is dependent on the entity type. For example, to
delete the "demo" user o... | [
"Delete",
"an",
"uPortal",
"database",
"object",
".",
"This",
"method",
"provides",
"a",
"REST",
"interface",
"for",
"uPortal",
"database",
"object",
"deletion",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/ImportExportController.java#L135-L157 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/aggr/stat/JpaStatisticalSummary.java | JpaStatisticalSummary.getStandardDeviation | @Override
public double getStandardDeviation() {
double stdDev = Double.NaN;
if (getN() > 0) {
if (getN() > 1) {
stdDev = FastMath.sqrt(getVariance());
} else {
stdDev = 0.0;
}
}
return stdDev;
} | java | @Override
public double getStandardDeviation() {
double stdDev = Double.NaN;
if (getN() > 0) {
if (getN() > 1) {
stdDev = FastMath.sqrt(getVariance());
} else {
stdDev = 0.0;
}
}
return stdDev;
} | [
"@",
"Override",
"public",
"double",
"getStandardDeviation",
"(",
")",
"{",
"double",
"stdDev",
"=",
"Double",
".",
"NaN",
";",
"if",
"(",
"getN",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"getN",
"(",
")",
">",
"1",
")",
"{",
"stdDev",
"=",
"Fast... | Returns the standard deviation of the values that have been added.
<p>Double.NaN is returned if no values have been added.
@return the standard deviation | [
"Returns",
"the",
"standard",
"deviation",
"of",
"the",
"values",
"that",
"have",
"been",
"added",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/aggr/stat/JpaStatisticalSummary.java#L191-L202 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/tincan/providers/BatchTinCanAPIProvider.java | BatchTinCanAPIProvider.sendBatch | public void sendBatch() {
LrsStatement statement = null;
List<LrsStatement> list = new ArrayList<LrsStatement>();
while ((statement = statementQueue.poll()) != null) {
list.add(statement);
}
if (!list.isEmpty()) {
postStatementList(list);
}
} | java | public void sendBatch() {
LrsStatement statement = null;
List<LrsStatement> list = new ArrayList<LrsStatement>();
while ((statement = statementQueue.poll()) != null) {
list.add(statement);
}
if (!list.isEmpty()) {
postStatementList(list);
}
} | [
"public",
"void",
"sendBatch",
"(",
")",
"{",
"LrsStatement",
"statement",
"=",
"null",
";",
"List",
"<",
"LrsStatement",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"LrsStatement",
">",
"(",
")",
";",
"while",
"(",
"(",
"statement",
"=",
"statementQueue",
... | Send a batch of LRS statements. MUST BE SCHEDULED! Failure to properly configure this class
will result in memory leaks. | [
"Send",
"a",
"batch",
"of",
"LRS",
"statements",
".",
"MUST",
"BE",
"SCHEDULED!",
"Failure",
"to",
"properly",
"configure",
"this",
"class",
"will",
"result",
"in",
"memory",
"leaks",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/tincan/providers/BatchTinCanAPIProvider.java#L51-L62 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/tincan/providers/BatchTinCanAPIProvider.java | BatchTinCanAPIProvider.postStatementList | private void postStatementList(List<LrsStatement> list) {
try {
ResponseEntity<Object> response =
sendRequest(
STATEMENTS_REST_ENDPOINT, HttpMethod.POST, null, list, Object.class);
if (response.getStatusCode().series() == Series.SUCCESSFUL)... | java | private void postStatementList(List<LrsStatement> list) {
try {
ResponseEntity<Object> response =
sendRequest(
STATEMENTS_REST_ENDPOINT, HttpMethod.POST, null, list, Object.class);
if (response.getStatusCode().series() == Series.SUCCESSFUL)... | [
"private",
"void",
"postStatementList",
"(",
"List",
"<",
"LrsStatement",
">",
"list",
")",
"{",
"try",
"{",
"ResponseEntity",
"<",
"Object",
">",
"response",
"=",
"sendRequest",
"(",
"STATEMENTS_REST_ENDPOINT",
",",
"HttpMethod",
".",
"POST",
",",
"null",
","... | Send the list of batched LRS statements to the LRS.
@param list the list of statements. | [
"Send",
"the",
"list",
"of",
"batched",
"LRS",
"statements",
"to",
"the",
"LRS",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/tincan/providers/BatchTinCanAPIProvider.java#L69-L98 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/aggr/BaseTimedAggregationStatsImpl.java | BaseTimedAggregationStatsImpl.addValue | public final void addValue(double v) {
if (isComplete()) {
this.getLogger()
.warn(
"{} is already closed, the new value of {} will be ignored on: {}",
this.getClass().getSimpleName(),
v,
... | java | public final void addValue(double v) {
if (isComplete()) {
this.getLogger()
.warn(
"{} is already closed, the new value of {} will be ignored on: {}",
this.getClass().getSimpleName(),
v,
... | [
"public",
"final",
"void",
"addValue",
"(",
"double",
"v",
")",
"{",
"if",
"(",
"isComplete",
"(",
")",
")",
"{",
"this",
".",
"getLogger",
"(",
")",
".",
"warn",
"(",
"\"{} is already closed, the new value of {} will be ignored on: {}\"",
",",
"this",
".",
"g... | Add the value to the summary statistics | [
"Add",
"the",
"value",
"to",
"the",
"summary",
"statistics"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/aggr/BaseTimedAggregationStatsImpl.java#L180-L199 | train |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/ChannelListController.java | ChannelListController.listChannels | @RequestMapping(value = "/portletList", method = RequestMethod.GET)
public ModelAndView listChannels(
WebRequest webRequest,
HttpServletRequest request,
@RequestParam(value = "type", required = false) String type) {
if (TYPE_MANAGE.equals(type)) {
throw new U... | java | @RequestMapping(value = "/portletList", method = RequestMethod.GET)
public ModelAndView listChannels(
WebRequest webRequest,
HttpServletRequest request,
@RequestParam(value = "type", required = false) String type) {
if (TYPE_MANAGE.equals(type)) {
throw new U... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/portletList\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ModelAndView",
"listChannels",
"(",
"WebRequest",
"webRequest",
",",
"HttpServletRequest",
"request",
",",
"@",
"RequestParam",
"(",
"val... | Original, pre-4.3 version of this API. Always returns the entire contents of the Portlet
Registry, including uncategorized portlets, to which the user has access. Access is based on
the SUBSCRIBE permission. | [
"Original",
"pre",
"-",
"4",
".",
"3",
"version",
"of",
"this",
"API",
".",
"Always",
"returns",
"the",
"entire",
"contents",
"of",
"the",
"Portlet",
"Registry",
"including",
"uncategorized",
"portlets",
"to",
"which",
"the",
"user",
"has",
"access",
".",
... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/ChannelListController.java#L162-L181 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/tincan/converters/AbstractPortalEventToLrsStatementConverter.java | AbstractPortalEventToLrsStatementConverter.toLrsStatement | @Override
public LrsStatement toLrsStatement(PortalEvent event) {
return new LrsStatement(getActor(event), getVerb(event), getLrsObject(event));
} | java | @Override
public LrsStatement toLrsStatement(PortalEvent event) {
return new LrsStatement(getActor(event), getVerb(event), getLrsObject(event));
} | [
"@",
"Override",
"public",
"LrsStatement",
"toLrsStatement",
"(",
"PortalEvent",
"event",
")",
"{",
"return",
"new",
"LrsStatement",
"(",
"getActor",
"(",
"event",
")",
",",
"getVerb",
"(",
"event",
")",
",",
"getLrsObject",
"(",
"event",
")",
")",
";",
"}... | Convert an event to an LrsStatement.
@param event the portal event.
@return the new LrsStatement | [
"Convert",
"an",
"event",
"to",
"an",
"LrsStatement",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/tincan/converters/AbstractPortalEventToLrsStatementConverter.java#L91-L94 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/tincan/converters/AbstractPortalEventToLrsStatementConverter.java | AbstractPortalEventToLrsStatementConverter.getActor | protected LrsActor getActor(PortalEvent event) {
String username = event.getUserName();
return actorService.getLrsActor(username);
} | java | protected LrsActor getActor(PortalEvent event) {
String username = event.getUserName();
return actorService.getLrsActor(username);
} | [
"protected",
"LrsActor",
"getActor",
"(",
"PortalEvent",
"event",
")",
"{",
"String",
"username",
"=",
"event",
".",
"getUserName",
"(",
")",
";",
"return",
"actorService",
".",
"getLrsActor",
"(",
"username",
")",
";",
"}"
] | Get the actor for an event.
@param event the portal event
@return the LrsActor | [
"Get",
"the",
"actor",
"for",
"an",
"event",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/tincan/converters/AbstractPortalEventToLrsStatementConverter.java#L102-L105 | train |
Jasig/uPortal | uPortal-events/src/main/java/org/apereo/portal/events/tincan/converters/AbstractPortalEventToLrsStatementConverter.java | AbstractPortalEventToLrsStatementConverter.buildUrn | protected URI buildUrn(String... parts) {
UrnBuilder builder = new UrnBuilder("UTF-8", "tincan", "uportal", "activities");
builder.add(parts);
return builder.getUri();
} | java | protected URI buildUrn(String... parts) {
UrnBuilder builder = new UrnBuilder("UTF-8", "tincan", "uportal", "activities");
builder.add(parts);
return builder.getUri();
} | [
"protected",
"URI",
"buildUrn",
"(",
"String",
"...",
"parts",
")",
"{",
"UrnBuilder",
"builder",
"=",
"new",
"UrnBuilder",
"(",
"\"UTF-8\"",
",",
"\"tincan\"",
",",
"\"uportal\"",
",",
"\"activities\"",
")",
";",
"builder",
".",
"add",
"(",
"parts",
")",
... | Build the URN for the LrsStatement. This method attaches creates the base URN. Additional
elements can be attached.
@param parts Additional URN elements.
@return The formatted URI | [
"Build",
"the",
"URN",
"for",
"the",
"LrsStatement",
".",
"This",
"method",
"attaches",
"creates",
"the",
"base",
"URN",
".",
"Additional",
"elements",
"can",
"be",
"attached",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-events/src/main/java/org/apereo/portal/events/tincan/converters/AbstractPortalEventToLrsStatementConverter.java#L125-L130 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getUsernameAttributeProvider | @Bean(name = "usernameAttributeProvider")
public IUsernameAttributeProvider getUsernameAttributeProvider() {
final SimpleUsernameAttributeProvider rslt = new SimpleUsernameAttributeProvider();
rslt.setUsernameAttribute(USERNAME_ATTRIBUTE);
return rslt;
} | java | @Bean(name = "usernameAttributeProvider")
public IUsernameAttributeProvider getUsernameAttributeProvider() {
final SimpleUsernameAttributeProvider rslt = new SimpleUsernameAttributeProvider();
rslt.setUsernameAttribute(USERNAME_ATTRIBUTE);
return rslt;
} | [
"@",
"Bean",
"(",
"name",
"=",
"\"usernameAttributeProvider\"",
")",
"public",
"IUsernameAttributeProvider",
"getUsernameAttributeProvider",
"(",
")",
"{",
"final",
"SimpleUsernameAttributeProvider",
"rslt",
"=",
"new",
"SimpleUsernameAttributeProvider",
"(",
")",
";",
"r... | Provides the default username attribute to use to the rest of the DAOs. | [
"Provides",
"the",
"default",
"username",
"attribute",
"to",
"use",
"to",
"the",
"rest",
"of",
"the",
"DAOs",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L99-L104 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getRequestAttributeSourceFilter | @Bean(name = "requestAttributeSourceFilter")
public Filter getRequestAttributeSourceFilter() {
final RequestAttributeSourceFilter rslt = new RequestAttributeSourceFilter();
rslt.setAdditionalDescriptors(getRequestAdditionalDescriptors());
rslt.setUsernameAttribute(REMOTE_USER_ATTRIBUTE); // ... | java | @Bean(name = "requestAttributeSourceFilter")
public Filter getRequestAttributeSourceFilter() {
final RequestAttributeSourceFilter rslt = new RequestAttributeSourceFilter();
rslt.setAdditionalDescriptors(getRequestAdditionalDescriptors());
rslt.setUsernameAttribute(REMOTE_USER_ATTRIBUTE); // ... | [
"@",
"Bean",
"(",
"name",
"=",
"\"requestAttributeSourceFilter\"",
")",
"public",
"Filter",
"getRequestAttributeSourceFilter",
"(",
")",
"{",
"final",
"RequestAttributeSourceFilter",
"rslt",
"=",
"new",
"RequestAttributeSourceFilter",
"(",
")",
";",
"rslt",
".",
"setA... | Servlet filter that creates an attribute for the serverName | [
"Servlet",
"filter",
"that",
"creates",
"an",
"attribute",
"for",
"the",
"serverName"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L142-L167 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getSessionAttributesOverridesMap | @Bean(name = "sessionAttributesOverridesMap")
@Scope(value = "globalSession", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Map getSessionAttributesOverridesMap() {
return new ConcurrentHashMap();
} | java | @Bean(name = "sessionAttributesOverridesMap")
@Scope(value = "globalSession", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Map getSessionAttributesOverridesMap() {
return new ConcurrentHashMap();
} | [
"@",
"Bean",
"(",
"name",
"=",
"\"sessionAttributesOverridesMap\"",
")",
"@",
"Scope",
"(",
"value",
"=",
"\"globalSession\"",
",",
"proxyMode",
"=",
"ScopedProxyMode",
".",
"TARGET_CLASS",
")",
"public",
"Map",
"getSessionAttributesOverridesMap",
"(",
")",
"{",
"... | Store attribute overrides in a session scoped map to ensure overrides don't show up for other
users and swapped attributes will be cleaned up on user logout. | [
"Store",
"attribute",
"overrides",
"in",
"a",
"session",
"scoped",
"map",
"to",
"ensure",
"overrides",
"don",
"t",
"show",
"up",
"for",
"other",
"users",
"and",
"swapped",
"attributes",
"will",
"be",
"cleaned",
"up",
"on",
"user",
"logout",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L173-L177 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getPersonAttributeDao | @Bean(name = "personAttributeDao")
@Qualifier("personAttributeDao")
public IPersonAttributeDao getPersonAttributeDao() {
final PortalRootPersonAttributeDao rslt = new PortalRootPersonAttributeDao();
rslt.setDelegatePersonAttributeDao(getRequestAttributeMergingDao());
rslt.setAttributeOve... | java | @Bean(name = "personAttributeDao")
@Qualifier("personAttributeDao")
public IPersonAttributeDao getPersonAttributeDao() {
final PortalRootPersonAttributeDao rslt = new PortalRootPersonAttributeDao();
rslt.setDelegatePersonAttributeDao(getRequestAttributeMergingDao());
rslt.setAttributeOve... | [
"@",
"Bean",
"(",
"name",
"=",
"\"personAttributeDao\"",
")",
"@",
"Qualifier",
"(",
"\"personAttributeDao\"",
")",
"public",
"IPersonAttributeDao",
"getPersonAttributeDao",
"(",
")",
"{",
"final",
"PortalRootPersonAttributeDao",
"rslt",
"=",
"new",
"PortalRootPersonAtt... | Overrides DAO acts as the root, it handles incorporating attributes from the attribute
swapper utility, wraps the caching DAO | [
"Overrides",
"DAO",
"acts",
"as",
"the",
"root",
"it",
"handles",
"incorporating",
"attributes",
"from",
"the",
"attribute",
"swapper",
"utility",
"wraps",
"the",
"caching",
"DAO"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L183-L190 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getRequestAttributeMergingDao | @Bean(name = "requestAttributeMergingDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getRequestAttributeMergingDao() {
final MergingPersonAttributeDaoImpl rslt = new MergingPersonAttributeDaoImpl();
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.se... | java | @Bean(name = "requestAttributeMergingDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getRequestAttributeMergingDao() {
final MergingPersonAttributeDaoImpl rslt = new MergingPersonAttributeDaoImpl();
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.se... | [
"@",
"Bean",
"(",
"name",
"=",
"\"requestAttributeMergingDao\"",
")",
"@",
"Qualifier",
"(",
"\"uPortalInternal\"",
")",
"public",
"IPersonAttributeDao",
"getRequestAttributeMergingDao",
"(",
")",
"{",
"final",
"MergingPersonAttributeDaoImpl",
"rslt",
"=",
"new",
"Mergi... | Merges attributes from the request with those from other DAOs. | [
"Merges",
"attributes",
"from",
"the",
"request",
"with",
"those",
"from",
"other",
"DAOs",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L193-L204 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getRequestAttributesDao | @Bean(name = "requestAttributesDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getRequestAttributesDao() {
final AdditionalDescriptorsPersonAttributeDao rslt =
new AdditionalDescriptorsPersonAttributeDao();
rslt.setDescriptors(getRequestAdditionalDescriptors());
... | java | @Bean(name = "requestAttributesDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getRequestAttributesDao() {
final AdditionalDescriptorsPersonAttributeDao rslt =
new AdditionalDescriptorsPersonAttributeDao();
rslt.setDescriptors(getRequestAdditionalDescriptors());
... | [
"@",
"Bean",
"(",
"name",
"=",
"\"requestAttributesDao\"",
")",
"@",
"Qualifier",
"(",
"\"uPortalInternal\"",
")",
"public",
"IPersonAttributeDao",
"getRequestAttributesDao",
"(",
")",
"{",
"final",
"AdditionalDescriptorsPersonAttributeDao",
"rslt",
"=",
"new",
"Additio... | The person attributes DAO that returns the attributes from the request. Uses a
currentUserProvider since the username may not always be provided by the request object. | [
"The",
"person",
"attributes",
"DAO",
"that",
"returns",
"the",
"attributes",
"from",
"the",
"request",
".",
"Uses",
"a",
"currentUserProvider",
"since",
"the",
"username",
"may",
"not",
"always",
"be",
"provided",
"by",
"the",
"request",
"object",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L210-L219 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getCachingPersonAttributeDao | @Bean(name = "cachingPersonAttributeDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getCachingPersonAttributeDao() {
final CachingPersonAttributeDaoImpl rslt = new CachingPersonAttributeDaoImpl();
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.setC... | java | @Bean(name = "cachingPersonAttributeDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getCachingPersonAttributeDao() {
final CachingPersonAttributeDaoImpl rslt = new CachingPersonAttributeDaoImpl();
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.setC... | [
"@",
"Bean",
"(",
"name",
"=",
"\"cachingPersonAttributeDao\"",
")",
"@",
"Qualifier",
"(",
"\"uPortalInternal\"",
")",
"public",
"IPersonAttributeDao",
"getCachingPersonAttributeDao",
"(",
")",
"{",
"final",
"CachingPersonAttributeDaoImpl",
"rslt",
"=",
"new",
"Caching... | Defines the order that the data providing DAOs are called, results are cached by the outer
caching DAO. | [
"Defines",
"the",
"order",
"that",
"the",
"data",
"providing",
"DAOs",
"are",
"called",
"results",
"are",
"cached",
"by",
"the",
"outer",
"caching",
"DAO",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L225-L235 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getInnerMergedPersonAttributeDaoList | @Bean(name = "innerMergedPersonAttributeDaoList")
public List<IPersonAttributeDao> getInnerMergedPersonAttributeDaoList() {
final List<IPersonAttributeDao> rslt = new ArrayList<>();
rslt.add(getImpersonationStatusPersonAttributeDao());
rslt.add(getUPortalAccountUserSource());
rslt.ad... | java | @Bean(name = "innerMergedPersonAttributeDaoList")
public List<IPersonAttributeDao> getInnerMergedPersonAttributeDaoList() {
final List<IPersonAttributeDao> rslt = new ArrayList<>();
rslt.add(getImpersonationStatusPersonAttributeDao());
rslt.add(getUPortalAccountUserSource());
rslt.ad... | [
"@",
"Bean",
"(",
"name",
"=",
"\"innerMergedPersonAttributeDaoList\"",
")",
"public",
"List",
"<",
"IPersonAttributeDao",
">",
"getInnerMergedPersonAttributeDaoList",
"(",
")",
"{",
"final",
"List",
"<",
"IPersonAttributeDao",
">",
"rslt",
"=",
"new",
"ArrayList",
... | IPersonAttributeDao beans defined by implementors will be added to this list when the
ApplicationContext comes up. | [
"IPersonAttributeDao",
"beans",
"defined",
"by",
"implementors",
"will",
"be",
"added",
"to",
"this",
"list",
"when",
"the",
"ApplicationContext",
"comes",
"up",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L270-L277 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getUPortalAccountUserSource | @Bean(name = "uPortalAccountUserSource")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getUPortalAccountUserSource() {
final LocalAccountPersonAttributeDao rslt = new LocalAccountPersonAttributeDao();
rslt.setLocalAccountDao(localAccountDao);
rslt.setUsernameAttributeProvider(... | java | @Bean(name = "uPortalAccountUserSource")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getUPortalAccountUserSource() {
final LocalAccountPersonAttributeDao rslt = new LocalAccountPersonAttributeDao();
rslt.setLocalAccountDao(localAccountDao);
rslt.setUsernameAttributeProvider(... | [
"@",
"Bean",
"(",
"name",
"=",
"\"uPortalAccountUserSource\"",
")",
"@",
"Qualifier",
"(",
"\"uPortalInternal\"",
")",
"public",
"IPersonAttributeDao",
"getUPortalAccountUserSource",
"(",
")",
"{",
"final",
"LocalAccountPersonAttributeDao",
"rslt",
"=",
"new",
"LocalAcc... | Looks in the local person-directory data. This is only used for portal-local users such as
fragment owners All attributes are searchable via this configuration, results are cached by
the underlying DAO. | [
"Looks",
"in",
"the",
"local",
"person",
"-",
"directory",
"data",
".",
"This",
"is",
"only",
"used",
"for",
"portal",
"-",
"local",
"users",
"such",
"as",
"fragment",
"owners",
"All",
"attributes",
"are",
"searchable",
"via",
"this",
"configuration",
"resul... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L294-L315 | train |
Jasig/uPortal | uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java | PersonDirectoryConfiguration.getUPortalJdbcUserSource | @Bean(name = "uPortalJdbcUserSource")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getUPortalJdbcUserSource() {
final String sql = "SELECT USER_NAME FROM UP_USER WHERE {0}";
final SingleRowJdbcPersonAttributeDao rslt =
new SingleRowJdbcPersonAttributeDao(personDb, sql... | java | @Bean(name = "uPortalJdbcUserSource")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getUPortalJdbcUserSource() {
final String sql = "SELECT USER_NAME FROM UP_USER WHERE {0}";
final SingleRowJdbcPersonAttributeDao rslt =
new SingleRowJdbcPersonAttributeDao(personDb, sql... | [
"@",
"Bean",
"(",
"name",
"=",
"\"uPortalJdbcUserSource\"",
")",
"@",
"Qualifier",
"(",
"\"uPortalInternal\"",
")",
"public",
"IPersonAttributeDao",
"getUPortalJdbcUserSource",
"(",
")",
"{",
"final",
"String",
"sql",
"=",
"\"SELECT USER_NAME FROM UP_USER WHERE {0}\"",
... | Looks in the base UP_USER table, doesn't find attributes but will ensure a result if it the
user exists in the portal database and is searched for by username, results are cached by the
outer caching DAO. | [
"Looks",
"in",
"the",
"base",
"UP_USER",
"table",
"doesn",
"t",
"find",
"attributes",
"but",
"will",
"ensure",
"a",
"result",
"if",
"it",
"the",
"user",
"exists",
"in",
"the",
"portal",
"database",
"and",
"is",
"searched",
"for",
"by",
"username",
"results... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/persondir/PersonDirectoryConfiguration.java#L322-L338 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAAddParameter.java | LPAAddParameter.addParameterChild | static void addParameterChild(Element node, String name, String value) {
if (node != null) {
Document doc = node.getOwnerDocument();
Element parm = doc.createElement(Constants.ELM_PARAMETER);
parm.setAttribute(Constants.ATT_NAME, name);
parm.setAttribute(Constants... | java | static void addParameterChild(Element node, String name, String value) {
if (node != null) {
Document doc = node.getOwnerDocument();
Element parm = doc.createElement(Constants.ELM_PARAMETER);
parm.setAttribute(Constants.ATT_NAME, name);
parm.setAttribute(Constants... | [
"static",
"void",
"addParameterChild",
"(",
"Element",
"node",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"Document",
"doc",
"=",
"node",
".",
"getOwnerDocument",
"(",
")",
";",
"Element",
"parm",
... | Performs parameter child element creation in the passed in Element.
@param node the parent node in which to create the parameter.
@param name the name of the parameter to be created.
@param value the value of the parameter to be created. | [
"Performs",
"parameter",
"child",
"element",
"creation",
"in",
"the",
"passed",
"in",
"Element",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAAddParameter.java#L65-L80 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jpa/BaseJpaDao.java | BaseJpaDao.createQuery | protected final <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
return this.getEntityManager().createQuery(criteriaQuery);
} | java | protected final <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
return this.getEntityManager().createQuery(criteriaQuery);
} | [
"protected",
"final",
"<",
"T",
">",
"TypedQuery",
"<",
"T",
">",
"createQuery",
"(",
"CriteriaQuery",
"<",
"T",
">",
"criteriaQuery",
")",
"{",
"return",
"this",
".",
"getEntityManager",
"(",
")",
".",
"createQuery",
"(",
"criteriaQuery",
")",
";",
"}"
] | Common logic for creating and configuring JPA queries
@param criteriaQuery The criteria to create the query from | [
"Common",
"logic",
"for",
"creating",
"and",
"configuring",
"JPA",
"queries"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jpa/BaseJpaDao.java#L106-L108 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jpa/BaseJpaDao.java | BaseJpaDao.createCachedQuery | protected final <T> TypedQuery<T> createCachedQuery(CriteriaQuery<T> criteriaQuery) {
final TypedQuery<T> query = this.getEntityManager().createQuery(criteriaQuery);
final String cacheRegion = getCacheRegionName(criteriaQuery);
query.setHint("org.hibernate.cacheable", true);
query.setHin... | java | protected final <T> TypedQuery<T> createCachedQuery(CriteriaQuery<T> criteriaQuery) {
final TypedQuery<T> query = this.getEntityManager().createQuery(criteriaQuery);
final String cacheRegion = getCacheRegionName(criteriaQuery);
query.setHint("org.hibernate.cacheable", true);
query.setHin... | [
"protected",
"final",
"<",
"T",
">",
"TypedQuery",
"<",
"T",
">",
"createCachedQuery",
"(",
"CriteriaQuery",
"<",
"T",
">",
"criteriaQuery",
")",
"{",
"final",
"TypedQuery",
"<",
"T",
">",
"query",
"=",
"this",
".",
"getEntityManager",
"(",
")",
".",
"cr... | Important common logic for creating and configuring JPA queries cached in EhCache. This step
is important for the sake of scalability.
@param criteriaQuery The criteria to create a cached query from | [
"Important",
"common",
"logic",
"for",
"creating",
"and",
"configuring",
"JPA",
"queries",
"cached",
"in",
"EhCache",
".",
"This",
"step",
"is",
"important",
"for",
"the",
"sake",
"of",
"scalability",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jpa/BaseJpaDao.java#L116-L122 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jpa/BaseJpaDao.java | BaseJpaDao.getCacheRegionName | protected final <T> String getCacheRegionName(CriteriaQuery<T> criteriaQuery) {
final Set<Root<?>> roots = criteriaQuery.getRoots();
final Class<?> cacheRegionType = roots.iterator().next().getJavaType();
final String cacheRegion = cacheRegionType.getName() + QUERY_SUFFIX;
if (roots.siz... | java | protected final <T> String getCacheRegionName(CriteriaQuery<T> criteriaQuery) {
final Set<Root<?>> roots = criteriaQuery.getRoots();
final Class<?> cacheRegionType = roots.iterator().next().getJavaType();
final String cacheRegion = cacheRegionType.getName() + QUERY_SUFFIX;
if (roots.siz... | [
"protected",
"final",
"<",
"T",
">",
"String",
"getCacheRegionName",
"(",
"CriteriaQuery",
"<",
"T",
">",
"criteriaQuery",
")",
"{",
"final",
"Set",
"<",
"Root",
"<",
"?",
">",
">",
"roots",
"=",
"criteriaQuery",
".",
"getRoots",
"(",
")",
";",
"final",
... | Creates the cache region name for the criteria query
@param criteriaQuery The criteria to create the cache name for | [
"Creates",
"the",
"cache",
"region",
"name",
"for",
"the",
"criteria",
"query"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jpa/BaseJpaDao.java#L148-L165 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java | FreeMarkerTag.session | protected Map session(){
Map session;
try{
SimpleHash sessionHash = (SimpleHash)get("session");
session = sessionHash.toMap();
}catch(Exception e){
logger().warn("failed to get a session map in context, returning session without data!!!", e);
sess... | java | protected Map session(){
Map session;
try{
SimpleHash sessionHash = (SimpleHash)get("session");
session = sessionHash.toMap();
}catch(Exception e){
logger().warn("failed to get a session map in context, returning session without data!!!", e);
sess... | [
"protected",
"Map",
"session",
"(",
")",
"{",
"Map",
"session",
";",
"try",
"{",
"SimpleHash",
"sessionHash",
"=",
"(",
"SimpleHash",
")",
"get",
"(",
"\"session\"",
")",
";",
"session",
"=",
"sessionHash",
".",
"toMap",
"(",
")",
";",
"}",
"catch",
"(... | Returns reference to a current session map.
@return reference to a current session map. | [
"Returns",
"reference",
"to",
"a",
"current",
"session",
"map",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java#L435-L445 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/AppController.java | AppController.render | protected RenderBuilder render(){
String template = Router.getControllerPath(getClass()) + "/" + RequestContext.getRoute().getActionName();
return super.render(template, values());
} | java | protected RenderBuilder render(){
String template = Router.getControllerPath(getClass()) + "/" + RequestContext.getRoute().getActionName();
return super.render(template, values());
} | [
"protected",
"RenderBuilder",
"render",
"(",
")",
"{",
"String",
"template",
"=",
"Router",
".",
"getControllerPath",
"(",
"getClass",
"(",
")",
")",
"+",
"\"/\"",
"+",
"RequestContext",
".",
"getRoute",
"(",
")",
".",
"getActionName",
"(",
")",
";",
"retu... | Use this method in order to override a layout, status code, and content type.
@return instance of {@link RenderBuilder}, which is used to provide additional parameters. | [
"Use",
"this",
"method",
"in",
"order",
"to",
"override",
"a",
"layout",
"status",
"code",
"and",
"content",
"type",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/AppController.java#L63-L67 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/AppController.java | AppController.actionSupportsHttpMethod | public boolean actionSupportsHttpMethod(String actionMethodName, HttpMethod httpMethod) {
if (restful()) {
return restfulActionSupportsHttpMethod(actionMethodName, httpMethod) || standardActionSupportsHttpMethod(actionMethodName, httpMethod);
} else {
return standardActionSupport... | java | public boolean actionSupportsHttpMethod(String actionMethodName, HttpMethod httpMethod) {
if (restful()) {
return restfulActionSupportsHttpMethod(actionMethodName, httpMethod) || standardActionSupportsHttpMethod(actionMethodName, httpMethod);
} else {
return standardActionSupport... | [
"public",
"boolean",
"actionSupportsHttpMethod",
"(",
"String",
"actionMethodName",
",",
"HttpMethod",
"httpMethod",
")",
"{",
"if",
"(",
"restful",
"(",
")",
")",
"{",
"return",
"restfulActionSupportsHttpMethod",
"(",
"actionMethodName",
",",
"httpMethod",
")",
"||... | Checks if the action supports an HTTP method, according to its configuration.
@param actionMethodName name of action method.
@param httpMethod http method
@return true if supports, false if does not. | [
"Checks",
"if",
"the",
"action",
"supports",
"an",
"HTTP",
"method",
"according",
"to",
"its",
"configuration",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/AppController.java#L111-L117 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/Router.java | Router.recognize | protected Route recognize(String uri, HttpMethod httpMethod) throws ClassLoadException {
if (uri.endsWith("/") && uri.length() > 1) {
uri = uri.substring(0, uri.length() - 1);
}
ControllerPath controllerPath = getControllerPath(uri);
Route route = matchCustom(uri, controll... | java | protected Route recognize(String uri, HttpMethod httpMethod) throws ClassLoadException {
if (uri.endsWith("/") && uri.length() > 1) {
uri = uri.substring(0, uri.length() - 1);
}
ControllerPath controllerPath = getControllerPath(uri);
Route route = matchCustom(uri, controll... | [
"protected",
"Route",
"recognize",
"(",
"String",
"uri",
",",
"HttpMethod",
"httpMethod",
")",
"throws",
"ClassLoadException",
"{",
"if",
"(",
"uri",
".",
"endsWith",
"(",
"\"/\"",
")",
"&&",
"uri",
".",
"length",
"(",
")",
">",
"1",
")",
"{",
"uri",
"... | This is a main method for recognizing a route to a controller; used when a request is received.
@param uri URI of incoming request.
@param httpMethod http method of the request.
@return instance of a <code>Route</code> if one is found, null if not. | [
"This",
"is",
"a",
"main",
"method",
"for",
"recognizing",
"a",
"route",
"to",
"a",
"controller",
";",
"used",
"when",
"a",
"request",
"is",
"received",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/Router.java#L65-L97 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/Router.java | Router.matchStandard | private Route matchStandard(String uri, ControllerPath controllerPathObject, AppController controller, HttpMethod method) {
String controllerPath = (controllerPathObject.getControllerPackage() != null ? "/" + controllerPathObject.getControllerPackage().replace(".", "/") : "") + "/" + controllerPathObject.getCo... | java | private Route matchStandard(String uri, ControllerPath controllerPathObject, AppController controller, HttpMethod method) {
String controllerPath = (controllerPathObject.getControllerPackage() != null ? "/" + controllerPathObject.getControllerPackage().replace(".", "/") : "") + "/" + controllerPathObject.getCo... | [
"private",
"Route",
"matchStandard",
"(",
"String",
"uri",
",",
"ControllerPath",
"controllerPathObject",
",",
"AppController",
"controller",
",",
"HttpMethod",
"method",
")",
"{",
"String",
"controllerPath",
"=",
"(",
"controllerPathObject",
".",
"getControllerPackage"... | Will match a standard, non-restful route.
@param uri request URI
@return instance of a <code>Route</code> if one is found, null if not. | [
"Will",
"match",
"a",
"standard",
"non",
"-",
"restful",
"route",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/Router.java#L124-L154 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/Router.java | Router.findControllerNamePart | protected static String findControllerNamePart(String pack, String uri) {
String temp = uri.startsWith("/") ? uri.substring(1) : uri;
temp = temp.replace("/", ".");
if (temp.length() > pack.length())
temp = temp.substring(pack.length() + 1);
if (temp.equals("") )
... | java | protected static String findControllerNamePart(String pack, String uri) {
String temp = uri.startsWith("/") ? uri.substring(1) : uri;
temp = temp.replace("/", ".");
if (temp.length() > pack.length())
temp = temp.substring(pack.length() + 1);
if (temp.equals("") )
... | [
"protected",
"static",
"String",
"findControllerNamePart",
"(",
"String",
"pack",
",",
"String",
"uri",
")",
"{",
"String",
"temp",
"=",
"uri",
".",
"startsWith",
"(",
"\"/\"",
")",
"?",
"uri",
".",
"substring",
"(",
"1",
")",
":",
"uri",
";",
"temp",
... | Now that we know that this controller is under a package, need to find the controller short name.
@param pack part of the package of the controller, taken from URI: value between "app.controllers" and controller name.
@param uri uri from request
@return controller name | [
"Now",
"that",
"we",
"know",
"that",
"this",
"controller",
"is",
"under",
"a",
"package",
"need",
"to",
"find",
"the",
"controller",
"short",
"name",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/Router.java#L388-L398 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/Router.java | Router.findPackageSuffix | protected String findPackageSuffix(String uri) {
String temp = uri.startsWith("/") ? uri.substring(1) : uri;
temp = temp.replace(".", "_");
temp = temp.replace("/", ".");
//find all matches
List<String> candidates = new ArrayList<>();
for (String pack : Configuration.g... | java | protected String findPackageSuffix(String uri) {
String temp = uri.startsWith("/") ? uri.substring(1) : uri;
temp = temp.replace(".", "_");
temp = temp.replace("/", ".");
//find all matches
List<String> candidates = new ArrayList<>();
for (String pack : Configuration.g... | [
"protected",
"String",
"findPackageSuffix",
"(",
"String",
"uri",
")",
"{",
"String",
"temp",
"=",
"uri",
".",
"startsWith",
"(",
"\"/\"",
")",
"?",
"uri",
".",
"substring",
"(",
"1",
")",
":",
"uri",
";",
"temp",
"=",
"temp",
".",
"replace",
"(",
"\... | Finds a part of a package name which can be found in between "app.controllers" and short name of class.
@param uri uri from request
@return a part of a package name which can be found in between "app.controllers" and short name of class, or null
if not found | [
"Finds",
"a",
"part",
"of",
"a",
"package",
"name",
"which",
"can",
"be",
"found",
"in",
"between",
"app",
".",
"controllers",
"and",
"short",
"name",
"of",
"class",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/Router.java#L407-L432 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java | RouteBuilder.to | public <T extends AppController> RouteBuilder to(Class<T> type) {
boolean hasControllerSegment = false;
for (Segment segment : segments) {
hasControllerSegment = segment.controller;
}
if (type != null && hasControllerSegment) {
throw new IllegalArgumentExceptio... | java | public <T extends AppController> RouteBuilder to(Class<T> type) {
boolean hasControllerSegment = false;
for (Segment segment : segments) {
hasControllerSegment = segment.controller;
}
if (type != null && hasControllerSegment) {
throw new IllegalArgumentExceptio... | [
"public",
"<",
"T",
"extends",
"AppController",
">",
"RouteBuilder",
"to",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"boolean",
"hasControllerSegment",
"=",
"false",
";",
"for",
"(",
"Segment",
"segment",
":",
"segments",
")",
"{",
"hasControllerSegment... | Allows to wire a route to a controller.
@param type class of controller to which a route is mapped
@return instance of {@link RouteBuilder}. | [
"Allows",
"to",
"wire",
"a",
"route",
"to",
"a",
"controller",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java#L116-L129 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java | RouteBuilder.action | public RouteBuilder action(String action) {
boolean hasActionSegment = false;
for (Segment segment : segments) {
hasActionSegment = segment.action;
}
if(action!= null && hasActionSegment){
throw new IllegalArgumentException("Cannot combine {action} segment and .a... | java | public RouteBuilder action(String action) {
boolean hasActionSegment = false;
for (Segment segment : segments) {
hasActionSegment = segment.action;
}
if(action!= null && hasActionSegment){
throw new IllegalArgumentException("Cannot combine {action} segment and .a... | [
"public",
"RouteBuilder",
"action",
"(",
"String",
"action",
")",
"{",
"boolean",
"hasActionSegment",
"=",
"false",
";",
"for",
"(",
"Segment",
"segment",
":",
"segments",
")",
"{",
"hasActionSegment",
"=",
"segment",
".",
"action",
";",
"}",
"if",
"(",
"a... | Name of action to which a route is mapped.
@param action name of action.
@return instance of {@link RouteBuilder}. | [
"Name",
"of",
"action",
"to",
"which",
"a",
"route",
"is",
"mapped",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java#L137-L149 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java | RouteBuilder.get | public RouteBuilder get(){
if(!methods.contains(HttpMethod.GET)){
methods.add(HttpMethod.GET);
}
return this;
} | java | public RouteBuilder get(){
if(!methods.contains(HttpMethod.GET)){
methods.add(HttpMethod.GET);
}
return this;
} | [
"public",
"RouteBuilder",
"get",
"(",
")",
"{",
"if",
"(",
"!",
"methods",
".",
"contains",
"(",
"HttpMethod",
".",
"GET",
")",
")",
"{",
"methods",
".",
"add",
"(",
"HttpMethod",
".",
"GET",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Specifies that this route is mapped to HTTP GET method.
@return instance of {@link RouteBuilder}. | [
"Specifies",
"that",
"this",
"route",
"is",
"mapped",
"to",
"HTTP",
"GET",
"method",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java#L156-L162 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java | RouteBuilder.post | public RouteBuilder post(){
if(!methods.contains(HttpMethod.POST)){
methods.add(HttpMethod.POST);
}
return this;
} | java | public RouteBuilder post(){
if(!methods.contains(HttpMethod.POST)){
methods.add(HttpMethod.POST);
}
return this;
} | [
"public",
"RouteBuilder",
"post",
"(",
")",
"{",
"if",
"(",
"!",
"methods",
".",
"contains",
"(",
"HttpMethod",
".",
"POST",
")",
")",
"{",
"methods",
".",
"add",
"(",
"HttpMethod",
".",
"POST",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Specifies that this route is mapped to HTTP POST method.
@return instance of {@link RouteBuilder}. | [
"Specifies",
"that",
"this",
"route",
"is",
"mapped",
"to",
"HTTP",
"POST",
"method",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java#L169-L175 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java | RouteBuilder.options | public RouteBuilder options(){
if(!methods.contains(HttpMethod.OPTIONS)){
methods.add(HttpMethod.OPTIONS);
}
return this;
} | java | public RouteBuilder options(){
if(!methods.contains(HttpMethod.OPTIONS)){
methods.add(HttpMethod.OPTIONS);
}
return this;
} | [
"public",
"RouteBuilder",
"options",
"(",
")",
"{",
"if",
"(",
"!",
"methods",
".",
"contains",
"(",
"HttpMethod",
".",
"OPTIONS",
")",
")",
"{",
"methods",
".",
"add",
"(",
"HttpMethod",
".",
"OPTIONS",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Specifies that this route is mapped to HTTP OPTIONS method.
@return instance of {@link RouteBuilder}. | [
"Specifies",
"that",
"this",
"route",
"is",
"mapped",
"to",
"HTTP",
"OPTIONS",
"method",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java#L182-L188 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.