001: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012: // POSSIBILITY OF SUCH DAMAGE.
013: //
014: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015: package com.metaboss.licensing.defaultimpl;
016:
017: import java.util.ArrayList;
018: import java.util.Arrays;
019: import java.util.Date;
020: import java.util.List;
021:
022: import com.metaboss.licensing.LicenseService;
023:
024: /** Implementation of the license service */
025: public class LicenseServiceImpl implements LicenseService {
026: private static String sProductVersionIdentifier = null;
027: private static String sProductBuildDate = null;
028: private static String sProductBuildTime = null;
029: private static String sAuthorName = null;
030: private static String sAuthorCopyrightNotice = null;
031: static {
032: String lMajorVer = System
033: .getProperty("com.metaboss.release.id.majorversion");
034: String lMinorVer = System
035: .getProperty("com.metaboss.release.id.minorversion");
036: String lBuildNum = System
037: .getProperty("com.metaboss.release.id.buildnumber");
038: if (lMajorVer != null && lMajorVer.length() > 0
039: && lMinorVer != null && lMinorVer.length() > 0
040: && lBuildNum != null && lBuildNum.length() > 0)
041: sProductVersionIdentifier = lMajorVer + "." + lMinorVer
042: + "." + lBuildNum;
043: else
044: sProductVersionIdentifier = "??.??.????";
045: sProductBuildDate = System.getProperty(
046: "com.metaboss.release.id.builddate", "?? ??? ????");
047: sProductBuildTime = System.getProperty(
048: "com.metaboss.release.id.buildtime", "??:??:??");
049: sAuthorName = System.getProperty(
050: "com.metaboss.authorship.authorname", "????????");
051: sAuthorCopyrightNotice = System.getProperty(
052: "com.metaboss.authorship.copyrightnotice",
053: "Copyright ???? © ?????? No Rights Reserved.");
054: }
055:
056: public LicenseServiceImpl(java.util.Hashtable pEnvironment) {
057: }
058:
059: /** Returns true if this is commercially registered product */
060: public boolean isProductCommerciallyLicensed() {
061: return false;
062: }
063:
064: /** Returns product name */
065: public String getProductName() {
066: return "MetaBoss";
067: }
068:
069: /** Returns product web site url */
070: public String getProductWebSite() {
071: return "www.metaboss.com";
072: }
073:
074: /** Returns product version */
075: public String getProductVersion() {
076: return sProductVersionIdentifier;
077: }
078:
079: /** Returns product build date */
080: public String getProductBuildDate() {
081: return sProductBuildDate;
082: }
083:
084: /** Returns product build time */
085: public String getProductBuildTime() {
086: return sProductBuildTime;
087: }
088:
089: /** Returns manufacturer's name */
090: public String getManufacturerName() {
091: return "Softaris Pty. Ltd.";
092: }
093:
094: /** Returns manufacturer's copyright notice text */
095: public String getManufacturerCopyrightNotice() {
096: return "Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.";
097: }
098:
099: /** Returns manufacturer's license notice text */
100: public String[] getManufacturerLicenseNotice() {
101: return new String[] {
102: "You can use this copy of MetaBoss under Open Source",
103: "Gnu Public License (GPL). Full terms and conditions",
104: "of GPL can be found at www.gnu.org. Please note that",
105: "systems built with this copy of MetaBoss are automatically",
106: "licensed under GPL. This severely restricts your ability",
107: "to manufacture, use or sell proprietory, non-Open Source",
108: "software built with this copy of MetaBoss. To obtain",
109: "MetaBoss Commercial License please visit www.metaboss.com." };
110: }
111:
112: /** Returns user name */
113: public String getAuthorName() {
114: return sAuthorName;
115: }
116:
117: /** Returns user's copyright notice */
118: public String getAuthorCopyrightNotice() {
119: return sAuthorCopyrightNotice;
120: }
121:
122: /** Returns users's license notice text applicable when describing content */
123: public String[] getAuthorLicenseNoticeForContent() {
124: return new String[] {
125: "This content is licensed under Open Source Gnu Public License (GPL)",
126: "Full terms and conditions of GPL can be found found at www.gnu.org" };
127: }
128:
129: /** Returns users's license notice text applicable when describing program */
130: public String[] getAuthorLicenseNoticeForProgram() {
131: return new String[] {
132: "This program is licensed under Open Source Gnu Public License (GPL)",
133: "Full terms and conditions of GPL can be found found at www.gnu.org" };
134: }
135:
136: /** Returns the text of the header to be placed in the generated files */
137: public String[] getGeneratedFileHeader() {
138: List lList = new ArrayList();
139: lList.add("This file is generated by " + getProductName()
140: + " Ver " + getProductVersion() + " at "
141: + new Date().toString());
142: lList.add(getProductName() + " is "
143: + getManufacturerCopyrightNotice());
144: lList.add("Content of this file is "
145: + getAuthorCopyrightNotice());
146: lList.addAll(Arrays.asList(getAuthorLicenseNoticeForContent()));
147: return (String[]) lList.toArray(new String[lList.size()]);
148: }
149: }
|