You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Carlos Torres <ct...@mcn.com.br> on 2004/10/22 19:41:03 UTC

PSML Change in Runtime

Hi people,

I need to change the PSML file for a type of user(role) in runtime. According to an action in portal, the panels and portles for the user must be changed. I will have other PSML files and when the user select an option it will change with the portal configuration.

Anybody have any idea to how make this?

Thank you very much.

Regards,
 
       Carlos Alberto Torres

A question about portlet access control.

Posted by 綠羽毛 <sa...@ms2.hinet.net>.
Hi all,

I have a question about portlet access, here is my situation:
I have some portlets .
Only Administrator can customize these portlets in pane or psml,but
I want these portlets can also be viewed by user. 
User can't customize nor add or remove these portlets.
How do I setup these portlets' security?
If I use "user_view,admin_all", user can add or remove these portlets.
If I use "admin_only", user can't see these portlets.
Anyone has solution about my problem?
Thank you.

Sam Fan.


--------------------------------------------- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. 

By @utoTOOLS MIS


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Refreshing a psml reference

Posted by Carlos Torres <ct...@mcn.com.br>.
It works fine, the psml was reloaded but the screen change only after I
refresh  it.

Anyboyd have idea how to get it changed w after execute the method call for
reload the psml?

Thank you very much for all helps.


----- Original Message ----- 
From: "綠羽毛" <sa...@ms2.hinet.net>
To: "Jetspeed Developers List" <je...@jakarta.apache.org>
Sent: Friday, December 03, 2004 7:15 AM
Subject: Re: Refreshing a psml reference


