idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
34,900
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 ( deleteAllowed . equals (...
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 .
34,901
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 ( Element ) child ; c...
Get the delete set if any stored in the root of the document or create it is passed in create flag is true .
34,902
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 ) { throw new PortalException ( "Exception encountered while...
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 .
34,903
public void perform ( ) throws PortalException { if ( nodeId . startsWith ( Constants . FRAGMENT_ID_USER_PREFIX ) ) { EditManager . removeEditDirective ( nodeId , name , person ) ; } if ( ! name . equals ( Constants . ATT_NAME ) ) { ilfNode . setAttribute ( name , fragmentValue ) ; } }
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 .
34,904
public EntityIdentifier [ ] searchForEntities ( String query , SearchMethod method ) throws GroupsException { boolean allowPartial = true ; switch ( method ) { case DISCRETE : allowPartial = false ; break ; case STARTS_WITH : query = query + "%" ; break ; case ENDS_WITH : query = "%" + query ; break ; case CONTAINS : q...
Internal search so shouldn t be called as case insensitive .
34,905
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 ( ) ) ; } }
Construct a new target provider registry and initialize it with the supplied map of key - > provider pairs .
34,906
public String parseString ( String expressionString , PortletRequest request ) { return getValue ( expressionString , request , String . class ) ; }
Primary method used assuming all defaults .
34,907
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 ) , userInfo ) ; final StandardE...
Return a SpEL evaluation context for the supplied portlet request .
34,908
private Version getSimpleVersion ( String product ) { final Tuple coreNumbers ; try { final TypedQuery < Tuple > coreNumbersQuery = this . createQuery ( this . findCoreVersionNumbers ) ; coreNumbersQuery . setParameter ( this . productParameter , product ) ; coreNumbers = DataAccessUtils . singleResult ( coreNumbersQue...
Load a Version object with direct field queries . Used to deal with DB upgrades where not all of the fields have been loaded
34,909
private String calculateDynamicSkinUrlPathToUse ( PortletRequest request , String lessfileBaseName ) throws IOException { final DynamicSkinInstanceData data = new DefaultDynamicSkinInstanceDataImpl ( request ) ; if ( ! service . skinCssFileExists ( data ) ) { service . generateSkinCssFile ( data ) ; } return service . ...
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 .
34,910
protected long getLastModified ( Resource resource ) { try { return resource . lastModified ( ) ; } catch ( IOException e ) { this . logger . warn ( "Could not determine lastModified for " + resource + ". This resource will never be reloaded due to lastModified changing." , e ) ; } return 0 ; }
Determine the last modified time stamp for the resource
34,911
public IUserInstance getUserInstance ( HttpServletRequest request ) throws PortalException { try { request = this . portalRequestUtils . getOriginalPortalRequest ( request ) ; } catch ( IllegalArgumentException iae ) { } IUserInstance userInstance = ( IUserInstance ) request . getAttribute ( KEY ) ; if ( userInstance !...
Returns the UserInstance object that is associated with the given request .
34,912
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 ; } if ( "folder" . equals ( nodeName ) ) {...
Recursevly find out whether node contains a folder or channel with given identifier .
34,913
public static String currentRequestContextPath ( ) { final RequestAttributes requestAttributes = RequestContextHolder . getRequestAttributes ( ) ; if ( null == requestAttributes ) { throw new IllegalStateException ( "Request attributes are not bound. " + "Not operating in context of a Spring-processed Request?" ) ; } ...
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...
34,914
protected List < ? extends UserAttribute > getExpectedUserAttributes ( HttpServletRequest request , final IPortletWindow portletWindow ) { final IPortletEntity portletEntity = portletWindow . getPortletEntity ( ) ; final IPortletDefinition portletDefinition = portletEntity . getPortletDefinition ( ) ; final PortletAppl...
Get the list of user attributes the portlet expects .
34,915
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: lacks en...
Convenience method for converting an IPerson to an IAuthorizationPrincipal .
34,916
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 = "" ; if ( displayName != null ) { display...
Actually lookup a user name using the underlying IPersonAttributeDao .
34,917
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 ( now )...
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 .
34,918
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 ) ; recognizedParameterNa...
Examines the Filter init parameter names and throws ServletException if they contain an unrecognized init parameter name .
34,919
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 ) { throw new IllegalArgumen...
Parse the whitespace delimited String of parameters to check .
34,920
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 ) ; if ( values . length > 1 ...
For each parameter to check verify that it has zero or one value .
34,921
public synchronized void authenticate ( ) throws PortalSecurityException { int i ; Enumeration e = mySubContexts . elements ( ) ; while ( e . hasMoreElements ( ) ) { ISecurityContext sctx = ( ( Entry ) e . nextElement ( ) ) . getCtx ( ) ; try { if ( sctx instanceof IParentAwareSecurityContext ) { ( ( IParentAwareSecuri...
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 .
34,922
public synchronized Enumeration getSubContexts ( ) { Enumeration e = mySubContexts . elements ( ) ; class Adapter implements Enumeration { Enumeration base ; public Adapter ( Enumeration e ) { this . base = e ; } public boolean hasMoreElements ( ) { return base . hasMoreElements ( ) ; } public Object nextElement ( ) { ...
be returned in the order they appeared in the properties file .
34,923
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 ( ) ) ; } } return scNames . elements ( ) ; }
Returns an Enumeration of the names of the subcontexts .
34,924
public String initializeView ( PortletRequest req , Model model ) { final IUserInstance ui = userInstanceManager . getUserInstance ( portalRequestUtils . getCurrentPortalRequest ( ) ) ; final UserPreferencesManager upm = ( UserPreferencesManager ) ui . getPreferencesManager ( ) ; final IUserLayoutManager ulm = upm . ge...
Handles all Favorites portlet VIEW mode renders . Populates model with user s favorites and selects a view to display those favorites .
34,925
protected final Date getExpiration ( RenderRequest renderRequest ) { final PortletSession portletSession = renderRequest . getPortletSession ( ) ; final Date rslt = new Date ( portletSession . getLastAccessedTime ( ) + ( ( long ) portletSession . getMaxInactiveInterval ( ) * 1000L ) ) ; return rslt ; }
Point at which the JWT expires
34,926
public boolean canPrincipalManage ( IAuthorizationPrincipal principal , String portletDefinitionId ) throws AuthorizationException { final String owner = IPermission . PORTAL_PUBLISH ; final String target = IPermission . PORTLET_PREFIX + portletDefinitionId ; IPortletDefinition portlet = this . portletDefinitionRegistr...
Answers if the principal has permission to MANAGE this Channel .
34,927
public boolean canPrincipalRender ( IAuthorizationPrincipal principal , String portletDefinitionId ) throws AuthorizationException { return canPrincipalSubscribe ( principal , portletDefinitionId ) ; }
Answers if the principal has permission to RENDER this Channel . This implementation currently delegates to the SUBSCRIBE permission .
34,928
public boolean canPrincipalSubscribe ( IAuthorizationPrincipal principal , String portletDefinitionId ) { String owner = IPermission . PORTAL_SUBSCRIBE ; IPortletDefinition portlet = this . portletDefinitionRegistry . getPortletDefinition ( portletDefinitionId ) ; if ( portlet == null ) { return false ; } String target...
Answers if the principal has permission to SUBSCRIBE to this Channel .
34,929
public IAuthorizationPrincipal newPrincipal ( String key , Class type ) { final Tuple < String , Class > principalKey = new Tuple < > ( key , type ) ; final Element element = this . principalCache . get ( principalKey ) ; return ( IAuthorizationPrincipal ) element . getObjectValue ( ) ; }
Factory method for IAuthorizationPrincipal . First check the principal cache and if not present create the principal and cache it .
34,930
private IPermission [ ] primGetPermissionsForPrincipal ( IAuthorizationPrincipal principal ) throws AuthorizationException { if ( ! this . cachePermissions ) { return getUncachedPermissionsForPrincipal ( principal , null , null , null ) ; } IPermissionSet ps = null ; ps = cacheGet ( principal ) ; if ( ps == null ) sync...
Returns permissions for a principal . First check the entity caching service and if the permissions have not been cached retrieve and cache them .
34,931
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; return system username instead" , id ) ; } return systemUsername ; }
Returns the username for a valid userId else the system username
34,932
private IPortletDefinition savePortletDefinition ( IPortletDefinition definition , List < PortletCategory > categories , Map < ExternalPermissionDefinition , Set < IGroupMember > > permissionMap ) { boolean newChannel = ( definition . getPortletDefinitionId ( ) == null ) ; definition = portletDefinitionDao . savePortle...
Save a portlet definition .
34,933
private static Calendar getCalendar ( Date date ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; return calendar ; }
Utility method to convert a date to a calendar .
34,934
private Set < IGroupMember > toGroupMembers ( List < String > groupNames , String fname ) { final Set < IGroupMember > groups = new HashSet < > ( ) ; for ( String groupName : groupNames ) { EntityIdentifier [ ] gs = GroupService . searchForGroups ( groupName , IGroupConstants . SearchMethod . DISCRETE , IPerson . class...
Convert a list of group names to a list of groups .
34,935
private ExternalPermissionDefinition toExternalPermissionDefinition ( String system , String activity ) { ExternalPermissionDefinition def = ExternalPermissionDefinition . find ( system , activity ) ; if ( def != null ) { return def ; } String delim = "" ; StringBuilder buffer = new StringBuilder ( ) ; for ( ExternalPe...
Check that a permission type from the XML file matches with a real permission .
34,936
public static void setCachingHeaders ( int maxAge , boolean publicScope , long lastModified , PortletResourceOutputHandler portletResourceOutputHandler ) { if ( maxAge != 0 ) { portletResourceOutputHandler . setDateHeader ( "Last-Modified" , lastModified ) ; if ( publicScope ) { portletResourceOutputHandler . setHeader...
Set the Last - Modified CacheControl and Expires headers based on the maxAge publicScope and lastModified .
34,937
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 , moveAllowed ) ; ch...
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 .
34,938
private String getProxyTicket ( PortletRequest request ) { final HttpServletRequest httpServletRequest = this . portalRequestUtils . getPortletHttpRequest ( request ) ; String targetService = null ; try { URL url = null ; int port = request . getServerPort ( ) ; if ( port == 80 || port == 443 ) url = new URL ( request ...
Attempt to get a proxy ticket for the current portlet .
34,939
@ SuppressWarnings ( "unchecked" ) private static ISecurityContext getCasContext ( ISecurityContext context ) { if ( context instanceof ICasSecurityContext ) { return context ; } Enumeration contextEnum = context . getSubContexts ( ) ; while ( contextEnum . hasMoreElements ( ) ) { ISecurityContext subContext = ( ISecur...
Looks for a security context
34,940
protected List < AcademicTermDetail > getAcademicTermsAfter ( DateTime start ) { final List < AcademicTermDetail > terms = this . eventAggregationManagementDao . getAcademicTermDetails ( ) ; final int index = Collections . binarySearch ( terms , new AcademicTermDetailImpl ( start . toDateMidnight ( ) , start . plusDays...
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 .
34,941
protected File getFileRoot ( Class type ) { String path = getGroupsRootPath ( ) + type . getName ( ) ; File f = new File ( path ) ; return ( f . exists ( ) ) ? f : null ; }
Returns a File that is the root for groups of the given type .
34,942
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 ( files [ i ] ) ; } } }
Returns all directories under dir .
34,943
@ 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 , HttpServletRequest reque...
Deletes a specific permission
34,944
protected void cancelWorker ( HttpServletRequest request , IPortletExecutionWorker < ? > portletExecutionWorker ) { final IPortletWindowId portletWindowId = portletExecutionWorker . getPortletWindowId ( ) ; final IPortletWindow portletWindow = this . portletWindowRegistry . getPortletWindow ( request , portletWindowId ...
Cancel the worker and add it to the hung workers queue
34,945
public void startPortletHeaderRender ( IPortletWindowId portletWindowId , HttpServletRequest request , HttpServletResponse response ) { if ( doesPortletNeedHeaderWorker ( portletWindowId , request ) ) { this . startPortletHeaderRenderInternal ( portletWindowId , request , response ) ; } else { this . logger . debug ( "...
Only actually starts rendering the head if the portlet has the javax . portlet . renderHeaders container - runtime - option present and set to true .
34,946
protected PortletRenderResult getPortletRenderResult ( IPortletWindowId portletWindowId , HttpServletRequest request , HttpServletResponse response ) throws Exception { final IPortletRenderExecutionWorker tracker = getRenderedPortletBodyWorker ( portletWindowId , request , response ) ; final long timeout = getPortletRe...
Returns the PortletRenderResult waiting up to the portlet s timeout
34,947
protected IPortletRenderExecutionWorker startPortletHeaderRenderInternal ( IPortletWindowId portletWindowId , HttpServletRequest request , HttpServletResponse response ) { IPortletRenderExecutionWorker portletHeaderRenderWorker = this . portletWorkerFactory . createRenderHeaderWorker ( request , response , portletWindo...
create and submit the portlet header rendering job to the thread pool
34,948
protected IPortletRenderExecutionWorker startPortletRenderInternal ( IPortletWindowId portletWindowId , HttpServletRequest request , HttpServletResponse response ) { final Map < IPortletWindowId , Exception > portletFailureMap = getPortletErrorMap ( request ) ; final Exception cause = portletFailureMap . remove ( portl...
create and submit the portlet content rendering job to the thread pool
34,949
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 . capacity ) ; } return false ; } final boole...
Adds the element to the queue
34,950
protected void deletePortletEntity ( HttpServletRequest request , IPortletEntity portletEntity , boolean cacheOnly ) { final IPortletEntityId portletEntityId = portletEntity . getPortletEntityId ( ) ; final PortletEntityCache < IPortletEntity > portletEntityMap = this . getPortletEntityMap ( request ) ; portletEntityMa...
Delete a portlet entity removes it from the request session and persistent stores
34,951
protected IPortletEntity getPortletEntity ( HttpServletRequest request , PortletEntityCache < IPortletEntity > portletEntityCache , IPortletEntityId portletEntityId , String layoutNodeId , int userId ) { IPortletEntity portletEntity ; if ( portletEntityId != null ) { portletEntity = portletEntityCache . getEntity ( por...
Lookup the portlet entity by layoutNodeId and userId
34,952
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 = child . getNextSibling ( ...
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 .
34,953
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 .
34,954
public static void addPrefsDirective ( Element plfNode , String attributeName , IPerson person ) throws PortalException { addDirective ( plfNode , attributeName , Constants . ELM_PREF , person ) ; }
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 .
34,955
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 ) ; Element child = ( Element ) editSet . getFirstChild...
Create and append an edit directive to the edit set if not there .
34,956
public static boolean applyEditSet ( Element plfChild , Element original ) { Element editSet = null ; try { editSet = getEditSet ( plfChild , null , null , false ) ; } catch ( Exception e ) { return false ; } if ( editSet == null || editSet . getChildNodes ( ) . getLength ( ) == 0 ) return false ; if ( original . getAt...
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 .
34,957
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 ; try { editSet = getEditSet ( ...
Searches for a command of the passed - in type and if found removes it from the user s PLF .
34,958
protected void removeExpiredPortletCookies ( HttpServletRequest request ) { Map < String , SessionOnlyPortletCookieImpl > sessionOnlyCookies = getSessionOnlyPortletCookieMap ( request ) ; for ( Entry < String , SessionOnlyPortletCookieImpl > entry : sessionOnlyCookies . entrySet ( ) ) { String key = entry . getKey ( ) ...
Remove expired session only portlet cookies .
34,959
public InputSource resolveEntity ( String publicId , String systemId ) { InputStream inStream = null ; if ( systemId != null ) { if ( dtdName != null && systemId . indexOf ( dtdName ) != - 1 ) { inStream = getResourceAsStream ( dtdPath + "/" + dtdName ) ; } else if ( systemId . trim ( ) . equalsIgnoreCase ( "http://my....
Sets up a new input source based on the dtd specified in the xml document
34,960
protected String verifyPortletWindowId ( HttpServletRequest request , IPortletWindowId portletWindowId ) { final IUserInstance userInstance = this . userInstanceManager . getUserInstance ( request ) ; final IUserPreferencesManager preferencesManager = userInstance . getPreferencesManager ( ) ; final IUserLayoutManager ...
Verify the requested portlet window corresponds to a node in the user s layout and return the corresponding layout node id
34,961
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 = "org.apereo.portal.services.EntityNameFi...
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 .
34,962
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 ( ( IGro...
Remove the back pointers of the group members of the deleted group . Then update the cache to invalidate copies on peer servers .
34,963
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 ( ) ; gmi ....
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 .
34,964
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 == null )...
Wraps the targeted execution switching the current thread s context class loader to this classes class loader . Usage defined in persistanceContext . xml .
34,965
@ RequestMapping ( value = "/entity/{entityType}/{entityId}" , method = RequestMethod . DELETE ) public void deleteEntity ( @ PathVariable ( "entityType" ) String entityType , @ PathVariable ( "entityId" ) String entityId , HttpServletRequest request , HttpServletResponse response ) throws IOException { final IPerson p...
Delete an uPortal database object . This method provides a REST interface for uPortal database object deletion .
34,966
public double getStandardDeviation ( ) { double stdDev = Double . NaN ; if ( getN ( ) > 0 ) { if ( getN ( ) > 1 ) { stdDev = FastMath . sqrt ( getVariance ( ) ) ; } else { stdDev = 0.0 ; } } return stdDev ; }
Returns the standard deviation of the values that have been added .
34,967
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 ) ; } }
Send a batch of LRS statements . MUST BE SCHEDULED! Failure to properly configure this class will result in memory leaks .
34,968
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 ) { logger . trace ( "LRS provider successfully s...
Send the list of batched LRS statements to the LRS .
34,969
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 , this ) ; return ; } if ( this . statisticalSummary == null ) { this . statisticalSummary = new JpaStatistical...
Add the value to the summary statistics
34,970
@ 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 UnsupportedOperationException ( "Moved ...
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 .
34,971
public LrsStatement toLrsStatement ( PortalEvent event ) { return new LrsStatement ( getActor ( event ) , getVerb ( event ) , getLrsObject ( event ) ) ; }
Convert an event to an LrsStatement .
34,972
protected LrsActor getActor ( PortalEvent event ) { String username = event . getUserName ( ) ; return actorService . getLrsActor ( username ) ; }
Get the actor for an event .
34,973
protected URI buildUrn ( String ... parts ) { UrnBuilder builder = new UrnBuilder ( "UTF-8" , "tincan" , "uportal" , "activities" ) ; builder . add ( parts ) ; return builder . getUri ( ) ; }
Build the URN for the LrsStatement . This method attaches creates the base URN . Additional elements can be attached .
34,974
@ Bean ( name = "usernameAttributeProvider" ) public IUsernameAttributeProvider getUsernameAttributeProvider ( ) { final SimpleUsernameAttributeProvider rslt = new SimpleUsernameAttributeProvider ( ) ; rslt . setUsernameAttribute ( USERNAME_ATTRIBUTE ) ; return rslt ; }
Provides the default username attribute to use to the rest of the DAOs .
34,975
@ Bean ( name = "requestAttributeSourceFilter" ) public Filter getRequestAttributeSourceFilter ( ) { final RequestAttributeSourceFilter rslt = new RequestAttributeSourceFilter ( ) ; rslt . setAdditionalDescriptors ( getRequestAdditionalDescriptors ( ) ) ; rslt . setUsernameAttribute ( REMOTE_USER_ATTRIBUTE ) ; rslt . s...
Servlet filter that creates an attribute for the serverName
34,976
@ Bean ( name = "sessionAttributesOverridesMap" ) @ Scope ( value = "globalSession" , proxyMode = ScopedProxyMode . TARGET_CLASS ) public Map getSessionAttributesOverridesMap ( ) { return new ConcurrentHashMap ( ) ; }
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 .
34,977
@ Bean ( name = "personAttributeDao" ) @ Qualifier ( "personAttributeDao" ) public IPersonAttributeDao getPersonAttributeDao ( ) { final PortalRootPersonAttributeDao rslt = new PortalRootPersonAttributeDao ( ) ; rslt . setDelegatePersonAttributeDao ( getRequestAttributeMergingDao ( ) ) ; rslt . setAttributeOverridesMap...
Overrides DAO acts as the root it handles incorporating attributes from the attribute swapper utility wraps the caching DAO
34,978
@ Bean ( name = "requestAttributeMergingDao" ) @ Qualifier ( "uPortalInternal" ) public IPersonAttributeDao getRequestAttributeMergingDao ( ) { final MergingPersonAttributeDaoImpl rslt = new MergingPersonAttributeDaoImpl ( ) ; rslt . setUsernameAttributeProvider ( getUsernameAttributeProvider ( ) ) ; rslt . setMerger (...
Merges attributes from the request with those from other DAOs .
34,979
@ Bean ( name = "requestAttributesDao" ) @ Qualifier ( "uPortalInternal" ) public IPersonAttributeDao getRequestAttributesDao ( ) { final AdditionalDescriptorsPersonAttributeDao rslt = new AdditionalDescriptorsPersonAttributeDao ( ) ; rslt . setDescriptors ( getRequestAdditionalDescriptors ( ) ) ; rslt . setUsernameAtt...
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 .
34,980
@ Bean ( name = "cachingPersonAttributeDao" ) @ Qualifier ( "uPortalInternal" ) public IPersonAttributeDao getCachingPersonAttributeDao ( ) { final CachingPersonAttributeDaoImpl rslt = new CachingPersonAttributeDaoImpl ( ) ; rslt . setUsernameAttributeProvider ( getUsernameAttributeProvider ( ) ) ; rslt . setCacheNullR...
Defines the order that the data providing DAOs are called results are cached by the outer caching DAO .
34,981
@ Bean ( name = "innerMergedPersonAttributeDaoList" ) public List < IPersonAttributeDao > getInnerMergedPersonAttributeDaoList ( ) { final List < IPersonAttributeDao > rslt = new ArrayList < > ( ) ; rslt . add ( getImpersonationStatusPersonAttributeDao ( ) ) ; rslt . add ( getUPortalAccountUserSource ( ) ) ; rslt . add...
IPersonAttributeDao beans defined by implementors will be added to this list when the ApplicationContext comes up .
34,982
@ Bean ( name = "uPortalAccountUserSource" ) @ Qualifier ( "uPortalInternal" ) public IPersonAttributeDao getUPortalAccountUserSource ( ) { final LocalAccountPersonAttributeDao rslt = new LocalAccountPersonAttributeDao ( ) ; rslt . setLocalAccountDao ( localAccountDao ) ; rslt . setUsernameAttributeProvider ( getUserna...
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 .
34,983
@ 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 ) ; rslt . setUsernameAtt...
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 .
34,984
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 . ATT_VALUE , value ) ...
Performs parameter child element creation in the passed in Element .
34,985
protected final < T > TypedQuery < T > createQuery ( CriteriaQuery < T > criteriaQuery ) { return this . getEntityManager ( ) . createQuery ( criteriaQuery ) ; }
Common logic for creating and configuring JPA queries
34,986
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 . s...
Important common logic for creating and configuring JPA queries cached in EhCache . This step is important for the sake of scalability .
34,987
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 ( r...
Creates the cache region name for the criteria query
34,988
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 ) ; session = new HashMap ( ) ; } return Collectio...
Returns reference to a current session map .
34,989
protected RenderBuilder render ( ) { String template = Router . getControllerPath ( getClass ( ) ) + "/" + RequestContext . getRoute ( ) . getActionName ( ) ; return super . render ( template , values ( ) ) ; }
Use this method in order to override a layout status code and content type .
34,990
public boolean actionSupportsHttpMethod ( String actionMethodName , HttpMethod httpMethod ) { if ( restful ( ) ) { return restfulActionSupportsHttpMethod ( actionMethodName , httpMethod ) || standardActionSupportsHttpMethod ( actionMethodName , httpMethod ) ; } else { return standardActionSupportsHttpMethod ( actionMet...
Checks if the action supports an HTTP method according to its configuration .
34,991
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 , controllerPath , httpM...
This is a main method for recognizing a route to a controller ; used when a request is received .
34,992
private Route matchStandard ( String uri , ControllerPath controllerPathObject , AppController controller , HttpMethod method ) { String controllerPath = ( controllerPathObject . getControllerPackage ( ) != null ? "/" + controllerPathObject . getControllerPackage ( ) . replace ( "." , "/" ) : "" ) + "/" + controllerPat...
Will match a standard non - restful route .
34,993
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 ( "" ) ) throw ne...
Now that we know that this controller is under a package need to find the controller short name .
34,994
protected String findPackageSuffix ( String uri ) { String temp = uri . startsWith ( "/" ) ? uri . substring ( 1 ) : uri ; temp = temp . replace ( "." , "_" ) ; temp = temp . replace ( "/" , "." ) ; List < String > candidates = new ArrayList < > ( ) ; for ( String pack : Configuration . getControllerPackages ( ) ) { if...
Finds a part of a package name which can be found in between app . controllers and short name of class .
34,995
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 IllegalArgumentException ( "Cannot combine {controller} segment an...
Allows to wire a route to a controller .
34,996
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 .action(\"...\") method. Failed route: " + ...
Name of action to which a route is mapped .
34,997
public RouteBuilder get ( ) { if ( ! methods . contains ( HttpMethod . GET ) ) { methods . add ( HttpMethod . GET ) ; } return this ; }
Specifies that this route is mapped to HTTP GET method .
34,998
public RouteBuilder post ( ) { if ( ! methods . contains ( HttpMethod . POST ) ) { methods . add ( HttpMethod . POST ) ; } return this ; }
Specifies that this route is mapped to HTTP POST method .
34,999
public RouteBuilder options ( ) { if ( ! methods . contains ( HttpMethod . OPTIONS ) ) { methods . add ( HttpMethod . OPTIONS ) ; } return this ; }
Specifies that this route is mapped to HTTP OPTIONS method .