3 && null!= name){
+ String tempStr = name.substring(name.length()-4, name.length());
+ compare = tempStr;
+ }
+
+ //Discard .wgz file
+ if(compare.length()>0 && compare.equalsIgnoreCase(".wgz")){
+ logger.log(Level.INFO, ".wgz file discarded for Package: "+name);
+ reportStatus(MessageFormat.format(PackagerMessages.getString("package.discard.wgz")
+ ,new Object[] {name}));
+ }
+ else{
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(pkgFile);
+
+ ZipEntry zipEntry = new ZipEntry(baseName);
+ pkgZipOutputStream.putNextEntry(zipEntry);
+
+
+// System.out.println("Copy >>>-->> ");
+ try{
+ copy(fis, pkgZipOutputStream);
+
+// IOUtils.copy(fis, pkgZipOutputStream);
+// IOUtils.copyLarge(fis, pkgZipOutputStream);
+
+
+ } catch (Exception e) {
+
+ e.printStackTrace();
+
+ }
+// System.out.println("Copy <<----<< ");
+
+ pkgZipOutputStream.closeEntry();
+ fis.close();
+ } catch (IOException e) {
+ logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_ZIP_FAILED,e);
+ }
+ finally{
+ try {
+ pkgZipOutputStream.closeEntry();
+ fis.close();
+ } catch (IOException e) {
+ logAndThrowErrors(Level.SEVERE, e.getMessage(), e);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * retrieve file name from source folder to current path
+ * @param file
+ */
+ private void retrieveFileName(File file) {
+ if(null !=file.getParent()){
+ rootFolderPath=file.getParentFile().getName().toString().trim().concat("/") //$NON-NLS-1$
+ .concat(rootFolderPath);
+ //if it reaches to package source filder then return
+// if(file.getParentFile().getName().toString().trim().equals(wFile.getName())){
+ if(file.getParentFile().getAbsolutePath().toString().trim()
+ .equalsIgnoreCase(wFile.getAbsolutePath())){
+ return;
+ }
+ else{
+ retrieveFileName(file.getParentFile());
+ }
+ }
+
+ }
+
+
+ /**
+ * Reporting status to the GUI
+ * @param statusMessage - message to be delivered
+ */
+ public void reportStatus(String statusMessage) {
+ WRTStatus status = new WRTStatus();
+ status.setStatusSource(IWRTConstants.StatusSourceType.PACKAGER.name());
+ status.setStatusDescription(statusMessage);
+ statusListener.emitStatus(status);
+
+
+ }
+ /**
+ * This method is used for logging and exception handling
+ * @param lev -- severity Level
+ * @param logMessage -- message to log
+ * @param e -- exception to throw, if its not an exception then it should be null
+ * @throws PackagerException
+ */
+ private void logAndThrowErrors(Level lev , String logMessage, Exception e) throws PackageException {
+ logger.log(lev, logMessage);
+ reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
+ //for exceptions log error message and stack trace
+ if(null!=e){
+ Util.logEvent(logger, Level.SEVERE, e);
+ throw new PackageException(e);
+ }
+ }
+/**
+ *
+ * @param input
+ * @param output
+ * @return
+ * @throws IOException
+ */
+
+ public static int copy(InputStream input, OutputStream output) throws IOException {
+
+ long count = copyLarge(input, output);
+ if (count > Integer.MAX_VALUE) {
+ return -1;
+ }
+
+ return (int) count;
+ }
+
+ /**
+ * Copy bytes from a large (over 2GB) InputStream
to an
+ * OutputStream
.
+ *
+ * This method buffers the input internally, so there is no need to use a
+ * BufferedInputStream
.
+ *
+ * @param input the InputStream
to read from
+ * @param output the OutputStream
to write to
+ * @return the number of bytes copied
+ * @throws NullPointerException if the input or output is null
+ * @throws IOException if an I/O error occurs
+ *
+ * */
+ public static long copyLarge(InputStream input, OutputStream output)
+ throws IOException {
+
+ byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
+ long count = 0;
+ int n = 0;
+ while (-1 != (n = input.read(buffer))) {
+ output.write(buffer, 0, n);
+ count += n;
+ }
+
+ return count;
+ }
+
+
+
+}
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WidgetPackager.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WidgetPackager.java Mon Feb 01 15:27:41 2010 -0800
@@ -0,0 +1,352 @@
+/**
+ * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+
+package org.symbian.tools.wrttools.core.packager;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.symbian.tools.wrttools.core.status.IWRTConstants;
+import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
+import org.symbian.tools.wrttools.core.status.WRTStatus;
+import org.symbian.tools.wrttools.core.status.WRTStatusHandler;
+import org.symbian.tools.wrttools.util.Util;
+
+/**
+ * This is the main class for core component Packager.
+ * This class reads from the given source file and creates widget package at
+ * the given destination path
+ * @author ranoliya
+ *
+ */
+public class WidgetPackager implements IWRTPackager {
+
+ // source path for packager
+ private String srcPath = "";
+
+ //destination path for packager
+ private String destPath = "";
+
+ //name of the package
+ private String packageName = "";
+
+ //list of files to package
+ private List listOfFiles ;
+
+ //status handler for creating status listener
+ private WRTStatusHandler statusHandler;
+
+ private IWRTStatusListener statusListener;
+
+ //Logger to log errors and info
+ private Logger logger = Logger.getLogger(getClass().getName());
+
+ private String errorMessage = "";
+
+ /**
+ * Class Constructor the packaging process
+ */
+ public WidgetPackager(IWRTStatusListener wrtStatusListener) {
+ statusHandler = new WRTStatusHandler();
+ statusHandler.addListener(wrtStatusListener);
+ statusListener = wrtStatusListener;
+ }
+
+ /**
+ * Method packages the input folder, Initial step for Packaging
+ * @param sPath -- Project Source path
+ * @param dPath -- Package destination path
+ * @param fileList -- List of files to be included in the package
+ * @throws PackageException
+ */
+ public void packageWidget(String sPath, String dPath,List fileList) throws PackageException
+ {
+ if(null != sPath || null != dPath){
+
+ listOfFiles = new ArrayList();
+ this.listOfFiles = fileList;
+
+ sPath = Util.replaceChar(sPath, File.separatorChar, '/');
+ this.srcPath = sPath;
+ reportStatus(WRTPackagerConstants.STA_PKG_START);
+ if(!validateFilesToPackage()){
+
+ reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
+ errorMessage = PackagerMessages.getString("package.missing.mandatory.files");
+ throw new PackageException(PackagerMessages.getString("package.missing.mandatory.files"));
+
+ }
+ // if destination path is not specified
+ if(dPath.equals("")){ //$NON-NLS-1$
+ dPath=sPath;
+ }
+ this.packageName=new File(dPath).getName();
+ File destDir = new File(dPath);
+ dPath = destDir.getParentFile().getAbsolutePath().concat("/");
+ this.destPath = Util.replaceChar(dPath, File.separatorChar, '/');
+
+
+ initPackage();
+ }
+ else
+ {
+ reportStatus(WRTPackagerConstants.LOG_NULL_INPUT);
+ logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_NULL_INPUT, null);
+ }
+ }
+
+ /**
+ * This is the packager invocation method that calls packager main API
+ * @throws PackagerException
+ */
+ private void initPackage() throws PackageException {
+ File destFile = new File(destPath);
+ if(!destFile.canWrite() || !destFile.exists()|| (destFile.exists() && destFile.isFile())){ // to avoid considering file as existing dir
+ boolean success = destFile.mkdir();
+ if(!success){
+ reportStatus(WRTPackagerConstants.ERR_DIR_CREATE_FAIL);
+ reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
+ throw new PackageException();
+// return;
+ }
+ }
+
+
+ int fileType = checkInputType();
+
+ String srcStatus = MessageFormat.format(PackagerMessages.getString("WidgetPackager.WidgetPackager.filesFrom")
+ ,new Object[]{srcPath});
+
+
+
+ reportStatus(srcStatus);
+
+ boolean pass = createWidgetPackage(fileType);
+ if(pass){
+ String destStatus = MessageFormat.format(PackagerMessages.getString("WidgetPackager.WidgetPackager.fileDest")
+ ,new Object[]{destPath.concat(packageName)});
+ reportStatus(destStatus);
+ reportStatus(WRTPackagerConstants.STA_PKG_PASSED);
+ }
+ }
+
+
+ /**
+ * This method checks for the user input for Packager and returns File Type
+ * @return int -- File Type
+ * @throws PackagerException
+ */
+ public int checkInputType() throws PackageException {
+ int fileType = 2;
+ File checkInput ;
+
+ checkInput = new File(srcPath);
+ if(checkInput.exists()){
+
+ // user input for packaging is project directory
+ if (checkInput.isDirectory()) {
+ fileType = 1;
+ }
+
+ // user input is unknown to packager - report to status
+ else {
+ fileType = 2;
+
+ logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_UNSUPPORTED_INPUT,null);
+ }
+ }
+ return fileType;
+ }
+
+ /**
+ * This method returns the Destination path for the packaged widget
+ * @return
+ */
+ public String getDestPath() {
+ return destPath;
+ }
+
+ /**
+ * Reporting status
+ * @param statusMessage
+ */
+ public void reportStatus(String statusMessage) {
+ WRTStatus status = new WRTStatus();
+ status.setStatusSource(IWRTConstants.StatusSourceType.PACKAGER.name());
+ status.setStatusDescription(statusMessage);
+ statusListener.emitStatus(status);
+ }
+
+ /**
+ * This method is used for logging and exception handling
+ * @param lev -- severity Level
+ * @param logMessage -- message to log
+ * @param e -- exception to throw, if its not an exception then it should be null
+ * @throws PackagerException
+ */
+ private void logAndThrowErrors(Level lev , String logMessage, Exception e) throws PackageException {
+ logger.log(lev, logMessage);
+
+ //for exceptions log error message and stack trace
+ if(null!=e){
+ reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
+ Util.logEvent(logger, Level.SEVERE, e);
+ throw new PackageException(e);
+ }
+ }
+
+ /**
+ * This method creates Widget package-- overridden
+ * @param - Input file type
+ */
+ private boolean createWidgetPackage(int fileType) throws PackageException {
+ String widgetPath= "";
+ String zipPath = "";
+ boolean sucess = false;
+ boolean packageDone = false;
+ PackagerZipFolder zipFolder = new PackagerZipFolder();
+
+ widgetPath = destPath.concat(packageName); //$NON-NLS-1$
+ File reWrite = new File(widgetPath);
+ if(reWrite.exists())
+ reWrite.delete();
+ //if source path and destination path are same
+ if(srcPath.equals(destPath)){
+ // Project folder as an input
+ if (fileType==1){
+ zipPath = destPath.concat("tmpwid.zip"); //$NON-NLS-1$
+ zipFolder.zipProjectFolder(srcPath, zipPath,listOfFiles,statusListener);
+// zipFolder.zipProjectFolder(srcPath, zipPath,listOfFiles);
+
+ }
+ //unsupported file type
+ else{
+ logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_UNSUPPORTED_INPUT,null);
+ }
+ }
+ else {
+ if (fileType==1){
+ zipPath = destPath.concat("tmpwid.zip");//$NON-NLS-1$
+// zipFolder.zipProjectFolder(srcPath,zipPath,listOfFiles,statusListener );
+ zipFolder.zipProjectFolder(srcPath, zipPath,listOfFiles);
+ }
+ else{
+ logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_UNSUPPORTED_INPUT, null);
+ }
+ }
+
+ //rename file
+ //created zip file
+ File zFile = new File(zipPath);
+
+
+ //new package name to use for rename appended wgz. This logic should be removed from package zip folder.
+ File newFile = new File(widgetPath+".wgz");
+
+ //delete .wgz if already exists
+ if(newFile.exists()){
+ newFile.delete();
+ }
+ //rename file
+ if(zFile.exists()){
+ sucess = zFile.renameTo(newFile);
+ }
+ //overwrite the existing file
+ if(!sucess)
+ {
+ logAndThrowErrors(Level.WARNING, PackagerMessages.getString("WidgetPackager.fileOverwriteMsg"),null);
+ }
+
+ File tempZip = new File(zipPath);
+ //delete temp file if exists
+ if(tempZip.exists())
+ {
+ tempZip.delete();
+ }
+ packageDone = true;
+ return packageDone;
+ }
+
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * This method validates basic files (.html and .plist) checked in packaging option tree
+ * @return -- mandatory files exists or not
+ */
+ private boolean validateFilesToPackage(){
+ boolean isPlist = false;
+ boolean isHtml = false;
+ File srcDir = new File(srcPath);
+ String plistFile = srcDir.getName().concat("/info.plist");
+
+ if(listOfFiles.size()>0 && null != listOfFiles){
+ for (String fileName : listOfFiles) {
+ try{
+ if (fileName.equalsIgnoreCase(plistFile)) {
+ isPlist = true;
+ }
+ int len = fileName.lastIndexOf("/");
+ String fName=fileName.substring(len+1, fileName.length());
+// files with out extention will have index out of bound exception
+ int extLen = fName.lastIndexOf('.');
+ String extention = "";
+ if(extLen > 0){
+ extention = fName.substring(extLen, fName.length());
+ }
+
+ String htmlFile = srcDir.getName().concat("/").concat(fName);
+ if(htmlFile.equalsIgnoreCase(fileName) &&
+ (extention.equalsIgnoreCase(".htm")|| extention.equalsIgnoreCase(".html"))){
+ isHtml = true;
+ }
+
+ if(isPlist && isHtml){
+ return true;
+ }
+ }
+ // files with out extention will have index out of bound exception
+// try catch will catch that and will proceed to the next file in the
+// for loop
+ catch(Exception e){
+// e.printStackTrace();
+ }
+ }
+ }
+ String srcStatus = MessageFormat.format(PackagerMessages.getString("WidgetPackager.WidgetPackager.filesFrom")
+ ,new Object[]{srcPath});
+ reportStatus( srcStatus);
+ if(!isPlist ){
+ reportStatus( WRTPackagerConstants.ERR_PKG_MAN_PLIST_FILE_MISSING);
+
+ }
+ if(!isHtml){
+ reportStatus( WRTPackagerConstants.ERR_PKG_MAN_HTML_FILE_MISSING);
+
+ }
+
+ return (isPlist && isHtml);
+ }
+
+}
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackageActionDelegate.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackageActionDelegate.java Mon Feb 01 15:27:41 2010 -0800
@@ -0,0 +1,203 @@
+/**
+ * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+
+package org.symbian.tools.wrttools.core.packager;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.WRTStatusListener;
+import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
+
+import org.symbian.tools.wrttools.core.status.IWRTConstants;
+import org.symbian.tools.wrttools.core.status.WRTStatus;
+import org.symbian.tools.wrttools.core.validator.ValidateAction;
+
+public class WrtPackageActionDelegate extends ActionDelegate implements
+ IObjectActionDelegate {
+
+
+ /**
+ * @see ActionDelegate#run(IAction)
+ */
+
+ private final List projectList = new ArrayList();
+
+
+ public void run(IAction action) {
+ PlatformUI.getWorkbench().saveAllEditors(true);
+ if (projectList != null && projectList.size() > 0) {
+ for (IProject project : projectList) {
+ if (project != null) {
+ packageProject( project);
+ }
+ }
+ }
+ }
+
+ public boolean packageProject(IProject project) {
+ boolean packaedSucess=false;
+ if (project != null) {
+
+/*
+ ValidateAction validator = new ValidateAction();
+ if(!validator.isValidProject(project)) {
+ System.out.println("Invalid widget, can not be packaged!");
+ reportStatus("For the project "+ project.getLocation());
+ reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
+ reportStatus("See errors from the Problems View for more details...");
+ return packaedSucess;
+ }
+*/
+
+ try {
+ final List fileList = new ArrayList();
+ //--->>
+ project.accept(new IResourceVisitor() {
+ public boolean visit(IResource resource) throws CoreException {
+ if (resource instanceof IFile) {
+ IFile file = (IFile) resource;
+ boolean add = true;
+ // skip user-excluded and automatically-excluded files
+ String value = file.getPersistentProperty(WRTPackagerConstants.EXCLUDE_PROPERTY);
+ if (value != null) {
+ add = false;
+ }
+ String name = file.getName();
+ // skip Aptana temporarily generated files
+ if (name.startsWith(".tmp_")) {
+ add = false;
+ }
+ //Bug fix when import project with different name was unable to package it
+ if(name.endsWith(".wgz")){
+ add = false;
+ }
+ if (add) {
+ if(file.getProject().getLocation().toString().endsWith(file.getProject().getName())){
+ fileList.add(file.getLocation().toString().substring(file.getProject().getLocation().toString().length()-file.getProject().getName().length()));
+ }
+ else{
+ String projectDir=file.getProject().getLocation().toString().substring(file.getProject().getLocation().toString().lastIndexOf("/")+1);
+ String fullpath=file.getFullPath().toString();
+ fullpath=fullpath.substring(fullpath.indexOf(file.getProject().getName())+file.getProject().getName().length());
+ fullpath=projectDir+fullpath;
+ fileList.add(fullpath);
+
+ }
+ }
+ }
+ return true;
+ }
+ });
+ //<<--<<
+
+ String projectPath = project.getLocation().toString();
+ String prjName = project.getName();
+ String dprojectPath = projectPath+"/"+prjName;
+ WRTStatusListener statusListener = new WRTStatusListener();
+ WidgetPackager widgetPackager = new WidgetPackager(statusListener);
+
+ try {
+ IProgressMonitor pm = new NullProgressMonitor();
+ // deleting the previous build --->>
+ IPath wgzPath = new Path(project.getName()+".wgz");
+ IFile wgz = project.getFile(wgzPath);
+ //do not delete the here, delete only if packaging is success
+ /*if (wgz.exists()) {
+ wgz.delete(true, false, pm);
+ }*/
+ widgetPackager.packageWidget(projectPath, dprojectPath, fileList);
+ packaedSucess=true;
+ project.refreshLocal(IResource.DEPTH_ONE, pm);
+ wgz = project.getFile(wgzPath);
+ if (wgz.exists()) {
+ wgz.setPersistentProperty(WRTPackagerConstants.EXCLUDE_PROPERTY, Boolean.TRUE.toString());
+ }
+
+ } catch (PackageException e) {
+ Activator.log(IStatus.ERROR, "Error packaging widget archive", e);
+ } finally {
+ statusListener.close();
+ }
+ } catch (CoreException x) {
+ Activator.log(IStatus.ERROR, "Error packaging widget archive", x);
+ }
+
+ }
+ return packaedSucess;
+ }
+ /**
+ * Reporting status
+ * @param statusMessage
+ */
+ private void reportStatus(String statusMessage) {
+ WRTStatus status = new WRTStatus();
+ WRTStatusListener statusListener = new WRTStatusListener();
+ status.setStatusSource(IWRTConstants.StatusSourceType.PACKAGER.name());
+ status.setStatusDescription(statusMessage);
+ statusListener.emitStatus(status);
+ }
+ @SuppressWarnings("unchecked")
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ projectList.clear();
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ for (Iterator iter = ss.iterator(); iter.hasNext();) {
+
+ Object obj = iter.next();
+ if (obj instanceof IProject) {
+ projectList.add((IProject) obj);
+
+ }
+ }
+ }
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+
+ }
+
+
+
+}
+
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/packageMessages.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/packageMessages.properties Mon Feb 01 15:27:41 2010 -0800
@@ -0,0 +1,42 @@
+WidgetPackager.pathAppend=\\
+WidgetPackager.WidgetPackager.filesFrom=Packaging Files from : "{0}"
+WidgetPackager.WidgetPackager.fileDest=Packaged files to destination\: "{0}"
+WRTPackagerConstants.success=Packaging Successful\n
+WRTPackagerConstants.failed=Packaging Failed\n
+WRTPackagerConstants.inProgress=Packaging in Progress...
+WRTPackagerConstants.started=Packaging Started...
+WRTPackagerConstants.nullpera=Input parameters are NULL
+WRTPackagerConstants.nullInput=Selected input is NULL -- Invalid input
+WRTPackagerConstants.directoryCreateErr=Can not create output directory
+WRTPackagerConstants.checkPermission=Can not create specified directory at the destination.
+WRTPackagerConstants.unSupportedInput=Any input other then a folder is not supported
+WRTPackagerConstants.InputNotSupported=Input type not supported by WRT Packager
+WRTPackagerConstants.renameFailed=Packager failed while renaming a .zip file
+WRTPackagerConstants.failureGenerate=Packager failed while generating package files
+WRTPackagerConstants.srcNotFound=Source folder not found
+WRTPackagerConstants.inputSourceNotFound=Input source not Found
+WRTPackagerConstants.srcNotReadable=Package source is not readable
+WRTPackagerConstants.unReadable=Unreadable Input, Please check Source and Destination
+WRTPackagerConstants.canNotcopy=Can not copy file
+WRTPackagerConstants.copyErr=Packager can not copy required files
+WRTPackagerConstants.NoDestination=Destination directory does not exists
+WRTPackagerConstants.noLocateDest=Packager could not locate destination directory
+WRTPackagerConstants.destNotWritable=Destination directory is not writable
+WRTPackagerConstants.destNotwritableErr=packager can not write to destination directory, check permissions
+WRTPackagerConstants.readWriteFail=File read/write Failed
+WRTPackagerConstants.readWritePermission=Packager read/write failed, check for permissions
+WRTPackagerConstants.closeFile=Can not close files
+WRTPackagerConstants.closeFileerr=Package could not close files
+WRTPackagerConstants.ZipFailed=File Zipping failed
+WRTPackagerConstants.packFailed=Packager could not perform packaging, File I/O not available for zip utility
+WRTPackagerConstants.emptyInputFolder=Input project folder is empty
+WRTPackagerConstants.emptyFolderErr=Input project folder is empty, Please give a valid source folder
+PackagerFileManipulation.useDir=user.dir
+
+package.missing.mandatory.files = Please select mandatory files
+package.discard.wgz = \nDiscarded already packaged file - "{0}" ... \n
+
+WRTPackagerConstants.package.missing.mandatory.files.plist = Mandatory Plist file is Misssing
+WRTPackagerConstants.package.missing.mandatory.files.html = Mandatory Html file is Missing
+
+
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/report/messages.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/report/messages.properties Mon Feb 01 15:27:41 2010 -0800
@@ -0,0 +1,12 @@
+HtmlReportHandler.convert.title=Dashboard widget conversion report
+HtmlReportHandler.convert.description=Automatic conversions performed by the converter to match Nokia Web Runtime.
+HtmlReportHandler.analysis.report.title=Dashboard widget analysis report
+HtmlReportHandler.analysis.report.description=This analysis report lists the mandatory or optional conversions needed to port the widget to Nokia Web Runtime.
+HtmlReportHandler.file.name=File name
+HtmlReportHandler.line.number=Line number
+HtmlReportHandler.convert.action.needed=Action needed
+HtmlReportHandler.description.column=Description
+HtmlReportHandler.severity.info.column=Severity
+
+HtmlReportHandler.keyword.entry = \ Entry
+HtmlReportHandler.add.project = ADD Project
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/status/Messages.java
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/status/Messages.java Mon Feb 01 13:47:20 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/status/Messages.java Mon Feb 01 15:27:41 2010 -0800
@@ -23,7 +23,7 @@
import java.util.ResourceBundle;
public class Messages {
- private static final String BUNDLE_NAME = "com.nokia.wrt.core.status.messages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.symbian.tools.wrttools.core.status.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/status/messages.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/status/messages.properties Mon Feb 01 15:27:41 2010 -0800
@@ -0,0 +1,13 @@
+IWRTConstants.validator=Validator
+IWRTConstants.packager=Packager
+IWRTConstants.deployer=Deployer
+IWRTConstants.converter=Converter
+
+IWRTConstants.report.error = Error
+IWRTConstants.report.warning = Warning
+IWRTConstants.report.fatal = Fatal
+IWRTConstants.report.information = Information
+IWRTConstants.report.success = Success
+IWRTConstants.report.mandatory = Mandatory
+IWRTConstants.report.optional = Optional
+
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/Messages.java
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/Messages.java Mon Feb 01 13:47:20 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/Messages.java Mon Feb 01 15:27:41 2010 -0800
@@ -23,7 +23,7 @@
import java.util.ResourceBundle;
public class Messages {
- private static final String BUNDLE_NAME = "com.nokia.wrt.core.validator"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.symbian.tools.wrttools.core.validator"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/ValidatorPropMessages.java
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/ValidatorPropMessages.java Mon Feb 01 13:47:20 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/ValidatorPropMessages.java Mon Feb 01 15:27:41 2010 -0800
@@ -27,11 +27,11 @@
import org.symbian.tools.wrttools.util.Util;
public class ValidatorPropMessages {
- private static final String BUNDLE_NAME = "com.nokia.wrt.core.validator.messages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.symbian.tools.wrttools.core.validator.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
- private static Logger log = Logger.getLogger("com.nokia.wrt.core.validator.ValidatorPropMessages");
+ private static Logger log = Logger.getLogger("org.symbian.tools.wrttools.core.validator.ValidatorPropMessages");
private ValidatorPropMessages() {
}
diff -r c56c874eef47 -r 1f72e81a1aa7 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/messages.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/messages.properties Mon Feb 01 15:27:41 2010 -0800
@@ -0,0 +1,134 @@
+plist.File.Not.Present=Mandatory file info.plist is missing in the widget project. For further processing please include info.plist and try again.
+html.File.Not.Present=Main HTML file is missing. For further processing please include the main html file and try again.
+WidgetModel.Divergent.Files.Present=Unnecessary files are included. To minimize the widget size please only include the required files. The supported file types are .htm, .html, .png, .gif, .jpg.
+
+todo.WidgetModel.Divergent.Files.Present=Remove the unsupported file
+
+todo.include.plist=Please include the info.plist file to the project
+todo.include.html=Please include the html file to the project
+
+plist.html.element.mismatch= HTML element for the key MainHTML in Info.plist differs from the actual HTML file Name . Please correct the plist file for the MainHTML key.
+
+todo.correct.plist =Correct Plist Entry for MainHTML
+plist.html.element.mailHtml.missing =HTML Element MainHTML in Info.plist is not present or the previous tag was not closed properly . Please correct the plist file for the MainHTML key.
+
+todo.correct.plist.for.html =Correct Plist Entry for MainHTML
+
+plist.mankey.mising =Mandatory Plist element
+not.in.plist.file=not in plist file. Please add plist element values to the info.plist file.
+todo.add.mankey.plist.element =Add the mandatory Plist element values to Info.plist.
+contains.invalid.character =contains invalid characters
+todo.valid.character=Enter valid character to Info.plist.
+
+plist.key.string.mising =Missing string pair for the key element. Please add the string element for the key.
+todo.add.mankey.string =Add the string element of mandatory Info.plist key element
+
+plist.element.not.closed =A malformed XML element was found. Please delete or change the plist element from info.plist file.
+todo.element.not.closed = Delete or change the Plist element from Info.plist
+
+plist.element.not.supported=An unsupported Info.plist element was found. Please delete or add a valid info.plist element.
+todo.plist.element.not.Valid =Add a valid Info.plist element
+
+WidgetModel.File.NotDirectory=Error validating a widget project directory. The input is not a directory or does not exist.
+
+todo.widgetmodel =Please add a widget project which contains the mandatory files Info.plist and the main HTML file.
+
+WidgetModel.File.NotZipFile =The project is not of Widget Type.
+
+widget.validation.complete =Widget validation succeeded. There were no errors.
+
+widget.project.not.selected =Please select a widget project to validate.
+
+no.html.element=The HTML file is empty or invalid HTML. Please verify html file and try again.
+todo.no.html.element =Verify html file.
+
+todo.correct.html.tag =Correct the HTML tag at line
+
+no.plist.element=The Info.plist file does not contain any valid plist elements. Please add elements to the plist file.
+todo.no.plist.element =Add elements to the plist.
+## These are not being used anymore should delete
+## It looks like these are used with string concatenation. Replace with strings using MessageFormat
+project.dir.more.plist.file.present=More than one Plist file is present in the project directory, extra plist file count is :
+todo.project.dir.more.plist.file.present=Verify all the plist files and remove the extra ones
+project.inner.dir.more.plist.file.present=Plist files detected in inner directories count is:
+todo.project.inner.dir.more.plist.file.present=Remove Plist File from the subdirectory.
+
+initialize.messagemanager = Message Manager must be initialized
+validate.man.file.started =Mandatory files validation started
+validate.man.file.finished =Validating mandatory files complete.
+validate.plist.started =Info.plist validation started
+validate.plist.finished =Info.plist validation complete.
+
+validate.html.started =HTML validation started
+validate.html.finished=HTML validation complete.
+
+## It looks like these are used with string concatenation. Replace with strings using MessageFormat
+more.outer.html.File.Present.and.count.is=Extra HTML files are present in project directory, count is :
+more.inner.html.File.Present.and.count.is= Html files are present in inner directory, count is :
+
+todo.more.outer.html.File.Present.and.count.is=Extra HTML files are present in project directory. Verify and remove, count is :
+todo.more.inner.html.File.Present.and.count.is=Html files are present in inner directory. Verify and remove, count is :
+
+xml.declaration.error.missing.close= XML declaration missing close '>'. Please close the tag.
+xml.declaration.error.missing.open= XML declaration missing open'<'. Please close the tag.
+xml.declaration.error.missing.open.and.close= XML declaration missing open'<' and close'>'. Please verify.
+
+todo.xml.declaration.error.missing.close= XML declaration missing close '>'
+todo.xml.declaration.error.missing.open= XML declaration missing open'<'
+todo.xml.declaration.error.missing.open.and.close= XML declaration missing open'<' and close'>'
+
+xml.doctype.error.missing.close=XML doctype missing close '>'
+xml.doctype.error.missing.open=XML doctype missing open'<'
+xml.doctype.error.missing.open.and.close= XML doctype missing open'<' and close'>'
+
+todo.xml.doctype.error.missing.close=XML doctype missing close '>'
+todo.xml.doctype.error.missing.open=XML doctype missing open'<'
+todo.xml.doctype.error.missing.open.and.close=XML doctype missing open'<' and close'>'
+
+xml.element.error.missing.close=XML start element missing close'>'
+xml.element.error.missing.open=XML start element missing open'<'
+xml.element.error.missing.open.and.close=XML start element missing open'<' and close'>'
+
+todo.xml.element.error.missing.close=XML start element missing close'>'
+todo.xml.element.error.missing.open=XML start element missing open'<'
+todo.xml.element.error.missing.open.and.close=XML start element missing open'<' and close'>'
+
+
+xml.element.end.error.missing.close=XML end element missing close'>
+xml.element.end.error.missing.open=XML end element missing open'<'
+xml.element.end.error.missing.open.and.close=XML end element missing open'<' and close'>'
+
+todo.xml.element.end.error.missing.close=XML end element missing close'>'
+todo.xml.element.end.error.missing.open=XML end element missing open'<'
+todo.xml.element.end.error.missing.open.and.close= XML end element missing open'<' and close'>'
+
+char.present.before.start.line= Invalid Character present before Starting of document
+todo.char.present.before.start.line=Remove Invalid Character present
+
+plist.parser.error.at.line.no= Plist Parse Error at line number :
+todo.plist.parser.error.at.line.no= Verify Plist Element at line number
+non.referenced.html.File.Present=Non referenced Html File Present. To minimize the widget size please only include the required files.
+todo.non.referenced.html.File.Present= Verify Non referenced Html File
+duplicate.plist.file.present=Duplicate plist file detected in the widget project. To minimize the widget size please only include the required files.
+subfolder.duplicate.plist.file.present = More Plist files are present in the project sub directory. Please include only required files.
+
+todo.duplicate.plist.file.present= Remove Duplicate plist file
+plist.File.Not.selected= Plist File is not selected from package option.
+todo.plist.File.Not.selected Plist file needs to be selected for packaging
+
+html.File.Not.selected= Html file is not selected from package option.
+todo.html.File.Not.selected=Main Html needs to be selected for packaging
+
+widgetmodel.plist.notpresent = info.plist is not present in the widget project.
+widgetmodel.html.notpresent = main html is not present in the widget project.
+
+validation.sucess = Validation is success without any errors.
+conversion.sucess= Partial conversion is completed.
+WidgetModel.refrenced.html.missing=Refrenced html file not present
+plist.parsing.error.mainHtmlkey.missing= While parsing plist, main html key is missing or incorrect.
+xml.element.not.closed = The element not closed, please close the element and try again.
+xml.empty.element.not.closed = The element not closed properly, please close the element and try again.
+xml.close.element.not.opened = The closed element not Opened , please verify.
+plist.parsing.error.mainHtmlkey.missing= While parsing plist, main html key is missing or incorrect.
+todo.xml.element.not.closed=XML element not closed
+todo.xml.empty.element.not.closed=Empty element not close