> hellow all
> I have the same problem on this issue, but I solved it.
> Here is my solution:
>
> 1.add following method in CastorPsmlManagerService.java
>
> public FileCache getDocuments() {
>   return documents;
> }
>
> 2.add following method in FileCache.java
>
> public void evictAll() {
> synchronized (cache) {
>
> List list = new LinkedList(cache.values());
> Collections.sort(list, this);
>
>
>
> for (Iterator it = list.iterator(); it.hasNext();) {
>
> FileCacheEntry entry = (FileCacheEntry) it.next();
> String key = null;
> try {
> key = entry.getFile().getCanonicalPath();
> } catch (java.io.IOException e) {
> logger.error("Exception getting file path: ", e);
> }
> // notify that eviction will soon take place
> for (Iterator lit = this.listeners.iterator();
> lit.hasNext();
> ) {
> FileCacheEventListener listener =
> (FileCacheEventListener) lit.next();
> listener.evict(entry);
> }
> cache.remove(key);
> }
> }
> }
>
> 3.When you change source PSML which will be referenced by other
> PSML,run following method in any action. PSML cache will be evictd, and
> PSML will all refresh. The PSML cache is still working.
>
> CastorPsmlManagerService cs =
>
(CastorPsmlManagerService)TurbineServices.getInstance().getService("PsmlMana
ger");
> FileCache fc =cs.getDocuments();
> System.out.println("before evictting Cach Size:" + fc.getSize());
> fc.evictAll();
> System.out.println("after evictting Cach Size:" + fc.getSize());
>
>
> Hope it will userful for you.
>
> Regards,
>
> Sam Fan
> From: Andy.Sun@cexp.com <An...@cexp.com>
> Subject: Refreshing a psml reference
> Date: Wed, 17 Nov 2004 14:14:58 -0700
> Content-Type: text/plain;
> charset="iso-8859-1"
>
> I am looking into the getDocument method in the PsmlManagerService. The
> refresh method call getDocument() with the getCached set to false. I
believe
> the tricky part is when and where to do refresh. When using a reference,
the
> psml manager doesn't know if the referenced psml is changed or not. I am
> still digging and hopefully will find a good resolution.
> This happened in a user by user basis because one user has psml cached but
> the other one doesn't.
> Andy
>
> -----Original Message-----
> From: Dan Moore [mailto:moore234@yahoo.com]
> Sent: Wednesday, November 17, 2004 2:05 PM
> To: Jetspeed Users List
> Subject: RE: Refreshing a psml reference
>
>
> I'd think bypassing the cache would be a bad thing in the future.  You
> might want to look at the 'refresh' method on the PSMLManager service
> interface:
>
>
http://portals.apache.org/jetspeed-1/apidocs/org/apache/jetspeed/services/ps
>
mlmanager/PsmlManagerService.html#refresh(org.apache.jetspeed.om.profile.Pro
> fileLocator)
>
> I'd dig into that class to gain a better understanding of how caching
> of psml documents actually happens.  What you're experiencing implies
> that it happens on a user by user basis, which does not make a whole
> lot of sense to me, at least for group and role based psml documents.
>
> Dan
>
> --- Andy.Sun@cexp.com wrote:
>
> > After a little more research, we discovered one more way to get
> > around this
> > issue. There is a setting in JetspeedResource.properties file,
> > services.PsmlManager.cacheSize. It is default to 100, meaning maximum
> > 100
> > psml pages will be cached. We change that to 0 and it fixed this psml
> > reference refresh issue.
> > Is this change recommended? It is obviously for a performance reason
> > (probably save time on File I/O). With only limited users(<500)using
> > the
> > site now, we didn't notice a obvious impact. However, we will have
> > more
> > users in the future and the psml cache will be a good thing to have.
> > Without
> > turning it off, is there a setting to control the expiration of the
> > psml
> > cache?
> > Andy
> >
> > -----Original Message-----
> > From: Andy.Sun@cexp.com [mailto:Andy.Sun@cexp.com]
> > Sent: Wednesday, November 17, 2004 11:05 AM
> > To: jetspeed-user@jakarta.apache.org
> > Subject: Refreshing a psml reference
> >
> >
> > We just implemented a Jetspeed 1.5 portal site with tomcat 4.1.18.
> > The psml
> > reference is used so that different users can share a group or role
> > psml
> > file. When we make a change to the group psml (e.g. adding a portlet
> > to the
> > page), the users who have previously login to the site won't see the
> > change
> > if they login again (even after a while). However, if the user login
> > as the
> > first time, they could see the change. Of course, the change will be
> > visible
> > to everyone after bouncing the tomcat. The sequence is like this.
> > -login as user1 then logout
> > -change the group psml that is referenced by user1's psml
> > -login as user2 to verify the referenced psml is changed.
> > -if yes from pervious step, login as user1
> > -too bad, the user1 still don't see the change.
> > It seems that there is caching happened for user1. However we are not
> > sure
> > which setting could affect this. We also waited overnight expecting
> > the
> > cache will expire. That did not happen either.
> > Has anyone actively using reference? Any experience with this issue?
> > Thanks!
> > Andy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > jetspeed-user-help@jakarta.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > jetspeed-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>
>
>
> --------------------------------------------- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> By @utoTOOLS MIS
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Refreshing a psml reference

Posted by 綠羽毛 <sa...@ms2.hinet.net>.
hellow all
I have the same problem on this issue, but I solved it.
Here is my solution:

1.add following method in CastorPsmlManagerService.java

public FileCache getDocuments() {
 	return documents;
}

2.add following method in FileCache.java

	public void evictAll() {
			synchronized (cache) {			

				List list = new LinkedList(cache.values());
				Collections.sort(list, this);

		

				for (Iterator it = list.iterator(); it.hasNext();) {		

					FileCacheEntry entry = (FileCacheEntry) it.next();
					String key = null;
					try {
						key = entry.getFile().getCanonicalPath();
					} catch (java.io.IOException e) {
						logger.error("Exception getting file path: ", e);
					}
					// notify that eviction will soon take place
					for (Iterator lit = this.listeners.iterator();
						lit.hasNext();
						) {
						FileCacheEventListener listener =
							(FileCacheEventListener) lit.next();
						listener.evict(entry);
					}
					cache.remove(key);		
				}
			}
		}

