RE: [uportal-dev] CAnnouncements and up3

2008-05-14 Thread Paul Gazda
Jen,
I don't know what the SJDC branch is, but if it is the USC modified version,
I wonder if you would also be able to fix the problem that has come up
several times in the past on the jasig-user list. In multi-server
environments all announcements disappear if a database error occurs when
retrieving announcements. I have provided to the list the fix based on the
Columbia code, but since we are not using the USC code, I cannot fix and
test it directly. See USC Announcement problem in the jasig-user list
(http://www.nabble.com/Google-Gadgets-to12528614.html#a15965154) for details
of a recent incident. I have attached the code modifications necessary in
the Columbia version, and based on the responses in the past, the USC code
is either exactly the same or very similar.
 
Paul Gazda
 
  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jen Bourey
Sent: Tuesday, May 13, 2008 1:44 PM
To: uportal-dev@lists.ja-sig.org
Subject: [uportal-dev] CAnnouncements and up3
 
I've been working on getting the SJDC branch of the CAnnouncements channel
working in up3 and have made a bunch of modifications to get the code to
compile successfully under uPortal 3.0.  In particular, the code uses the
portal's LogService for all its logging needs, and LogService was removed
from up3 in favor of log4j + commons logging.  I've modified my local
version to work with commons logging, which seems fairly desirable anyway.  





The other necessary change was to modify the PropertiesLoader to use the
ResourceLoader.getResourceAsStream method rather than
ResourceLoader.getResourceAsFile.  The getResourceAsFile method was removed
from up3 since it no longer worked, but the getResourceAsStream method has
been present since at least 2003, so I would expect this change to work in
pre-up3 versions.





It seems like both these changes are likely to be compatible enough with
pre-up3 versions that we could commit the changes without having to create a
separate up3 branch.  However, we probably would want to add a separate up3
build task to the ant build script.  Does this approach sound reasonable?
Is it likely to cause conflicts with uPortal versions people are currently
running the SJDC branch with?





Just as a general warning, there some issues that crop up with the channel
due to some of the database changes that were made in up3.  In uportal 3.0,
things like entities and groups no longer have hard-coded, predictable IDs.
If you give the channel the opportunity to add administrative groups itself,
it will create them with the wrong entity type and fail to successfully add
portal administrators to them.  I've had good success with first creating
the necessary administrative groups through either the portal administrative
API or importing .group and .membership files, configuring the announcements
properties files with these new group numbers, then deploying the channel
itself.





- Jen
-- 






You are currently subscribed to uportal-dev@lists.ja-sig.org as:
[EMAIL PROTECTED]


To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-dev

-- 
You are currently subscribed to uportal-dev@lists.ja-sig.org as: [EMAIL 
PROTECTED]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/uportal-devITopicStoreAuthority.java
-
Change:
public HashMap getDBTopicIDs (); 
To:
public HashMap getDBTopicIDs () throws Exception;


RDBMTopicStore.java
---
A try-catch block around the code below.
// Delete from announcements cache and topic object 
announcements that were
// deleted from database by another server.
try {
  Set dbAnnKeys = (getDBAnnIDs(t.getID()).keySet());
  HashMap tmpMap = new HashMap();
  tmpMap.putAll(anns);
  Set annKeys = tmpMap.keySet();
  annKeys.removeAll(dbAnnKeys);
  if (!annKeys.isEmpty()) {
Iterator i = annKeys.iterator();
while (i.hasNext()) {
  String annKey = (String)i.next();
  anns.remove(annKey);
  t.removeAnnouncement(annKey);
  t.store();
}
  }
}
catch (Exception e) {
  log.error(ERROR: Retrieval of announcements from database 
failed.  +
Check for announcements deleted by another server 
was bypassed. , e);
}

Change:
public HashMap getDBTopicIDs() {
HashMap topicIDs = new HashMap();
Connection conn = null;
try {
  conn = this.getConnection();
  String q = select TOPIC_ID from  + TOPIC_TABLE;
  RDBMServices.PreparedStatement ps = new 
RDBMServices.PreparedStatement(conn, q);
  ResultSet rs = ps.executeQuery();
  try 

Re: [uportal-dev] CAnnouncements in up3

2008-04-14 Thread Eric Dalquist
Ah, that would make sense. I completely missed that method name in your 
original post. I'll take a look today if we need to deprecate/remove 
that API today.


-Eric

Jen Bourey wrote:
So after trying a bunch of different things, it seems that the 
getResourceAsStream method works, but the getResourceAsFile method 
doesn't.


- Jen


On Sun, Apr 13, 2008 at 11:30 PM, Eric Dalquist 
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:


This may actually be related to a change in Tomcat for 5.5.26 that
requires resource paths to not start with a /.

The only other thing I could think of is the .jar packaging. The
resource loader code has not changed to my knowledge but as you
can see from the URI it is looking in a .jar file for the properties.


-Eric



Jen Bourey wrote:

Hi all,

I'm having trouble deploying the SJDC branch of the
CAnnouncements channel to up3 and wondered if anyone had any
insight.  After fixing up the code to use log4j, it all seems to
compile.  However, when I deploy it, it's unable to load the
properties file correctly.  I see the following error in the logs:

ERROR [org.jasig.portal.ChannelManager#73]
announcements.CAnnouncements.[] Apr/13 22:01:41 -
java.io.FileNotFoundException: file:/usr/local/

tomcat_instances/up3-unicon/webapps/uPortal/WEB-INF/lib/uportal-impl-3.0.0-SNAPSHOT.jar!/properties/announcements/CAnnouncements.properties

The channel appears to be using the
ResourceLoader.getResourceAsFile method to load the properties. 
It doesn't seem to be a very widely used method; the only other

user in the uPortal source code is using it with a relative path
to a resource, rather than one that starts with /.  Has the
behavior of this method changed in up3?  Is there anything in
particular I should be looking out for?  Have I likely
misconfigured something?  I did double check to make sure that
the CAnnouncements.properties file really is getting added to the
uportal jar.

Thanks,

- Jen
-- 



Join your friends and colleagues at JA-SIG 2008 - Higher
Education Solutions: The Community Source Way! April 27th -
30th, 2008 in St. Paul, Minnesota USA


Featuring CAS, DSpace, Fedora, Fluid, Internet2, Kuali, Sakai,
uPortal, and more! Information/Registration at:
http://www.ja-sig.org/conferences/08spring/index.html


Subscribe to the conference blog, The Community Source Way
http://jasig2008.blogspot.com http://jasig2008.blogspot.com/,
for news and updates about the event.


Join the Conference networking site at
http://ja-sigspring08.crowdvine.com/


You are currently subscribed to uportal-dev@lists.ja-sig.org 
mailto:uportal-dev@lists.ja-sig.org as: [EMAIL PROTECTED] mailto:[EMAIL 
PROTECTED]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/uportal-dev



--


Join your friends and colleagues at JA-SIG 2008 - Higher Education 
Solutions: The Community Source Way! April 27th - 30th, 2008 in St. 
Paul, Minnesota USA



Featuring CAS, DSpace, Fedora, Fluid, Internet2, Kuali, Sakai, 
uPortal, and more! Information/Registration at: 
http://www.ja-sig.org/conferences/08spring/index.html



Subscribe to the conference blog, The Community Source Way 
http://jasig2008.blogspot.com http://jasig2008.blogspot.com/, for 
news and updates about the event.



Join the Conference networking site at 
http://ja-sigspring08.crowdvine.com/



You are currently subscribed to uportal-dev@lists.ja-sig.org as: [EMAIL 
PROTECTED]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/uportal-dev


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [uportal-dev] CAnnouncements in up3

2008-04-13 Thread Jen Bourey
So after trying a bunch of different things, it seems that the
getResourceAsStream method works, but the getResourceAsFile method doesn't.

- Jen


On Sun, Apr 13, 2008 at 11:30 PM, Eric Dalquist [EMAIL PROTECTED]
wrote:

  This may actually be related to a change in Tomcat for 5.5.26 that
 requires resource paths to not start with a /.

 The only other thing I could think of is the .jar packaging. The resource
 loader code has not changed to my knowledge but as you can see from the URI
 it is looking in a .jar file for the properties.


 -Eric



 Jen Bourey wrote:

 Hi all,

 I'm having trouble deploying the SJDC branch of the CAnnouncements channel
 to up3 and wondered if anyone had any insight.  After fixing up the code to
 use log4j, it all seems to compile.  However, when I deploy it, it's unable
 to load the properties file correctly.  I see the following error in the
 logs:

 ERROR [org.jasig.portal.ChannelManager#73] announcements.CAnnouncements.[]
 Apr/13 22:01:41 - java.io.FileNotFoundException: file:/usr/local/

 tomcat_instances/up3-unicon/webapps/uPortal/WEB-INF/lib/uportal-impl-3.0.0-SNAPSHOT.jar!/properties/announcements/CAnnouncements.properties

 The channel appears to be using the ResourceLoader.getResourceAsFile
 method to load the properties.  It doesn't seem to be a very widely used
 method; the only other user in the uPortal source code is using it with a
 relative path to a resource, rather than one that starts with /.  Has the
 behavior of this method changed in up3?  Is there anything in particular I
 should be looking out for?  Have I likely misconfigured something?  I did
 double check to make sure that the CAnnouncements.properties file really is
 getting added to the uportal jar.

 Thanks,

 - Jen

 --


 Join your friends and colleagues at JA-SIG 2008 - Higher Education 
 Solutions: The Community Source Way!
 April 27th - 30th, 2008 in St. Paul, Minnesota USA

 Featuring CAS, DSpace, Fedora, Fluid, Internet2, Kuali, Sakai, uPortal, and 
 more!
 Information/Registration at: 
 http://www.ja-sig.org/conferences/08spring/index.html

 Subscribe to the conference blog, The Community Source 
 Wayhttp://jasig2008.blogspot.com, for news and updates about the event.

 Join the Conference networking site at http://ja-sigspring08.crowdvine.com/

 You are currently subscribed to uportal-dev@lists.ja-sig.org as: [EMAIL 
 PROTECTED]
 To unsubscribe, change settings or access archives, see 
 http://www.ja-sig.org/wiki/display/JSG/uportal-dev



-- 
Join your friends and colleagues at JA-SIG 2008 - Higher Education Solutions: 
The Community Source Way!
April 27th - 30th, 2008 in St. Paul, Minnesota USA

Featuring CAS, DSpace, Fedora, Fluid, Internet2, Kuali, Sakai, uPortal, and 
more!
Information/Registration at: 
http://www.ja-sig.org/conferences/08spring/index.html

Subscribe to the conference blog, The Community Source Way
http://jasig2008.blogspot.com, for news and updates about the  event.

Join the Conference networking site at http://ja-sigspring08.crowdvine.com/

You are currently subscribed to uportal-dev@lists.ja-sig.org as: [EMAIL 
PROTECTED]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/uportal-dev