KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > solution > SolutionPublisher


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jul 13, 2005
14  * @author James Dixon
15  *
16  */

17 package org.pentaho.core.solution;
18
19 import org.apache.commons.logging.Log;
20 import org.apache.commons.logging.LogFactory;
21 import org.pentaho.core.publisher.BasePublisher;
22 import org.pentaho.core.session.IPentahoSession;
23 import org.pentaho.core.system.PentahoSystem;
24 import org.pentaho.messages.Messages;
25
26 public class SolutionPublisher extends BasePublisher {
27
28     /**
29      *
30      */

31     private static final long serialVersionUID = -209000084524120620L;
32
33     private static final Log logger = LogFactory.getLog(SolutionPublisher.class);
34
35     public Log getLogger() {
36         return logger;
37     }
38
39     public String JavaDoc publish(IPentahoSession session) {
40
41         // TODO put any code in here to validate the solution
42
try {
43             PentahoSystem.getSolutionRepository(session).publish(session, getLoggingLevel());
44         } catch (Throwable JavaDoc t) {
45             error(Messages.getErrorString("SolutionPublisher.ERROR_0001_PUBLISH_FAILED"), t); //$NON-NLS-1$
46
return Messages.getString("SolutionPublisher.USER_ERROR_PUBLISH_FAILED") + t.getLocalizedMessage(); //$NON-NLS-1$
47
}
48         return Messages.getString("SolutionPublisher.USER_SOLUTION_REPOSITORY_UPDATED"); //$NON-NLS-1$
49
}
50
51     public String JavaDoc getName() {
52         return Messages.getString("SolutionRepository.USER_PUBLISH_TITLE"); //$NON-NLS-1$
53
}
54
55     public String JavaDoc getDescription() {
56         return Messages.getString("SolutionRepository.USER_PUBLISH_DESCRIPTION"); //$NON-NLS-1$
57
}
58
59 }
60
Popular Tags