KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > publishingtool > actions > ViewPublishingToolStartPageAction


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.applications.publishingtool.actions;
25
26 import java.util.List JavaDoc;
27
28 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
29 import org.infoglue.cms.controllers.kernel.impl.simple.RepositoryController;
30 import org.infoglue.cms.util.ChangeNotificationController;
31 import org.infoglue.cms.util.NotificationMessage;
32 import org.infoglue.cms.util.RemoteCacheUpdater;
33
34 /**
35  * This class implements the action class for the startpage in the management tool.
36  *
37  * @author Mattias Bogeblad
38  */

39
40 public class ViewPublishingToolStartPageAction extends InfoGlueAbstractAction
41 {
42     private static final long serialVersionUID = 1L;
43
44     private List JavaDoc repositories;
45     
46     public String JavaDoc doExecute() throws Exception JavaDoc
47     {
48         this.repositories = RepositoryController.getController().getAuthorizedRepositoryVOList(this.getInfoGluePrincipal(), false);
49         
50         return "success";
51     }
52     
53     public String JavaDoc doPushSystemNotificationMessages() throws Exception JavaDoc
54     {
55         NotificationMessage notificationMessage = null;
56         List JavaDoc messages = RemoteCacheUpdater.getSystemNotificationMessages();
57         synchronized(messages)
58         {
59             if(messages.size() > 0)
60                 notificationMessage = (NotificationMessage)messages.get(0);
61         }
62         
63         if(notificationMessage != null)
64         {
65             notificationMessage = new NotificationMessage("ViewPublishingToolStartPageAction.doPushSystemNotificationMessages():", "" + notificationMessage.getClassName(), this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, notificationMessage.getObjectId(), notificationMessage.getObjectName());
66             ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
67             RemoteCacheUpdater.clearSystemNotificationMessages();
68         }
69         
70         return doExecute();
71     }
72     
73     public List JavaDoc getRepositories()
74     {
75         return this.repositories;
76     }
77             
78     public List JavaDoc getSystemNotificationMessages()
79     {
80         return RemoteCacheUpdater.getSystemNotificationMessages();
81     }
82 }
83
Popular Tags