web

16:53:55.742 INFO  jd.cli.Main - Decompiling web.jar
package com.sun.star.wizards.web;

import com.sun.star.awt.XWindowPeer;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.SystemDialog;

public abstract class AbstractErrorHandler
  implements ErrorHandler
{
  XMultiServiceFactory xmsf;
  XWindowPeer peer;
  
  protected AbstractErrorHandler(XMultiServiceFactory paramXMultiServiceFactory, XWindowPeer paramXWindowPeer)
  {
    xmsf = paramXMultiServiceFactory;
    peer = paramXWindowPeer;
  }
  
  public boolean error(Exception paramException, Object paramObject, int paramInt1, int paramInt2)
  {
    switch (paramInt2)
    {
    case 0: 
      return !showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 1: 
      return !showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 2: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 3: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 4: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 5: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 6: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 7: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 8: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    case 9: 
      return showMessage(getMessageFor(paramException, paramObject, paramInt1, paramInt2), paramInt2);
    }
    throw new IllegalArgumentException("unknown error type");
  }
  
  /**
   * @deprecated
   */
  protected boolean showMessage(String paramString, int paramInt)
  {
    return showMessage(xmsf, peer, paramString, paramInt);
  }
  
  /**
   * @deprecated
   */
  public static boolean showMessage(XMultiServiceFactory paramXMultiServiceFactory, XWindowPeer paramXWindowPeer, String paramString, int paramInt)
  {
    String str = getServiceNameFor(paramInt);
    int i = getAttributeFor(paramInt);
    int j = SystemDialog.showMessageBox(paramXMultiServiceFactory, paramXWindowPeer, str, i, paramString);
    return j == getTrueFor(paramInt);
  }
  
  public static boolean showMessage(XMultiServiceFactory paramXMultiServiceFactory, XWindowPeer paramXWindowPeer, String paramString1, String paramString2, int paramInt1, int paramInt2, int paramInt3)
  {
    int i = SystemDialog.showMessageBox(paramXMultiServiceFactory, paramXWindowPeer, paramString2, paramInt2 + paramInt1, paramString1);
    return i == paramInt3;
  }
  
  private static int getTrueFor(int paramInt)
  {
    switch (paramInt)
    {
    case 0: 
    case 1: 
    case 2: 
    case 3: 
    case 4: 
    case 5: 
      return 1;
    case 6: 
    case 7: 
      return 2;
    case 8: 
    case 9: 
      return 1;
    }
    throw new IllegalArgumentException("unkonown error type");
  }
  
  private static int getAttributeFor(int paramInt)
  {
    switch (paramInt)
    {
    case 0: 
      return 4194304;
    case 1: 
      return 4194304;
    case 2: 
      return 276824064;
    case 3: 
      return 142606336;
    case 4: 
      return 276824064;
    case 5: 
      return 142606336;
    case 6: 
      return -2130706432;
    case 7: 
      return 1090519040;
    case 8: 
      return 4194304;
    case 9: 
      return 4194304;
    }
    throw new IllegalArgumentException("unkonown error type");
  }
  
  /**
   * @deprecated
   */
  private static String getServiceNameFor(int paramInt)
  {
    switch (paramInt)
    {
    case 0: 
      return "errorbox";
    case 1: 
      return "errorbox";
    case 2: 
      return "errorbox";
    case 3: 
      return "warningbox";
    case 4: 
      return "querybox";
    case 5: 
      return "querybox";
    case 6: 
      return "querybox";
    case 7: 
      return "querybox";
    case 8: 
      return "warningbox";
    case 9: 
      return "infobox";
    }
    throw new IllegalArgumentException("unkonown error type");
  }
  
  protected abstract String getMessageFor(Exception paramException, Object paramObject, int paramInt1, int paramInt2);
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.AbstractErrorHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web;

import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.ImageList.IImageRenderer;

class BackgroundsDialog$BGRenderer
  implements ImageList.IImageRenderer
{
  private int cut;
  
  public BackgroundsDialog$BGRenderer(BackgroundsDialog paramBackgroundsDialog, int paramInt)
  {
    cut = paramInt;
  }
  
  public Object[] getImageUrls(Object paramObject)
  {
    if (paramObject != null)
    {
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = paramObject;
      return arrayOfObject;
    }
    return null;
  }
  
  public String render(Object paramObject)
  {
    return paramObject == null ? PropertyNames.EMPTY_STRING : FileAccess.getPathFilename(BackgroundsDialog.access$000(this$0).getPath((String)paramObject, null));
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.BackgroundsDialog.BGRenderer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web;

import com.sun.star.util.XStringSubstitution;
import com.sun.star.wizards.common.ConfigSet;
import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.SystemDialog;
import com.sun.star.wizards.web.data.CGImage;
import javax.swing.DefaultListModel;

class BackgroundsDialog$Model
  extends DefaultListModel
{
  public BackgroundsDialog$Model(BackgroundsDialog paramBackgroundsDialog, ConfigSet paramConfigSet)
  {
    try
    {
      for (int i = 0; i < paramConfigSet.getSize(); i++)
      {
        CGImage localCGImage = (CGImage)paramConfigSet.getElementAt(i);
        String str = access$100xStringSubstitution.substituteVariables(cp_Href, false);
        if (BackgroundsDialog.access$000(paramBackgroundsDialog).exists(str, false)) {
          addDir(str);
        } else {
          remove((String)paramConfigSet.getKey(localCGImage));
        }
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private void remove(String paramString)
  {
    try
    {
      Object localObject = Configuration.getConfigurationRoot(this$0.xMSF, "/org.openoffice.Office.WebWizard/WebWizard/BackgroundImages", true);
      Configuration.removeNode(localObject, paramString);
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private void addDir(String paramString)
  {
    if (BackgroundsDialog.access$000(this$0).isDirectory(paramString)) {
      add(BackgroundsDialog.access$000(this$0).listFiles(paramString, false));
    } else {
      add(paramString);
    }
  }
  
  private void add(String[] paramArrayOfString)
  {
    for (int i = 0; i < paramArrayOfString.length; i++) {
      add(paramArrayOfString[i]);
    }
  }
  
  private void add(String paramString)
  {
    String str = paramString.toLowerCase();
    if ((str.endsWith("jpg")) || (str.endsWith("jpeg")) || (str.endsWith("gif"))) {
      addElement(paramString);
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.BackgroundsDialog.Model
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web;

import com.sun.star.awt.Size;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.util.XStringSubstitution;
import com.sun.star.wizards.common.ConfigSet;
import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.SystemDialog;
import com.sun.star.wizards.ui.ImageList;
import com.sun.star.wizards.ui.ImageList.IImageRenderer;
import com.sun.star.wizards.web.data.CGImage;
import com.sun.star.wizards.web.data.CGSession;
import com.sun.star.wizards.web.data.CGSettings;
import javax.swing.DefaultListModel;
import javax.swing.ListModel;

public class BackgroundsDialog
  extends ImageListDialog
{
  private FileAccess fileAccess;
  private SystemDialog sd;
  private CGSettings settings;
  
  public BackgroundsDialog(XMultiServiceFactory paramXMultiServiceFactory, ConfigSet paramConfigSet, WebWizardDialogResources paramWebWizardDialogResources)
    throws Exception
  {
    super(paramXMultiServiceFactory, 34290, new String[] { resBackgroundsDialog, resBackgroundsDialogCaption, resOK, resCancel, resHelp, resDeselect, resOther, resCounter });
    
    sd = SystemDialog.createOpenDialog(paramXMultiServiceFactory);
    sd.addFilter(resImages, "*.jpg;*.jpeg;*.jpe;*.gif", true);
    sd.addFilter(resAllFiles, "*.*", false);
    
    settings = ((CGSettings)root);
    
    fileAccess = new FileAccess(paramXMultiServiceFactory);
    il.setListModel(new Model(paramConfigSet));
    il.setImageSize(new Size(40, 40));
    il.setRenderer(new BGRenderer(0));
    build();
  }
  
  public void other()
  {
    String[] arrayOfString = sd.callOpenDialog(false, settings.cp_DefaultSession.cp_InDirectory);
    if ((arrayOfString != null) && (arrayOfString.length > 0) && (arrayOfString[0] != null))
    {
      settings.cp_DefaultSession.cp_InDirectory = FileAccess.getParentDir(arrayOfString[0]);
      int i = add(arrayOfString[0]);
      il.setSelected(i);
      il.display(i);
    }
  }
  
  private int add(String paramString)
  {
    for (int i = 0; i < il.getListModel().getSize(); i++) {
      if (il.getListModel().getElementAt(i).equals(paramString)) {
        return i;
      }
    }
    ((DefaultListModel)il.getListModel()).addElement(paramString);
    try
    {
      Object localObject1 = Configuration.getConfigurationRoot(xMSF, FileAccess.connectURLs("/org.openoffice.Office.WebWizard/WebWizard", "BackgroundImages"), true);
      int j = Configuration.getChildrenNames(localObject1).length + 1;
      Object localObject2 = Configuration.addConfigNode(localObject1, PropertyNames.EMPTY_STRING + j);
      Configuration.set(paramString, "Href", localObject2);
      Configuration.commit(localObject1);
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return il.getListModel().getSize() - 1;
  }
  
  private class BGRenderer
    implements ImageList.IImageRenderer
  {
    private int cut;
    
    public BGRenderer(int paramInt)
    {
      cut = paramInt;
    }
    
    public Object[] getImageUrls(Object paramObject)
    {
      if (paramObject != null)
      {
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = paramObject;
        return arrayOfObject;
      }
      return null;
    }
    
    public String render(Object paramObject)
    {
      return paramObject == null ? PropertyNames.EMPTY_STRING : FileAccess.getPathFilename(fileAccess.getPath((String)paramObject, null));
    }
  }
  
  private class Model
    extends DefaultListModel
  {
    public Model(ConfigSet paramConfigSet)
    {
      try
      {
        for (int i = 0; i < paramConfigSet.getSize(); i++)
        {
          CGImage localCGImage = (CGImage)paramConfigSet.getElementAt(i);
          String str = sd.xStringSubstitution.substituteVariables(cp_Href, false);
          if (fileAccess.exists(str, false)) {
            addDir(str);
          } else {
            remove((String)paramConfigSet.getKey(localCGImage));
          }
        }
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
    }
    
    private void remove(String paramString)
    {
      try
      {
        Object localObject = Configuration.getConfigurationRoot(xMSF, "/org.openoffice.Office.WebWizard/WebWizard/BackgroundImages", true);
        Configuration.removeNode(localObject, paramString);
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
    }
    
    private void addDir(String paramString)
    {
      if (fileAccess.isDirectory(paramString)) {
        add(fileAccess.listFiles(paramString, false));
      } else {
        add(paramString);
      }
    }
    
    private void add(String[] paramArrayOfString)
    {
      for (int i = 0; i < paramArrayOfString.length; i++) {
        add(paramArrayOfString[i]);
      }
    }
    
    private void add(String paramString)
    {
      String str = paramString.toLowerCase();
      if ((str.endsWith("jpg")) || (str.endsWith("jpeg")) || (str.endsWith("gif"))) {
        addElement(paramString);
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.BackgroundsDialog
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web;

import com.sun.star.beans.XPropertyAccess;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.task.XJob;
import com.sun.star.task.XJobExecutor;
import com.sun.star.uno.Type;
import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.Resource;
import java.io.PrintStream;

public class CallWizard$WizardImplementation
  implements XInitialization, XTypeProvider, XServiceInfo, XJobExecutor
{
  public CallWizard$WizardImplementation(XMultiServiceFactory paramXMultiServiceFactory)
  {
    xmultiservicefactory = paramXMultiServiceFactory;
    if (xmultiservicefactory != null) {}
  }
  
  private static WebWizard webWizard = null;
  private static final String __serviceName = "com.sun.star.wizards.web.CallWizard";
  private XMultiServiceFactory xmultiservicefactory;
  
  public void trigger(String paramString)
  {
    if (paramString.equalsIgnoreCase(PropertyNames.START))
    {
      if (webWizard == null)
      {
        WebWizard localWebWizard = null;
        try
        {
          webWizard = new WebWizard(xmultiservicefactory);
          localWebWizard = webWizard;
          webWizard.show();
          webWizard = null;
        }
        catch (Exception localException2)
        {
          webWizard = null;
          localException2.printStackTrace();
          Resource.showCommonResourceError(xmultiservicefactory);
        }
        finally
        {
          webWizard = null;
          try
          {
            if (localWebWizard != null) {
              localWebWizard.cleanup();
            }
          }
          catch (Exception localException4)
          {
            localException4.printStackTrace();
          }
        }
      }
      webWizard.activate();
    }
  }
  
  public void initialize(Object[] paramArrayOfObject)
    throws com.sun.star.uno.Exception
  {}
  
  public String[] getSupportedServiceNames()
  {
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "com.sun.star.wizards.web.CallWizard";
    
    return arrayOfString;
  }
  
  public boolean supportsService(String paramString)
  {
    boolean bool = false;
    if (paramString.equals("com.sun.star.wizards.web.CallWizard")) {
      bool = true;
    }
    return bool;
  }
  
  public byte[] getImplementationId()
  {
    byte[] arrayOfByte = new byte[0];
    try
    {
      arrayOfByte = (PropertyNames.EMPTY_STRING + hashCode()).getBytes();
    }
    catch (Exception localException)
    {
      System.err.println(localException);
    }
    return arrayOfByte;
  }
  
  public String getImplementationName()
  {
    return WizardImplementation.class.getName();
  }
  
  public Type[] getTypes()
  {
    Type[] arrayOfType = new Type[0];
    try
    {
      arrayOfType = new Type[] { new Type(XPropertyAccess.class), new Type(XJob.class), new Type(XJobExecutor.class), new Type(XTypeProvider.class), new Type(XServiceInfo.class), new Type(XInitialization.class) };
    }
    catch (Exception localException)
    {
      System.err.println(localException);
    }
    return arrayOfType;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.CallWizard.WizardImplementation
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web;

import com.sun.star.beans.XPropertyAccess;
import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.task.XJob;
import com.sun.star.task.XJobExecutor;
import com.sun.star.uno.Type;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.Resource;
import java.io.PrintStream;

public class CallWizard
{
  public static XSingleServiceFactory __getServiceFactory(String paramString, XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey)
  {
    XSingleServiceFactory localXSingleServiceFactory = null;
    if (paramString.equals(WizardImplementation.class.getName())) {
      localXSingleServiceFactory = FactoryHelper.getServiceFactory(WizardImplementation.class, "com.sun.star.wizards.web.CallWizard", paramXMultiServiceFactory, paramXRegistryKey);
    }
    return localXSingleServiceFactory;
  }
  
  public static class WizardImplementation
    implements XInitialization, XTypeProvider, XServiceInfo, XJobExecutor
  {
    public WizardImplementation(XMultiServiceFactory paramXMultiServiceFactory)
    {
      xmultiservicefactory = paramXMultiServiceFactory;
      if (xmultiservicefactory != null) {}
    }
    
    private static WebWizard webWizard = null;
    private static final String __serviceName = "com.sun.star.wizards.web.CallWizard";
    private XMultiServiceFactory xmultiservicefactory;
    
    public void trigger(String paramString)
    {
      if (paramString.equalsIgnoreCase(PropertyNames.START))
      {
        if (webWizard == null)
        {
          WebWizard localWebWizard = null;
          try
          {
            webWizard = new WebWizard(xmultiservicefactory);
            localWebWizard = webWizard;
            webWizard.show();
            webWizard = null;
          }
          catch (Exception localException2)
          {
            webWizard = null;
            localException2.printStackTrace();
            Resource.showCommonResourceError(xmultiservicefactory);
          }
          finally
          {
            webWizard = null;
            try
            {
              if (localWebWizard != null) {
                localWebWizard.cleanup();
              }
            }
            catch (Exception localException4)
            {
              localException4.printStackTrace();
            }
          }
        }
        webWizard.activate();
      }
    }
    
    public void initialize(Object[] paramArrayOfObject)
      throws com.sun.star.uno.Exception
    {}
    
    public String[] getSupportedServiceNames()
    {
      String[] arrayOfString = new String[1];
      arrayOfString[0] = "com.sun.star.wizards.web.CallWizard";
      
      return arrayOfString;
    }
    
    public boolean supportsService(String paramString)
    {
      boolean bool = false;
      if (paramString.equals("com.sun.star.wizards.web.CallWizard")) {
        bool = true;
      }
      return bool;
    }
    
    public byte[] getImplementationId()
    {
      byte[] arrayOfByte = new byte[0];
      try
      {
        arrayOfByte = (PropertyNames.EMPTY_STRING + hashCode()).getBytes();
      }
      catch (Exception localException)
      {
        System.err.println(localException);
      }
      return arrayOfByte;
    }
    
    public String getImplementationName()
    {
      return WizardImplementation.class.getName();
    }
    
    public Type[] getTypes()
    {
      Type[] arrayOfType = new Type[0];
      try
      {
        arrayOfType = new Type[] { new Type(XPropertyAccess.class), new Type(XJob.class), new Type(XJobExecutor.class), new Type(XTypeProvider.class), new Type(XServiceInfo.class), new Type(XInitialization.class) };
      }
      catch (Exception localException)
      {
        System.err.println(localException);
      }
      return arrayOfType;
    }
  }
  
  public static void main(String[] paramArrayOfString)
  {
    String str = "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager";
    try
    {
      XMultiServiceFactory localXMultiServiceFactory = Desktop.connect(str);
      WizardImplementation localWizardImplementation = new WizardImplementation(localXMultiServiceFactory);
      localWizardImplementation.trigger(PropertyNames.START);
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.CallWizard
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.wizards.common.ConfigGroup;

public class CGArgument
  extends ConfigGroup
{
  public String cp_Value;
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGArgument
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.wizards.common.ConfigSet;
import com.sun.star.wizards.common.XMLHelper;
import com.sun.star.wizards.common.XMLProvider;
import org.w3c.dom.Node;

public class CGContent
  extends ConfigSetItem
  implements XMLProvider
{
  public String dirName;
  public String cp_Name;
  public String cp_Description;
  public ConfigSet cp_Contents = new ConfigSet(CGContent.class);
  public ConfigSet cp_Documents = new ConfigSet(CGDocument.class);
  
  public Node createDOM(Node paramNode)
  {
    Node localNode = XMLHelper.addElement(paramNode, "content", new String[] { "name", "directory-name", "description", "directory" }, new String[] { cp_Name, dirName, cp_Description, dirName });
    
    cp_Documents.createDOM(localNode);
    
    return localNode;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGContent
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.wizards.common.ConfigGroup;
import com.sun.star.wizards.common.ConfigSet;
import com.sun.star.wizards.common.XMLHelper;
import com.sun.star.wizards.common.XMLProvider;
import org.w3c.dom.Node;

public class CGDesign
  extends ConfigGroup
  implements XMLProvider
{
  public String cp_Layout;
  public String cp_Style;
  public String cp_BackgroundImage;
  public String cp_IconSet;
  public boolean cp_DisplayTitle;
  public boolean cp_DisplayDescription;
  public boolean cp_DisplayAuthor;
  public boolean cp_DisplayCreateDate;
  public boolean cp_DisplayUpdateDate;
  public boolean cp_DisplayFilename;
  public boolean cp_DisplayFileFormat;
  public boolean cp_DisplayFormatIcon;
  public boolean cp_DisplayPages;
  public boolean cp_DisplaySize;
  public int cp_OptimizeDisplaySize;
  private final String TRUE = "true";
  private final String FALSE = null;
  private String styleName;
  
  public Node createDOM(Node paramNode)
  {
    return XMLHelper.addElement(paramNode, "design", new String[0], new String[0]);
  }
  
  private static final Short SHORT_TRUE = new Short((short)1);
  private static final Short SHORT_FALSE = new Short((short)0);
  
  public short[] getStyle()
  {
    CGStyle localCGStyle = (CGStyle)root).cp_Styles.getElement(cp_Style);
    return new short[] { (short)root).cp_Styles.getIndexOf(localCGStyle) };
  }
  
  public void setStyle(short[] paramArrayOfShort)
  {
    Object localObject = root).cp_Styles.getElementAt(paramArrayOfShort[0]);
    cp_Style = ((String)root).cp_Styles.getKey(localObject));
  }
  
  public int getLayout()
  {
    CGLayout localCGLayout = (CGLayout)root).cp_Layouts.getElement(cp_Layout);
    return cp_Index;
  }
  
  public void setLayout(int paramInt)
  {
    CGLayout localCGLayout = (CGLayout)root).cp_Layouts.getElementAt(paramInt);
    cp_Layout = ((String)root).cp_Layouts.getKey(localCGLayout));
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGDesign
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.beans.PropertyValue;
import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XDocumentPropertiesSupplier;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.frame.XDesktop;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.DateTime;
import com.sun.star.wizards.common.ConfigSet;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.Properties;
import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.XMLHelper;
import com.sun.star.wizards.common.XMLProvider;
import com.sun.star.wizards.document.OfficeDocument;
import com.sun.star.wizards.ui.event.Task;
import java.io.File;
import java.io.FileNotFoundException;
import org.w3c.dom.Node;

public class CGDocument
  extends ConfigSetItem
  implements XMLProvider
{
  public static final int PAGE_TYPE_UNKNOWN = 0;
  public static final int PAGE_TYPE_PAGE = 1;
  public static final int PAGE_TYPE_SLIDE = 2;
  public String cp_Title = PropertyNames.EMPTY_STRING;
  public String cp_Description = PropertyNames.EMPTY_STRING;
  public String cp_URL;
  public String cp_Author = PropertyNames.EMPTY_STRING;
  public String cp_Exporter;
  public String localFilename = PropertyNames.EMPTY_STRING;
  public String urlFilename = PropertyNames.EMPTY_STRING;
  public String title = PropertyNames.EMPTY_STRING;
  public String description = PropertyNames.EMPTY_STRING;
  public String author = PropertyNames.EMPTY_STRING;
  public DateTime createDate;
  public DateTime updateDate;
  public int sizeBytes = -1;
  public int pages = -1;
  public String dirName;
  public String appType;
  public PropertyValue[] mediaDescriptor;
  public boolean isSODocument;
  public boolean isSOOpenable;
  public boolean valid = false;
  public String targetTypeName;
  
  public CGDocument() {}
  
  public CGDocument(String paramString, XMultiServiceFactory paramXMultiServiceFactory, Task paramTask)
    throws Exception
  {
    cp_URL = getSettings().getFileAccess(paramXMultiServiceFactory).getURL(paramString);
    if (paramTask == null) {
      paramTask = new Task(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, 5);
    }
    validate(paramXMultiServiceFactory, paramTask);
  }
  
  public void validate(XMultiServiceFactory paramXMultiServiceFactory, Task paramTask)
    throws FileNotFoundException, IllegalArgumentException, Exception
  {
    if (!getSettings().getFileAccess(paramXMultiServiceFactory).exists(cp_URL, false)) {
      throw new FileNotFoundException("The given URL does not point to a file");
    }
    if (getSettings().getFileAccess(paramXMultiServiceFactory).isDirectory(cp_URL)) {
      throw new IllegalArgumentException("The given URL points to a directory");
    }
    mediaDescriptor = OfficeDocument.getFileMediaDecriptor(paramXMultiServiceFactory, cp_URL);
    
    paramTask.advance(true);
    
    analyzeFileType(mediaDescriptor);
    
    paramTask.advance(true);
    
    String str = getSettings().getFileAccess(paramXMultiServiceFactory).getPath(cp_URL, PropertyNames.EMPTY_STRING);
    localFilename = FileAccess.getFilename(str, File.separator);
    
    XDocumentProperties localXDocumentProperties = null;
    
    paramTask.advance(true);
    if (isSOOpenable)
    {
      XDesktop localXDesktop = Desktop.getDesktop(paramXMultiServiceFactory);
      PropertyValue[] arrayOfPropertyValue = new PropertyValue[3];
      arrayOfPropertyValue[0] = Properties.createProperty("Hidden", Boolean.TRUE);
      arrayOfPropertyValue[1] = Properties.createProperty("MacroExecutionMode", new Short(0));
      arrayOfPropertyValue[2] = Properties.createProperty("UpdateDocMode", new Short(0));
      XComponent localXComponent = ((XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, localXDesktop)).loadComponentFromURL(cp_URL, "_default", 0, arrayOfPropertyValue);
      localXDocumentProperties = ((XDocumentPropertiesSupplier)UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, localXComponent)).getDocumentProperties();
    }
    paramTask.advance(true);
    if (localXDocumentProperties != null)
    {
      title = localXDocumentProperties.getTitle();
      description = localXDocumentProperties.getDescription();
      author = localXDocumentProperties.getAuthor();
      createDate = localXDocumentProperties.getCreationDate();
      updateDate = localXDocumentProperties.getModificationDate();
    }
    else
    {
      title = localFilename;
      updateDate = getSettings().getFileAccess(paramXMultiServiceFactory).getLastModified(cp_URL);
    }
    paramTask.advance(true);
    
    valid = true;
    if (cp_Title.equals(PropertyNames.EMPTY_STRING)) {
      cp_Title = title;
    }
    if (cp_Title.equals(PropertyNames.EMPTY_STRING)) {
      cp_Title = localFilename;
    }
    if (cp_Description.equals(PropertyNames.EMPTY_STRING)) {
      cp_Description = description;
    }
    if (cp_Author.equals(PropertyNames.EMPTY_STRING)) {
      cp_Author = author;
    }
    if ((cp_Exporter == null) || (cp_Exporter.equals(PropertyNames.EMPTY_STRING))) {
      cp_Exporter = ((String)getSettingscp_Exporters.getKey(getSettings().getExporters(appType)[0]));
    }
  }
  
  private void analyzeFileType(PropertyValue[] paramArrayOfPropertyValue)
  {
    String str = (paramArrayOfPropertyValue != null) || (paramArrayOfPropertyValue == null) ? PropertyNames.EMPTY_STRING : (String)Properties.getPropertyValue(mediaDescriptor, PropertyNames.PROPERTY_NAME);
    
    appType = getDocType(str);
    
    isSOOpenable = ((appType.equals("writer")) || (appType.equals("calc")) || (appType.equals("impress")) || (appType.equals("draw")) || (appType.equals("html")));
    
    String[] arrayOfString = JavaTools.ArrayoutofString(str, "_");
    
    isSODocument = ((arrayOfString.length >= 2) && (isSOOpenable) && (arrayOfString[1].startsWith("Star")));
  }
  
  private String getDocType(String paramString)
  {
    if (paramString.equals(PropertyNames.EMPTY_STRING)) {
      return "other";
    }
    if (paramString.startsWith("writer"))
    {
      if (paramString.startsWith("writer_web_HTML")) {
        return "html";
      }
      return "writer";
    }
    if (paramString.startsWith("calc")) {
      return "calc";
    }
    if (paramString.startsWith("draw")) {
      return "draw";
    }
    if (paramString.startsWith("impress")) {
      return "impress";
    }
    if (paramString.startsWith("pdf")) {
      return "pdf";
    }
    if ((paramString.startsWith("gif")) || (paramString.startsWith("jpg"))) {
      return "graphics";
    }
    if (paramString.startsWith("wav")) {
      return "sound";
    }
    return "other";
  }
  
  public Node createDOM(Node paramNode)
  {
    CGDesign localCGDesign = getSettingscp_DefaultSession.cp_Design;
    CGExporter localCGExporter = (CGExporter)getSettingscp_Exporters.getElement(cp_Exporter);
    
    return XMLHelper.addElement(paramNode, "document", new String[] { "title", "description", "author", "format", "filename", "create-date", "update-date", "pages", "size", "icon", "dir", "fn" }, new String[] { cp_DisplayTitle ? cp_Title : PropertyNames.EMPTY_STRING, cp_DisplayDescription ? cp_Description : PropertyNames.EMPTY_STRING, cp_DisplayAuthor ? cp_Author : PropertyNames.EMPTY_STRING, cp_DisplayFileFormat ? getTargetTypeName(localCGExporter) : PropertyNames.EMPTY_STRING, cp_DisplayFilename ? localFilename : PropertyNames.EMPTY_STRING, cp_DisplayCreateDate ? createDate() : PropertyNames.EMPTY_STRING, cp_DisplayUpdateDate ? updateDate() : PropertyNames.EMPTY_STRING, (cp_DisplayPages) && (pages > -1) ? PropertyNames.EMPTY_STRING + pages() : PropertyNames.EMPTY_STRING, cp_DisplaySize ? sizeKB() : PropertyNames.EMPTY_STRING, cp_DisplayFormatIcon ? getIcon(localCGExporter) : PropertyNames.EMPTY_STRING, dirName, urlFilename });
  }
  
  private String updateDate()
  {
    if (updateDate == null) {
      return PropertyNames.EMPTY_STRING;
    }
    return getSettingsformatter.formatCreated(updateDate);
  }
  
  private String createDate()
  {
    if (createDate == null) {
      return PropertyNames.EMPTY_STRING;
    }
    return getSettingsformatter.formatCreated(createDate);
  }
  
  private String sizeKB()
  {
    if (sizeBytes == -1) {
      return PropertyNames.EMPTY_STRING;
    }
    return getSettingsformatter.formatFileSize(sizeBytes);
  }
  
  private String pages()
  {
    return pages == -1 ? PropertyNames.EMPTY_STRING : JavaTools.replaceSubString(pagesTemplate(), PropertyNames.EMPTY_STRING + pages, "%NUMBER");
  }
  
  private String pagesTemplate()
  {
    int i = getSettingscp_Exporters.getElement(cp_Exporter)).cp_PageType;
    switch (i)
    {
    case 0: 
      return PropertyNames.EMPTY_STRING;
    case 1: 
      return getSettingsresources[0];
    case 2: 
      return getSettingsresources[1];
    }
    return PropertyNames.EMPTY_STRING;
  }
  
  private String getTargetTypeName(CGExporter paramCGExporter)
  {
    return targetTypeName.equals(PropertyNames.EMPTY_STRING) ? (String)Properties.getPropertyValue(mediaDescriptor, "UIName") : targetTypeName;
  }
  
  private String getIcon(CGExporter paramCGExporter)
  {
    return cp_Icon.equals(PropertyNames.EMPTY_STRING) ? getIcon(appType) : cp_Icon;
  }
  
  private String getIcon(String paramString)
  {
    return paramString + ".gif";
  }
  
  public short[] getExporter()
  {
    return new short[] { getExporterIndex() };
  }
  
  public void setExporter(short[] paramArrayOfShort)
  {
    CGExporter localCGExporter = getSettings().getExporters(appType)[paramArrayOfShort[0]];
    cp_Exporter = ((String)getSettingscp_Exporters.getKey(localCGExporter));
  }
  
  private short getExporterIndex()
  {
    if (cp_Exporter == null) {
      return 0;
    }
    Object localObject = getSettingscp_Exporters.getElement(cp_Exporter);
    CGExporter[] arrayOfCGExporter = getSettings().getExporters(appType);
    int j;
    for (int i = 0; i < arrayOfCGExporter.length; j = (short)(i + 1)) {
      if (arrayOfCGExporter[i] == localObject) {
        return i;
      }
    }
    return -1;
  }
  
  public String toString()
  {
    return localFilename;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGDocument
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.wizards.common.ConfigSet;
import com.sun.star.wizards.common.PropertyNames;

public class CGExporter
  extends ConfigSetItem
{
  public String cp_Name;
  public String cp_ExporterClass;
  public boolean cp_OwnDirectory;
  public boolean cp_SupportsFilename;
  public String cp_DefaultFilename;
  public String cp_Extension;
  public String cp_SupportedMimeTypes;
  public String cp_Icon;
  public String cp_TargetType;
  public boolean cp_Binary;
  public int cp_PageType;
  public String targetTypeName = PropertyNames.EMPTY_STRING;
  public ConfigSet cp_Arguments = new ConfigSet(CGArgument.class);
  
  public String toString()
  {
    return cp_Name;
  }
  
  public boolean supports(String paramString)
  {
    return (cp_SupportedMimeTypes.equals(PropertyNames.EMPTY_STRING)) || (cp_SupportedMimeTypes.indexOf(paramString) > -1);
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGExporter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

public class CGFilter
  extends ConfigSetItem
{
  public String cp_Name;
  public String cp_Filter;
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.util.DateTime;
import com.sun.star.wizards.common.ConfigGroup;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.XMLHelper;
import com.sun.star.wizards.common.XMLProvider;
import org.w3c.dom.Node;

public class CGGeneralInfo
  extends ConfigGroup
  implements XMLProvider
{
  public String cp_Title;
  public String cp_Description;
  public String cp_Author;
  public int cp_CreationDate;
  public int cp_UpdateDate;
  public String cp_Email;
  public String cp_Copyright;
  
  public Node createDOM(Node paramNode)
  {
    return XMLHelper.addElement(paramNode, "general-info", new String[] { "title", "author", "description", "creation-date", "update-date", "email", "copyright" }, new String[] { cp_Title, cp_Author, cp_Description, String.valueOf(cp_CreationDate), String.valueOf(cp_UpdateDate), cp_Email, cp_Copyright });
  }
  
  public Integer getCreationDate()
  {
    if (cp_CreationDate == 0) {
      cp_CreationDate = currentDate();
    }
    return new Integer(cp_CreationDate);
  }
  
  public Integer getUpdateDate()
  {
    if (cp_UpdateDate == 0) {
      cp_UpdateDate = currentDate();
    }
    return new Integer(cp_UpdateDate);
  }
  
  public void setCreationDate(Integer paramInteger)
  {
    cp_CreationDate = paramInteger.intValue();
  }
  
  public void setUpdateDate(Integer paramInteger)
  {
    cp_UpdateDate = paramInteger.intValue();
  }
  
  private int currentDate()
  {
    DateTime localDateTime = JavaTools.getDateTime(System.currentTimeMillis());
    
    return Day + Month * 100 + Year * 10000;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGGeneralInfo
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

public class CGIconSet
  extends ConfigSetItem
{
  public String cp_FNPrefix;
  public String cp_FNPostfix;
  public String cp_Name;
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGIconSet
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.wizards.common.ConfigGroup;

public class CGImage
  extends ConfigGroup
{
  public String cp_Href;
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.web.data.CGImage
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.web.data;

import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.FileAccess;
import java.util.Hashtable;
import java.util.Map;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;

public class CGLayout
  extends ConfigSetItem
{
  public String cp_Name;
  public String cp_FSName;
  private Map templates;
  
  private void createTemplates(XMultiServiceFactory paramXMultiServiceFactory)
    throws Exception
  {
    templates = new Hashtable(3);
    
    TransformerFactory localTransformerFactory = TransformerFactory.newInstance();
    
    String str1 = getSettingsworkPath;
    FileAccess localFileAccess = new FileAccess(paramXMultiServiceFactory);
    String str2 = localFileAccess.getURL(getSettingsworkPath, "layouts/" + cp_FSName);
    
    String[] arrayOfString = localFileAccess.listFiles(str2, false);
    for (int i = 0; i < arrayOfString.length; i++) {
      if (FileAccess.getExtension(arrayOfString[i]).equals("xsl")) {
        templates.put(FileAcces
1 2 3 4 5 6 7

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd