idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
34,700
static void adjustPositionSet ( List < NodeInfo > order , Element positionSet , IntegrationResult result ) { Node nodeToMatch = positionSet . getFirstChild ( ) ; Element nodeToInsertBefore = positionSet . getOwnerDocument ( ) . createElement ( "INSERT_POINT" ) ; positionSet . insertBefore ( nodeToInsertBefore , nodeToM...
This method trims down the position set to the position directives on the node info elements still having a position directive . Any directives that violated restrictions were removed from the node info objects so the position set should be made to match the order of those still having one .
34,701
static boolean hasAffectOnCVP ( List < NodeInfo > order , Element compViewParent ) { if ( order . size ( ) == 0 ) return false ; int idx = 0 ; Element child = ( Element ) compViewParent . getFirstChild ( ) ; NodeInfo ni = order . get ( idx ) ; if ( child == null && ni != null ) return true ; while ( child != null ) { i...
This method compares the children by id in the order list with the order in the compViewParent s ui visible children and returns true if the ordering differs indicating that the positioning if needed .
34,702
static void applyToNodes ( List < NodeInfo > order , Element compViewParent ) { Node insertPoint = compViewParent . getOwnerDocument ( ) . createElement ( "bogus" ) ; Node first = compViewParent . getFirstChild ( ) ; if ( first != null ) compViewParent . insertBefore ( insertPoint , first ) ; else compViewParent . appe...
This method applies the ordering specified in the passed in order list to the child nodes of the compViewParent . Nodes specified in the list but located elsewhere are pulled in .
34,703
static void applyNoHopping ( List < NodeInfo > order ) { if ( isIllegalHoppingSpecified ( order ) == true ) { ArrayList < NodeInfo > cvpNodeInfos = new ArrayList < > ( ) ; for ( int i = order . size ( ) - 1 ; i >= 0 ; i -- ) if ( order . get ( i ) . getIndexInCVP ( ) != - 1 ) cvpNodeInfos . add ( order . remove ( i ) )...
This method is responsible for preventing nodes with identical precedence in the same parent from hopping over each other so that a layout fragment can lock two tabs that are next to each other and they can only be separated by tabs with higher precedence .
34,704
static boolean isIllegalHoppingSpecified ( List < NodeInfo > order ) { for ( int i = 0 ; i < order . size ( ) ; i ++ ) { NodeInfo ni = ( NodeInfo ) order . get ( i ) ; if ( ! ni . getNode ( ) . getAttribute ( Constants . ATT_MOVE_ALLOWED ) . equals ( "false" ) ) continue ; for ( int j = 0 ; j < i ; j ++ ) { NodeInfo ni...
This method determines if any illegal hopping is being specified . To determine if the positioning is specifying an ordering that will result in hopping I need to determine for each node n in the list if any of the nodes to be positioned to its right currently lie to its left in the CVP and have moveAllowed = false and...
34,705
static void applyOrdering ( List < NodeInfo > order , Element compViewParent , Element positionSet , NodeInfoTracker tracker ) { final Map < String , NodeInfo > available = new LinkedHashMap < String , NodeInfo > ( ) ; Element child = ( Element ) compViewParent . getFirstChild ( ) ; Element next = null ; int indexInCVP...
This method assembles in the passed in order object a list of NodeInfo objects ordered first by those specified in the position set and whose nodes still exist in the composite view and then by any remaining children in the compViewParent .
34,706
public static void updatePositionSet ( Element compViewParent , Element plfParent , IPerson person ) throws PortalException { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Updating Position Set" ) ; if ( compViewParent . getChildNodes ( ) . getLength ( ) == 0 ) { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "No Nodes...
This method updates the positions recorded in a position set to reflect the ids of the nodes in the composite view of the layout . Any position nodes already in existence are reused to reduce database interaction needed to generate a new ID attribute . If any are left over after updating those position elements are rem...
34,707
private static Element getPositionSet ( Element plfParent , IPerson person , boolean create ) throws PortalException { Node child = plfParent . getFirstChild ( ) ; while ( child != null ) { if ( child . getNodeName ( ) . equals ( Constants . ELM_POSITION_SET ) ) return ( Element ) child ; child = child . getNextSibling...
This method locates the position set element in the child list of the passed in plfParent or if not found it will create one automatically and return it if the passed in create flag is true .
34,708
private static Element createAndAppendPosition ( String elementID , Element positions , IPerson person ) throws PortalException { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Adding Position Set entry " + elementID + "." ) ; String ID = null ; try { ID = getDLS ( ) . getNextStructDirectiveId ( person ) ; } catch ( Ex...
Create append to the passed in position set and return a position element that references the passed in elementID .
34,709
private void updateScript ( String target , String databaseQualifier , String outputFile , boolean runIt ) { final ISchemaExport schemaExportBean = this . getSchemaExport ( databaseQualifier ) ; if ( schemaExportBean == null ) { throw new RuntimeException ( target + " could not find schemaExportBean " + databaseQualifi...
This runs a database update or just generates the script
34,710
private String formatBody ( URL resetUrl , ILocalAccountPerson account , Locale locale ) { final STGroup group = new STGroupDir ( templateDir , '$' , '$' ) ; final ST template = group . getInstanceOf ( templateName ) ; String name = findDisplayNameFromLocalAccountPerson ( account ) ; template . add ( "displayName" , na...
Get the body content of the email .
34,711
protected String findDisplayNameFromLocalAccountPerson ( ILocalAccountPerson person ) { Object name = person . getAttributeValue ( ILocalAccountPerson . ATTR_DISPLAY_NAME ) ; if ( ( name instanceof String ) && ! StringUtils . isEmpty ( ( String ) name ) ) { return ( String ) name ; } return person . getName ( ) ; }
Determine the name to use in the password reset email that identifies the users whose password has been reset .
34,712
final void doPopulateTimeDimensions ( ) { final List < TimeDimension > timeDimensions = this . timeDimensionDao . getTimeDimensions ( ) ; if ( timeDimensions . isEmpty ( ) ) { logger . info ( "No TimeDimensions exist, creating them" ) ; } else if ( timeDimensions . size ( ) != ( 24 * 60 ) ) { this . logger . info ( "Th...
Populate the time dimensions
34,713
protected void createDateDimension ( List < QuarterDetail > quartersDetails , List < AcademicTermDetail > academicTermDetails , DateMidnight date ) { final QuarterDetail quarterDetail = EventDateTimeUtils . findDateRangeSorted ( date , quartersDetails ) ; final AcademicTermDetail termDetail = EventDateTimeUtils . findD...
Creates a date dimension handling the quarter and term lookup logic
34,714
public static String getStringFromPortletUrl ( PortletUrl portletUrl , HttpServletRequest request ) { if ( portletUrl == null ) { return null ; } UrlType urlType = UrlType . RENDER ; final PortletUrlType type = portletUrl . getType ( ) ; switch ( type ) { case ACTION : urlType = UrlType . ACTION ; break ; case RESOURCE...
A static EL function that is defined in portletUrl . tld Takes a portletUrl object and coverts it into an actual Url Example is in search returns a marketplace entry Url
34,715
public void setChannelPublishingDefinition ( PortletPublishingDefinition cpd ) { if ( cpd . getPortletDescriptor ( ) != null ) { final PortletDescriptor pDesc = cpd . getPortletDescriptor ( ) ; final boolean isFramework = pDesc . isIsFramework ( ) != null ? pDesc . isIsFramework ( ) : false ; applicationId = isFramewor...
Sets the Java class name and parameter defaults based on the PortletPublishingDefinition .
34,716
private void initPermissionsForPrincipal ( JsonEntityBean principal ) { permissions . add ( principal . getTypeAndIdHash ( ) + "_" + PortletAdministrationHelper . PortletPermissionsOnForm . BROWSE . getActivity ( ) ) ; permissions . add ( principal . getTypeAndIdHash ( ) + "_" + PortletAdministrationHelper . PortletPer...
Sets the default collection of permissions for newly - added principals . They are BROWSE and SUBSCRIBE .
34,717
public void setExpirationDateString ( String date ) throws ParseException { if ( StringUtils . isBlank ( date ) ) { expirationDate = null ; return ; } expirationDate = dateFormat . parse ( date ) ; }
Set the expiration date as a string .
34,718
public void setPublishDateString ( String date ) throws ParseException { if ( StringUtils . isBlank ( date ) ) { publishDate = null ; return ; } publishDate = dateFormat . parse ( date ) ; }
Set the publish date as a string . This is just a webflow workaround .
34,719
public void setServiceName ( Name newServiceName ) throws GroupsException { try { getCompositeEntityIdentifier ( ) . setServiceName ( newServiceName ) ; } catch ( javax . naming . InvalidNameException ine ) { throw new GroupsException ( "Problem setting service name" , ine ) ; } }
Sets the service Name of the group service of origin .
34,720
public void updateMembers ( ) throws GroupsException { Set < IGroupMember > invalidate = new HashSet < > ( ) ; invalidate . addAll ( getAddedMembers ( ) . values ( ) ) ; invalidate . addAll ( getRemovedMembers ( ) . values ( ) ) ; getLocalGroupService ( ) . updateGroupMembers ( this ) ; clearPendingUpdates ( ) ; this ....
Delegate to the factory .
34,721
public static String getEventName ( int eventId ) { switch ( eventId ) { case XMLStreamConstants . START_ELEMENT : return "StartElementEvent" ; case XMLStreamConstants . END_ELEMENT : return "EndElementEvent" ; case XMLStreamConstants . PROCESSING_INSTRUCTION : return "ProcessingInstructionEvent" ; case XMLStreamConsta...
Get the human readable event name for the numeric event id
34,722
public Evaluator getAttributeEvaluator ( String name , String mode , String value ) { return new GroupMembershipEvaluator ( mode , name ) ; }
Returns an instance of an evaluator specific to this factory and the passed in values . Name should be a well known group name . Case is important . The mode should be memberOf for now . Other modes may be added in the future like deepMemberOf .
34,723
private List < IPersonAttributes > getVisiblePersons ( final IAuthorizationPrincipal principal , final Set < String > permittedAttributes , List < IPersonAttributes > peopleList ) { List < Future < IPersonAttributes > > futures = new ArrayList < > ( ) ; List < IPersonAttributes > list = new ArrayList < > ( ) ; RequestA...
Returns a list of the personAttributes that this principal has permission to view . This implementation does the check on the list items in parallel because personDirectory is consulted for non - admin principals to get the person attributes which is really slow if done on N entries in parallel because personDirectory ...
34,724
private boolean allListItemsHaveDisplayName ( List < IPersonAttributes > people ) { for ( IPersonAttributes person : people ) { if ( person . getAttributeValue ( "displayName" ) == null ) { return false ; } } return true ; }
Utility class to determine if all items in the list of people have a displayName .
34,725
protected IAuthorizationPrincipal getPrincipalForUser ( final IPerson person ) { final EntityIdentifier ei = person . getEntityIdentifier ( ) ; return AuthorizationServiceFacade . instance ( ) . newPrincipal ( ei . getKey ( ) , ei . getType ( ) ) ; }
Get the authoriztaion principal matching the supplied IPerson .
34,726
protected Set < String > getPermittedAttributes ( final IAuthorizationPrincipal principal ) { final Set < String > attributeNames = personAttributeDao . getPossibleUserAttributeNames ( ) ; return getPermittedAttributes ( principal , attributeNames ) ; }
Get the set of all user attribute names defined in the portal for which the specified principal has the attribute viewing permission .
34,727
public Map < String , Document > getFragmentLayoutCopies ( ) { final Locale defaultLocale = localeManagerFactory . getPortalLocales ( ) . get ( 0 ) ; final Map < String , Document > layouts = new HashMap < > ( ) ; final List < FragmentDefinition > definitions = this . fragmentUtils . getFragmentDefinitions ( ) ; for ( ...
Method for acquiring copies of fragment layouts to assist in debugging . No infrastructure code calls this but channels designed to expose the structure of the cached fragments use this to obtain copies .
34,728
public DistributedUserLayout getUserLayout ( IPerson person , IUserProfile profile ) { final DistributedUserLayout layout = this . _getUserLayout ( person , profile ) ; return layout ; }
Returns the layout for a user decorated with any specified decorator . The layout returned is a composite layout for non fragment owners and a regular layout for layout owners . A composite layout is made up of layout pieces from potentially multiple incorporated layouts . If no layouts are defined then the composite l...
34,729
private Document _safeGetUserLayout ( IPerson person , IUserProfile profile ) { Document layoutDoc ; Tuple < String , String > key = null ; final Cache < Tuple < String , String > , Document > layoutCache = getLayoutImportExportCache ( ) ; if ( layoutCache != null ) { key = new Tuple < > ( person . getUserName ( ) , pr...
Handles locking and identifying proper root and namespaces that used to take place in super class .
34,730
private DistributedUserLayout _getUserLayout ( IPerson person , IUserProfile profile ) { final String userName = ( String ) person . getAttribute ( "username" ) ; final FragmentDefinition ownedFragment = this . fragmentUtils . getFragmentDefinitionByOwner ( person ) ; final boolean isLayoutOwnerDefault = this . isLayou...
Returns the layout for a user . This method overrides the same method in the superclass to return a composite layout for non fragment owners and a regular layout for layout owners . A composite layout is made up of layout pieces from potentially multiple incorporated layouts . If no layouts are defined then the composi...
34,731
public Document getFragmentLayout ( IPerson person , IUserProfile profile ) { return this . _safeGetUserLayout ( person , profile ) ; }
Convenience method for fragment activator to obtain raw layouts for fragments during initialization .
34,732
private void updateCachedLayout ( Document layout , IUserProfile profile , FragmentDefinition fragment ) { final Locale locale = profile . getLocaleManager ( ) . getLocales ( ) . get ( 0 ) ; layout = ( Document ) layout . cloneNode ( true ) ; final Element root = layout . getDocumentElement ( ) ; final UserView userVie...
Replaces the layout Document stored on a fragment definition with a new version . This is called when a fragment owner updates their layout .
34,733
private boolean isLayoutOwnerDefault ( IPerson person ) { final String userName = ( String ) person . getAttribute ( "username" ) ; final List < FragmentDefinition > definitions = this . fragmentUtils . getFragmentDefinitions ( ) ; if ( userName != null && definitions != null ) { for ( final FragmentDefinition fragment...
Returns true if the user is the owner of a layout which is copied as the default for any fragment when first created .
34,734
public void setUserLayout ( IPerson person , IUserProfile profile , Document layoutXML , boolean channelsAdded ) { this . setUserLayout ( person , profile , layoutXML , channelsAdded , true ) ; }
This method overrides the same method in the super class to persist only layout information stored in the user s person layout fragment or PLF . If this person is a layout owner then their changes are pushed into the appropriate layout fragment .
34,735
public void setUserLayout ( IPerson person , IUserProfile profile , Document layoutXML , boolean channelsAdded , boolean updateFragmentCache ) { final Document plf = ( Document ) person . getAttribute ( Constants . PLF ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "PLF for {}\n{}" , person . getAttribute ( ...
This method overrides the same method in the super class to persist only layout information stored in the user s person layout fragment or PLF . If fragment cache update is requested then it checks to see if this person is a layout owner and if so then their changes are pushed into the appropriate layout fragment .
34,736
private static synchronized void storeSingleton ( ) { if ( PERSON_DIR_NAME_FINDER_INSTANCE == null ) { IPersonAttributeDao personAttributeDao = PersonAttributeDaoLocator . getPersonAttributeDao ( ) ; PERSON_DIR_NAME_FINDER_INSTANCE = new PersonDirNameFinder ( personAttributeDao ) ; } }
Instantiates the static singleton field PERSON_DIR_NAME_FINDER_INSTANCE . Synchronized to guarantee singleton - ness of the field .
34,737
protected String getResourceId ( IPortletWindowId portletWindowId , final IPortalRequestInfo portalRequestInfo ) { final IPortletRequestInfo portletRequestInfo = portalRequestInfo . getPortletRequestInfo ( portletWindowId ) ; if ( portletRequestInfo == null ) { return null ; } return portletRequestInfo . getResourceId ...
The portlet resource request resourceId
34,738
protected final Object getEventSessionMutex ( HttpSession session ) { synchronized ( WebUtils . getSessionMutex ( session ) ) { SerializableObject mutex = ( SerializableObject ) session . getAttribute ( EVENT_SESSION_MUTEX ) ; if ( mutex == null ) { mutex = new SerializableObject ( ) ; session . setAttribute ( EVENT_SE...
Get a session scoped mutex specific to this class
34,739
public GroupForm getGroupForm ( String key ) { log . debug ( "Initializing group form for group key " + key ) ; IEntityGroup group = GroupService . findGroup ( key ) ; GroupForm form = new GroupForm ( ) ; form . setKey ( key ) ; form . setName ( group . getName ( ) ) ; form . setDescription ( group . getDescription ( )...
Construct a group form for the group with the specified key .
34,740
public void deleteGroup ( String key , IPerson deleter ) { if ( ! canDeleteGroup ( deleter , key ) ) { throw new RuntimeAuthorizationException ( deleter , IPermission . DELETE_GROUP_ACTIVITY , key ) ; } log . info ( "Deleting group with key " + key ) ; IEntityGroup group = GroupService . findGroup ( key ) ; for ( IEnti...
Delete a group from the group store
34,741
public void updateGroupDetails ( GroupForm groupForm , IPerson updater ) { if ( ! canEditGroup ( updater , groupForm . getKey ( ) ) ) { throw new RuntimeAuthorizationException ( updater , IPermission . EDIT_GROUP_ACTIVITY , groupForm . getKey ( ) ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Updating group for...
Update the title and description of an existing group in the group store .
34,742
public void updateGroupMembers ( GroupForm groupForm , IPerson updater ) { if ( ! canEditGroup ( updater , groupForm . getKey ( ) ) ) { throw new RuntimeAuthorizationException ( updater , IPermission . EDIT_GROUP_ACTIVITY , groupForm . getKey ( ) ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Updating group mem...
Update the members of an existing group in the group store .
34,743
public void createGroup ( GroupForm groupForm , JsonEntityBean parent , IPerson creator ) { if ( ! canCreateMemberGroup ( creator , parent . getId ( ) ) ) { throw new RuntimeAuthorizationException ( creator , IPermission . CREATE_GROUP_ACTIVITY , groupForm . getKey ( ) ) ; } if ( log . isDebugEnabled ( ) ) { log . debu...
Create a new group under the specified parent . The new group will automatically be added to the parent group .
34,744
private void selectFormExecutionType ( final PortletExecutionReportForm report ) { if ( ! report . getExecutionTypeNames ( ) . isEmpty ( ) ) { return ; } report . getExecutionTypeNames ( ) . add ( ExecutionType . RENDER . name ( ) ) ; }
Select the XXXX execution type by default for the form
34,745
protected List < ColumnDescription > getColumnDescriptions ( PortletExecutionAggregationDiscriminator reportColumnDiscriminator , PortletExecutionReportForm form ) { int groupSize = form . getGroups ( ) . size ( ) ; int portletSize = form . getPortlets ( ) . size ( ) ; int executionTypeSize = form . getExecutionTypeNam...
Create column descriptions for the portlet report using the configured report labelling strategy .
34,746
public void setServerRegex ( String serverRegex ) { Validate . notBlank ( serverRegex ) ; this . serverRegex = serverRegex ; this . pattern = Pattern . compile ( this . serverRegex ) ; }
Sets the regular expression for the servers you want to select a profile for
34,747
public synchronized Name getServiceName ( ) { if ( size ( ) < 2 ) { return null ; } if ( cachedServiceName == null ) { cachedServiceName = getCompositeKey ( ) . getPrefix ( size ( ) - 1 ) ; } return cachedServiceName ; }
If the composite key is either empty or has a single node there is no service name .
34,748
protected String getMediaType ( HttpServletRequest req , HttpServletResponse res , PipelineEventReader < CharacterEventReader , CharacterEvent > pipelineEventReader ) { final String mediaType = pipelineEventReader . getOutputProperty ( OutputKeys . MEDIA_TYPE ) ; if ( mediaType != null ) { return mediaType ; } this . l...
Determine the media type to use for the response
34,749
protected Set < AggregatedGroupMapping > getGroupsForEvent ( PortalEvent event ) { final Set < AggregatedGroupMapping > groupMappings = new LinkedHashSet < AggregatedGroupMapping > ( ) ; if ( event instanceof LoginEvent ) { for ( final String groupKey : ( ( LoginEvent ) event ) . getGroups ( ) ) { final AggregatedGroup...
Get groups for the event
34,750
public static void finishedSession ( IPerson person ) { LOGGER . trace ( "Invoking finishedSession for IPerson [{}]" , person ) ; try { instance ( ) . ifinishedSession ( person ) ; } catch ( GroupsException ge ) { LOGGER . error ( "Error upon session finishing for person [{}]" , person , ge ) ; } }
Receives notice that the UserInstance has been unbound from the HttpSession . In response we remove the corresponding group member from the cache .
34,751
private void ifinishedSession ( IPerson person ) throws GroupsException { IGroupMember gm = getGroupMember ( person . getEntityIdentifier ( ) ) ; try { final EntityIdentifier entityIdentifier = gm . getEntityIdentifier ( ) ; EntityCachingService . getEntityCachingService ( ) . remove ( entityIdentifier . getType ( ) , ...
Receives notice that the UserInstance has been unbound from the HttpSession . In response we remove the corresponding group member from the cache . We use the roundabout route of creating a group member and then getting its EntityIdentifier because we need the EntityIdentifier for the group member which is cached not t...
34,752
public String generateToken ( final DynamicSkinInstanceData data ) { final PortletPreferences preferences = data . getPortletRequest ( ) . getPreferences ( ) ; int hash = 0 ; final Map < String , String [ ] > prefs = preferences . getMap ( ) ; final TreeSet < String > orderedNames = new TreeSet < String > ( prefs . key...
Returns a String hashcode of the values for the portlet preferences that are configurable by the Dynamic Skin portlet . The hashcode is generated in a repeatable fashion by calculating it based on sorted portlet preference names . Though hashcode does not guarantee uniqueness from a practical perspective we ll have so ...
34,753
public String initializeView ( WebRequest webRequest , PortletRequest portletRequest , Model model , @ RequestParam ( required = false ) String initialFilter ) { this . setUpInitialView ( webRequest , portletRequest , model , initialFilter ) ; return "jsp/Marketplace/portlet/view" ; }
Returns a view of the marketplace landing page
34,754
public Map < String , Set < ? > > getRegistry ( final IPerson user , final PortletRequest req ) { Map < String , Set < ? > > registry = new TreeMap < String , Set < ? > > ( ) ; final Set < PortletCategory > permittedCategories = getPermittedCategories ( req ) ; final Set < MarketplaceEntry > visiblePortlets = this . ma...
Returns a set of MarketplacePortletDefinitions . Supply a user to limit the set to only portlets the user can use . If user is null this will return all portlets . Setting user to null will superscede all other parameters .
34,755
public static void deleteNode ( Element compViewNode , IPerson person ) throws PortalException { String ID = compViewNode . getAttribute ( Constants . ATT_ID ) ; if ( ID . startsWith ( Constants . FRAGMENT_ID_USER_PREFIX ) ) DeleteManager . addDeleteDirective ( compViewNode , ID , person ) ; else { Document plf = ( Doc...
Handles user requests to delete UI elements . For ILF owned nodes it delegates to the DeleteManager to add a delete directive . For PLF owned nodes it deletes the node outright .
34,756
private Set < String > detectInvalidFields ( final String name , final String fname , final Map < String , String > attributes ) { final Set < String > rslt = new HashSet < > ( ) ; try { tenantService . validateName ( name ) ; tenantService . validateFname ( fname ) ; } catch ( Exception e ) { log . warn ( "Validation ...
Returns a collection of invalid fields if any .
34,757
protected Map < D , SortedSet < T > > getDefaultGroupedColumnDiscriminatorMap ( F form ) { List < Long > groups = form . getGroups ( ) ; final Map < D , SortedSet < T > > groupedAggregations = new TreeMap < D , SortedSet < T > > ( ( Comparator < ? super D > ) getDiscriminatorComparator ( ) ) ; for ( final Long queryGro...
Default implementation to create a map of the report column discriminators based on the submitted form to collate the aggregation data into each column of a report when the only grouping parameter is AggregatedGroupMapping .
34,758
protected void doHeaders ( RenderRequest request , RenderResponse response ) { try { doDispatch ( request , response ) ; } catch ( IOException | PortletException ex ) { logger . error ( "Exception rendering headers for portlet " + getPortletName ( ) + ". Aborting doHeaders" , ex ) ; } }
Used by the render method to set the response properties and headers .
34,759
protected void doRenderService ( RenderRequest request , RenderResponse response ) throws Exception { super . doRenderService ( request , response ) ; }
Processes the actual dispatching to the handler for render requests .
34,760
public int purgeCacheEntries ( CacheEntryTag tag ) { final String tagType = tag . getTagType ( ) ; final Set < Ehcache > caches = taggedCaches . getIfPresent ( tagType ) ; if ( caches == null || caches . isEmpty ( ) ) { return 0 ; } int purgeCount = 0 ; for ( final Ehcache cache : caches ) { final String cacheName = ca...
Remove all cache entries with keys that have the specified tag
34,761
protected Set < CacheEntryTag > getTags ( Element element ) { final Object key = element . getObjectKey ( ) ; if ( key instanceof TaggedCacheEntry ) { return ( ( TaggedCacheEntry ) key ) . getTags ( ) ; } final Object value = element . getObjectValue ( ) ; if ( value instanceof TaggedCacheEntry ) { return ( ( TaggedCac...
Get the tags associated with the element
34,762
protected void putElement ( Ehcache cache , Element element ) { final Set < CacheEntryTag > tags = this . getTags ( element ) ; if ( tags != null && ! tags . isEmpty ( ) ) { final String cacheName = cache . getName ( ) ; final Object key = element . getObjectKey ( ) ; final LoadingCache < CacheEntryTag , Set < Object >...
If the element has a TaggedCacheKey record the tag associations
34,763
protected void removeElement ( Ehcache cache , Element element ) { final Set < CacheEntryTag > tags = this . getTags ( element ) ; if ( tags != null && ! tags . isEmpty ( ) ) { final String cacheName = cache . getName ( ) ; final LoadingCache < CacheEntryTag , Set < Object > > cacheKeys = taggedCacheKeys . getIfPresent...
If the element has a TaggedCacheKey remove the tag associations
34,764
public Evaluator getAttributeEvaluator ( String name , String mode , String value ) throws Exception { return new AttributeEvaluator ( name , mode , value ) ; }
returns an Evaluator unique to the type of attribute being evaluated . subclasses can override this method to return the Evaluator that s appropriate to their implementation .
34,765
public synchronized void authenticate ( ) throws PortalSecurityException { if ( this . remoteUser != null ) { this . myPrincipal . setUID ( this . remoteUser ) ; final String newUid = this . myPrincipal . getUID ( ) ; if ( this . remoteUser . equals ( newUid ) ) { if ( log . isInfoEnabled ( ) ) { log . info ( "Authenti...
Verify that remoteUser is not null and set the principal s UID to this value .
34,766
public synchronized boolean updateNode ( IUserLayoutNodeDescription node ) throws PortalException { if ( canUpdateNode ( node ) ) { String nodeId = node . getId ( ) ; IUserLayoutNodeDescription oldNode = getNode ( nodeId ) ; if ( oldNode instanceof IUserLayoutChannelDescription ) { IUserLayoutChannelDescription oldChan...
Handles pushing changes made to the passed - in node into the user s layout . If the node is an ILF node then the change is recorded via directives in the PLF if such changes are allowed by the owning fragment . If the node is a user owned node then the changes are applied directly to the corresponding node in the PLF ...
34,767
private void updateFolderNode ( String nodeId , IUserLayoutFolderDescription newFolderDesc , IUserLayoutFolderDescription oldFolderDesc ) throws PortalException { Element ilfNode = ( Element ) getUserLayoutDOM ( ) . getElementById ( nodeId ) ; List < ILayoutProcessingAction > pendingActions = new ArrayList < ILayoutPro...
Compares the new folder description object with the old folder description object to determine what items were changed and if those changes are allowed . Once all changes are verified as being allowed changes then they are pushed into both the ILF and the PLF as appropriate . No changes are made until we determine that...
34,768
private void updateNodeAttribute ( Element ilfNode , String nodeId , String attName , String newVal , String oldVal , List < ILayoutProcessingAction > pendingActions ) throws PortalException { if ( newVal == null && oldVal != null || newVal != null && oldVal == null || ( newVal != null && oldVal != null && ! newVal . e...
Handles checking for updates to a named attribute verifying such change is allowed and generates an action object to make that change .
34,769
private Map getPublishedChannelParametersMap ( String channelPublishId ) throws PortalException { try { IPortletDefinitionRegistry registry = PortletDefinitionRegistryLocator . getPortletDefinitionRegistry ( ) ; IPortletDefinition def = registry . getPortletDefinition ( channelPublishId ) ; return def . getParametersAs...
Return a map parameter names to channel parameter objects representing the parameters specified at publish time for the channel with the passed - in publish id .
34,770
protected boolean canDeleteNode ( IUserLayoutNodeDescription node ) throws PortalException { if ( node == null ) return false ; return isFragmentOwner || node . isDeleteAllowed ( ) ; }
Returns true if the node exists in the underlying DOM model and it does not contain a deleteAllowed attribute with a value of false .
34,771
public boolean canUpdateNode ( IUserLayoutNodeDescription node ) { if ( node == null ) return false ; return isFragmentOwner || node . isEditAllowed ( ) || node instanceof IUserLayoutChannelDescription ; }
Returns true if we are dealing with a fragment layout or if editing of attributes is allowed or the node is a channel since ad - hoc parameters can always be added .
34,772
public String getSubscribeId ( String fname ) { final Document userLayout = this . getUserLayoutDOM ( ) ; return new PortletSubscribeIdResolver ( fname ) . traverseDocument ( userLayout ) ; }
Returns the subscribe ID of a channel having the passed in functional name or null if it can t find such a channel in the layout .
34,773
public boolean resetLayout ( String loginId ) { boolean resetSuccess = false ; boolean resetCurrentUserLayout = ( null == loginId ) ; if ( resetCurrentUserLayout || ( ! resetCurrentUserLayout && AdminEvaluator . isAdmin ( owner ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Reset layout requested for user wit...
Resets the layout of the user with the specified user id if the current user is an administrator or a member of any administrative sub - group . Has no effect if these requirements are not met .
34,774
private boolean resetLayout ( IPerson person ) { final String userName = person . getUserName ( ) ; if ( PersonFactory . getGuestUsernames ( ) . contains ( userName ) ) { throw new IllegalArgumentException ( "CANNOT RESET LAYOUT FOR A GUEST USER: " + person ) ; } LOG . warn ( "Resetting user layout for: " + userName , ...
Resets the layout of the specified user .
34,775
protected String getDefaultTabIndex ( HttpServletRequest httpServletRequest ) { final String stylesheetParameter = this . stylesheetUserPreferencesService . getStylesheetParameter ( httpServletRequest , PreferencesScope . STRUCTURE , this . defaultTabParameter ) ; if ( stylesheetParameter != null ) { return stylesheetP...
Get the index of the default tab for the user
34,776
public void delete ( IEntityLock lock ) throws LockingException { Map m = getLockCache ( lock . getEntityType ( ) ) ; synchronized ( m ) { m . remove ( getCacheKey ( lock ) ) ; } }
Deletes this IEntityLock from the store .
34,777
public IEntityLock find ( IEntityLock lock ) throws LockingException { IEntityLock foundLock = null ; Map m = getLockCache ( lock . getEntityType ( ) ) ; foundLock = getLockFromCache ( getCacheKey ( lock ) , m ) ; if ( foundLock != null ) { if ( lock . getLockType ( ) != foundLock . getLockType ( ) || ! lock . getExpir...
Returns this lock if it exists in the store .
34,778
public void update ( IEntityLock lock , java . util . Date newExpiration , Integer newLockType ) throws LockingException { if ( find ( lock ) == null ) { throw new LockingException ( "Problem updating " + lock + " : not found in store." ) ; } primAdd ( lock , newExpiration ) ; }
Make sure the store has a reference to the lock and then add the lock to refresh the SmartCache wrapper .
34,779
private void primAdd ( IEntityLock lock , Date expiration ) throws LockingException { long now = System . currentTimeMillis ( ) ; long willExpire = expiration . getTime ( ) ; long cacheIntervalSecs = ( willExpire - now ) / 1000 ; if ( cacheIntervalSecs > 0 ) { SmartCache sc = ( SmartCache ) getLockCache ( lock . getEnt...
Adds this IEntityLock to the store .
34,780
public IEntityLock newReadLock ( Class entityType , String entityKey , String owner ) throws LockingException { return lockService . newLock ( entityType , entityKey , IEntityLockService . READ_LOCK , owner ) ; }
Returns a read lock for the entity type entity key and owner .
34,781
public IEntityLock newWriteLock ( Class entityType , String entityKey , String owner ) throws LockingException { return lockService . newLock ( entityType , entityKey , IEntityLockService . WRITE_LOCK , owner ) ; }
Returns a write lock for the entity type entity key and owner .
34,782
public void storeJson ( PortletPreferences prefs , String key , Object data ) throws IOException , ReadOnlyException , ValidatorException { final String configData = mapper . writeValueAsString ( data ) ; prefs . setValue ( key , configData ) ; prefs . store ( ) ; }
Stores a Java object as JSON in a portlet preference
34,783
public < E > E getJson ( PortletPreferences prefs , String key , Class < E > type ) throws IOException { final String prefValue = StringUtils . trimToNull ( prefs . getValue ( key , null ) ) ; if ( prefValue == null ) { return null ; } return mapper . readValue ( prefValue , type ) ; }
Read the specified portlet preference and parse it as a JSON string into the specified type . If the preference is null returns null .
34,784
public List < Preference > getEditableUserAttributes ( IPerson currentUser ) { EntityIdentifier ei = currentUser . getEntityIdentifier ( ) ; IAuthorizationPrincipal ap = AuthorizationServiceFacade . instance ( ) . newPrincipal ( ei . getKey ( ) , ei . getType ( ) ) ; List < Preference > allowedAttributes = new ArrayLis...
Returns the collection of attributes that the specified currentUser can edit .
34,785
private String fixPortletPath ( HttpServletRequest request , IPortalUrlBuilder urlBuilder ) { String path = urlBuilder . getUrlString ( ) ; String context = request . getContextPath ( ) ; if ( StringUtils . isBlank ( context ) ) { context = "/" ; } if ( ! path . startsWith ( context + "/f/" ) ) { return path . replaceF...
This entire method is a hack! The login portlet URL only seems to load correctly if you pass in the folder name for the guest layout . For the short term allow configuration of the folder name and manually re - write the URL to include the folder if it doesn t already .
34,786
private void saveLayout ( UserView view , IPerson owner ) throws Exception { IUserProfile profile = new UserProfile ( ) ; profile . setProfileId ( view . getProfileId ( ) ) ; userLayoutStore . setUserLayout ( owner , profile , view . getLayout ( ) , true , false ) ; }
Saves the loaded layout in the database for the user and profile .
34,787
private void fragmentizeLayout ( UserView view , FragmentDefinition fragment ) { if ( view . getUserId ( ) == - 1 || view . getLayout ( ) == null ) { return ; } Pattern contentPattern = STANDARD_PATTERN ; boolean allowExpandedContent = Boolean . parseBoolean ( PropertiesManager . getProperty ( PROPERTY_ALLOW_EXPANDED_C...
Removes unwanted and hidden folders then changes all node ids to their globally safe incorporated version .
34,788
private void setIdsAndAttribs ( Element parent , String labelBase , String index , String precedence ) { NodeList children = parent . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { if ( children . item ( i ) . getNodeType ( ) == Node . ELEMENT_NODE ) { Element child = ( Element ) children...
Recursive method that passes through a layout tree and changes all ids from the regular format of sXX or nXX to the globally safe incorporated id of form uXlXsXX or uXlXnXX indicating the user id and layout id from which this node came .
34,789
public boolean isPasswordRequested ( PortletRequest request , PortletWindow plutoPortletWindow ) throws PortletContainerException { final HttpServletRequest httpServletRequest = this . portalRequestUtils . getPortletHttpRequest ( request ) ; final IPortletWindow portletWindow = this . portletWindowRegistry . convertPor...
Determine whether the portlet has expects a password as one of the user attributes .
34,790
private String getPassword ( ISecurityContext baseContext ) { String password = null ; IOpaqueCredentials oc = baseContext . getOpaqueCredentials ( ) ; if ( oc instanceof NotSoOpaqueCredentials ) { NotSoOpaqueCredentials nsoc = ( NotSoOpaqueCredentials ) oc ; password = nsoc . getCredentials ( ) ; } Enumeration en = ba...
Retrieves the users password by iterating over the user s security contexts and returning the first available cached password .
34,791
public void perform ( ) throws PortalException { if ( nodeId . startsWith ( Constants . FRAGMENT_ID_USER_PREFIX ) ) { ParameterEditManager . addParmEditDirective ( nodeId , name , value , person ) ; } else { Document plf = RDBMDistributedLayoutStore . getPLF ( person ) ; Element plfNode = plf . getElementById ( nodeId ...
Change the parameter for a channel in both the ILF and PLF using the appropriate mechanisms for incorporated nodes versus owned nodes .
34,792
static void changeParameterChild ( Element node , String name , String value ) { if ( node != null ) { boolean foundIt = false ; for ( Element parm = ( Element ) node . getFirstChild ( ) ; parm != null ; parm = ( Element ) parm . getNextSibling ( ) ) { Attr att = parm . getAttributeNode ( Constants . ATT_NAME ) ; if ( ...
Look in the passed - in element for a parameter child element whose value is to be changed to the passed - in value .
34,793
@ Bean ( name = "resourcesElementsProvider" ) public ResourcesElementsProvider getResourcesElementsProvider ( ) { ResourcesElementsProviderImpl rslt = new ResourcesElementsProviderImpl ( ) ; rslt . setResourcesDao ( getResourcesDao ( ) ) ; return rslt ; }
This bean is not an element of the rendering pipeline .
34,794
protected void checkAttributesMap ( MessageContext context , String basePath , Set < String > swappableAttributes , Map < String , Attribute > attributesToCopy ) { for ( final String attribute : attributesToCopy . keySet ( ) ) { if ( ! swappableAttributes . contains ( attribute ) ) { final MessageBuilder messageBuilder...
Checks the keys in the Map on the model against a Set to ensure there are no values in the Map that aren t also in the Set
34,795
@ RequestMapping ( value = "/layoutDoc" , method = RequestMethod . GET ) public ModelAndView getRESTController ( HttpServletRequest request , @ RequestParam ( value = "tab" , required = false ) String tab ) { final IPerson person = personManager . getPerson ( request ) ; List < LayoutPortlet > portlets = new ArrayList ...
A REST call to get a json feed of the current users layout . Intent was to provide a layout document without per - tab information for mobile device rendering .
34,796
public Set < IPersonAttributesGroupDefinition > getPagsDefinitions ( IPerson person ) { Set < IPersonAttributesGroupDefinition > rslt = new HashSet < > ( ) ; for ( IPersonAttributesGroupDefinition def : pagsGroupDefDao . getPersonAttributesGroupDefinitions ( ) ) { if ( hasPermission ( person , IPermission . VIEW_GROUP_...
All the definitions filtered by the user s access rights .
34,797
public synchronized void authenticate ( ) throws PortalSecurityException { this . isauth = false ; if ( this . myPrincipal . UID != null && this . myOpaqueCredentials . credentialstring != null ) { try { ILocalAccountDao accountStore = LocalAccountDaoLocator . getLocalAccountDao ( ) ; IPortalPasswordService passwordSer...
Authenticate user .
34,798
@ Resource ( name = "portletPropertyToAttributeMappings" ) public void setPropertyMappings ( Map < String , String > propertyMappings ) { this . propertyToAttributeMappings = ImmutableBiMap . copyOf ( propertyMappings ) ; this . attributeToPropertyMappings = this . propertyToAttributeMappings . inverse ( ) ; }
Map of portlet property names to attribute names if the value is null the key will be used for both the property and attribute name
34,799
@ Resource ( name = "nonNamespacedPortletProperties" ) public void setNonNamespacedProperties ( Set < String > nonNamespacedProperties ) { this . nonNamespacedProperties = ImmutableSet . copyOf ( nonNamespacedProperties ) ; }
Properties that should not be namespaced with the portlet s windowId when stored as request attributes