3.When you change source PSML which will be referenced by other
PSML,run following method in any action. PSML cache will be evictd, and
PSML will all refresh. The PSML cache is still working.

CastorPsmlManagerService cs =
	(CastorPsmlManagerService)TurbineServices.getInstance().getService("PsmlManager");
FileCache fc =cs.getDocuments();
System.out.println("before evictting Cach Size:" + fc.getSize());
	fc.evictAll();
System.out.println("after evictting Cach Size:" + fc.getSize());


Hope it will userful for you.

Regards,

Sam Fan 
From: Andy.Sun@cexp.com <An...@cexp.com>
Subject: Refreshing a psml reference
Date: Wed, 17 Nov 2004 14:14:58 -0700
Content-Type: text/plain;
	charset="iso-8859-1"

I am looking into the getDocument method in the PsmlManagerService. The
refresh method call getDocument() with the getCached set to false. I believe
the tricky part is when and where to do refresh. When using a reference, the
psml manager doesn't know if the referenced psml is changed or not. I am
still digging and hopefully will find a good resolution.
This happened in a user by user basis because one user has psml cached but
the other one doesn't. 
Andy

-----Original Message-----
From: Dan Moore [mailto:moore234@yahoo.com]
Sent: Wednesday, November 17, 2004 2:05 PM
To: Jetspeed Users List
Subject: RE: Refreshing a psml reference


I'd think bypassing the cache would be a bad thing in the future.  You
might want to look at the 'refresh' method on the PSMLManager service
interface:

http://portals.apache.org/jetspeed-1/apidocs/org/apache/jetspeed/services/ps
mlmanager/PsmlManagerService.html#refresh(org.apache.jetspeed.om.profile.Pro
fileLocator)

I'd dig into that class to gain a better understanding of how caching
of psml documents actually happens.  What you're experiencing implies
that it happens on a user by user basis, which does not make a whole
lot of sense to me, at least for group and role based psml documents.

Dan

--- Andy.Sun@cexp.com wrote:

> After a little more research, we discovered one more way to get
> around this
> issue. There is a setting in JetspeedResource.properties file,
> services.PsmlManager.cacheSize. It is default to 100, meaning maximum
> 100
> psml pages will be cached. We change that to 0 and it fixed this psml
> reference refresh issue.
> Is this change recommended? It is obviously for a performance reason
> (probably save time on File I/O). With only limited users(<500)using
> the
> site now, we didn't notice a obvious impact. However, we will have
> more
> users in the future and the psml cache will be a good thing to have.
> Without
> turning it off, is there a setting to control the expiration of the
> psml
> cache? 
> Andy 
> 
> -----Original Message-----
> From: Andy.Sun@cexp.com [mailto:Andy.Sun@cexp.com]
> Sent: Wednesday, November 17, 2004 11:05 AM
> To: jetspeed-user@jakarta.apache.org
> Subject: Refreshing a psml reference
> 
> 
> We just implemented a Jetspeed 1.5 portal site with tomcat 4.1.18.
> The psml
> reference is used so that different users can share a group or role
> psml
> file. When we make a change to the group psml (e.g. adding a portlet
> to the
> page), the users who have previously login to the site won't see the
> change
> if they login again (even after a while). However, if the user login
> as the
> first time, they could see the change. Of course, the change will be
> visible
> to everyone after bouncing the tomcat. The sequence is like this.
> -login as user1 then logout
> -change the group psml that is referenced by user1's psml
> -login as user2 to verify the referenced psml is changed.
> -if yes from pervious step, login as user1
> -too bad, the user1 still don't see the change.
> It seems that there is caching happened for user1. However we are not
> sure
> which setting could affect this. We also waited overnight expecting
> the
> cache will expire. That did not happen either. 
> Has anyone actively using reference? Any experience with this issue?
> Thanks!
> Andy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jetspeed-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jetspeed-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org




--------------------------------------------- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. 

By @utoTOOLS MIS


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org