svn commit: r497268 - /jakarta/poi/trunk/poi.pom

2007-01-17 Thread markt
Author: markt
Date: Wed Jan 17 16:38:57 2007
New Revision: 497268

URL: http://svn.apache.org/viewvc?view=rev&rev=497268
Log:
Add svn properties

Modified:
jakarta/poi/trunk/poi.pom   (props changed)

Propchange: jakarta/poi/trunk/poi.pom
--
svn:eol-style = native

Propchange: jakarta/poi/trunk/poi.pom
--
svn:keywords = Author Date Id Revision



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



svn commit: r497267 - /jakarta/poi/trunk/jdepend.xsl

2007-01-17 Thread markt
Author: markt
Date: Wed Jan 17 16:37:19 2007
New Revision: 497267

URL: http://svn.apache.org/viewvc?view=rev&rev=497267
Log:
Remove copyright since it is now in NOTICE file and add XML declaration

Modified:
jakarta/poi/trunk/jdepend.xsl

Modified: jakarta/poi/trunk/jdepend.xsl
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/jdepend.xsl?view=diff&rev=497267&r1=497266&r2=497267
==
--- jakarta/poi/trunk/jdepend.xsl (original)
+++ jakarta/poi/trunk/jdepend.xsl Wed Jan 17 16:37:19 2007
@@ -1,4 +1,4 @@
-
+
 http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
 
 

Re: svn commit: r497090 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/RecordTypes.java testcases/org/apache/poi/hslf/record/TestExHyperlink.java

2007-01-17 Thread Mark Thomas
Nick,

Your recent additions don't appear to have the standard svn properties
(svn:eol-style and svn:keywords) set. There is a standard config file
available (http://www.apache.org/dev/version-control.html#https-svn)
for svn clients that configures this and a few other useful things.

HTH,

Mark


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



Re: svn commit: r497107 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/ testcases/org/apache/poi/hslf/record/

2007-01-17 Thread David Fisher

Nick,

Thanks for this. I was going to ask Yegor to look into it.

Regards,
Dave

On Jan 17, 2007, at 12:09 PM, [EMAIL PROTECTED] wrote:


Author: nick
Date: Wed Jan 17 10:09:24 2007
New Revision: 497107

URL: http://svn.apache.org/viewvc?view=rev&rev=497107
Log:
Add ExObjList support

Added:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
ExObjList.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
ExObjListAtom.java
jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/ 
record/TestExObjList.java
jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/ 
record/TestExObjListAtom.java

Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
Document.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
RecordTypes.java
jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/ 
record/TestExHyperlink.java
jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/ 
record/TestExHyperlinkAtom.java


Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/ 
record/Document.java
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/ 
src/org/apache/poi/hslf/record/Document.java? 
view=diff&rev=497107&r1=497106&r2=497107
== 

--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
Document.java (original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
Document.java Wed Jan 17 10:09:24 2007

@@ -39,6 +39,7 @@
private Environment environment;
private PPDrawingGroup ppDrawing;
private SlideListWithText[] slwts;
+   private ExObjList exObjList; // Can be null

/**
 * Returns the DocumentAtom of this Document
@@ -54,6 +55,12 @@
 *  that contains information on pictures in the slides.
 */
public PPDrawingGroup getPPDrawingGroup() { return ppDrawing; }
+   /**
+* Returns the ExObjList, which holds the references to
+*  external objects used in the slides. This may be null, if
+*  there are no external references.
+*/
+   public ExObjList getExObjList() { return exObjList; }

/**
 * Returns all the SlideListWithTexts that are defined for
@@ -115,6 +122,9 @@
}
if(_children[i] instanceof PPDrawingGroup) {
ppDrawing = (PPDrawingGroup)_children[i];
+   }
+   if(_children[i] instanceof ExObjList) {
+   exObjList = (ExObjList)_children[i];
}
}


Added: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/ 
record/ExObjList.java
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/ 
src/org/apache/poi/hslf/record/ExObjList.java?view=auto&rev=497107
== 

--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
ExObjList.java (added)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ 
ExObjList.java Wed Jan 17 10:09:24 2007

@@ -0,0 +1,112 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed  
with

+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License,  
Version 2.0
+* (the "License"); you may not use this file except in compliance  
with

+* the License.  You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
implied.

+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.poi.hslf.record;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+import org.apache.poi.util.LittleEndian;
+
+/**
+ * This class holds the links to exernal objects referenced
+ *  from the document.
+ * @author Nick Burch
+ */
+public class ExObjList extends RecordContainer {
+   private byte[] _header;
+   private static long _type = 1033;
+   
+   // Links to our more interesting children
+   private ExObjListAtom exObjListAtom;
+   
+   /**
+* Returns the ExObjListAtom of this list
+*/
+   public ExObjListAtom getExObjListAtom() { return exObjListAtom; }
+   
+   /**
+* Returns all the ExHyperlinks
+*/
+   public ExHyperlink[] getExHyperlinks() {
+   ArrayList links = new ArrayList();
+   for(int i=0; i<_child

svn commit: r497107 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/ testcases/org/apache/poi/hslf/record/

2007-01-17 Thread nick
Author: nick
Date: Wed Jan 17 10:09:24 2007
New Revision: 497107

URL: http://svn.apache.org/viewvc?view=rev&rev=497107
Log:
Add ExObjList support

Added:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExObjListAtom.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExObjList.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExObjListAtom.java
Modified:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlinkAtom.java

Modified: 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java?view=diff&rev=497107&r1=497106&r2=497107
==
--- 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java 
(original)
+++ 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java 
Wed Jan 17 10:09:24 2007
@@ -39,6 +39,7 @@
private Environment environment;
private PPDrawingGroup ppDrawing;
private SlideListWithText[] slwts;
+   private ExObjList exObjList; // Can be null
 
/**
 * Returns the DocumentAtom of this Document
@@ -54,6 +55,12 @@
 *  that contains information on pictures in the slides.
 */
public PPDrawingGroup getPPDrawingGroup() { return ppDrawing; }
+   /**
+* Returns the ExObjList, which holds the references to 
+*  external objects used in the slides. This may be null, if
+*  there are no external references.
+*/
+   public ExObjList getExObjList() { return exObjList; }

/**
 * Returns all the SlideListWithTexts that are defined for
@@ -115,6 +122,9 @@
}
if(_children[i] instanceof PPDrawingGroup) {
ppDrawing = (PPDrawingGroup)_children[i];
+   }
+   if(_children[i] instanceof ExObjList) {
+   exObjList = (ExObjList)_children[i];
}
}


Added: 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java?view=auto&rev=497107
==
--- 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java 
(added)
+++ 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExObjList.java 
Wed Jan 17 10:09:24 2007
@@ -0,0 +1,112 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.poi.hslf.record;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+import org.apache.poi.util.LittleEndian;
+
+/**
+ * This class holds the links to exernal objects referenced
+ *  from the document.
+ * @author Nick Burch
+ */
+public class ExObjList extends RecordContainer {
+   private byte[] _header;
+   private static long _type = 1033;
+   
+   // Links to our more interesting children
+   private ExObjListAtom exObjListAtom; 
+   
+   /** 
+* Returns the ExObjListAtom of this list
+*/ 
+   public ExObjListAtom getExObjListAtom() { return exObjListAtom; }
+   
+   /**
+* Returns all the ExHyperlinks
+*/
+   public ExHyperlink[] getExHyperlinks() {
+   ArrayList links = new ArrayList();
+   for(int i=0; i<_children.length; i++) {
+   if(_children[i] instanceof ExHyperlink) {
+   links.add(_children[i]);
+   }

DO NOT REPLY [Bug 41047] - Links are currently not supported

2007-01-17 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41047





--- Additional Comments From [EMAIL PROTECTED]  2007-01-17 10:09 ---
I've written support for most of the records:
* InteractiveInfo + Atom
* ExHyperlink + Atom
* ExObjList + Atom

Just needs some nice model/usermodel wrappers around it, and then hook it up
with the RichTextrun Stuff

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



svn commit: r497090 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/RecordTypes.java testcases/org/apache/poi/hslf/record/TestExHyperlink.java

2007-01-17 Thread nick
Author: nick
Date: Wed Jan 17 09:12:26 2007
New Revision: 497090

URL: http://svn.apache.org/viewvc?view=rev&rev=497090
Log:
Add ExHyperlink tests against a real file

Modified:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java

Modified: 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java?view=diff&rev=497090&r1=497089&r2=497090
==
--- 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
 (original)
+++ 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
 Wed Jan 17 09:12:26 2007
@@ -59,7 +59,7 @@
 public static final Type DocRoutingSlip = new Type(1030,null);
 public static final Type OutlineViewInfo = new Type(1031,null);
 public static final Type SorterViewInfo = new Type(1032,null);
-public static final Type ExObjList = new Type(1033,null);
+public static final Type ExObjList = new 
Type(1033,DummyRecordWithChildren.class);
 public static final Type ExObjListAtom = new Type(1034,null);
 public static final Type PPDrawingGroup = new 
Type(1035,PPDrawingGroup.class);
 public static final Type PPDrawing = new Type(1036,PPDrawing.class);

Modified: 
jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java?view=diff&rev=497090&r1=497089&r2=497090
==
--- 
jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java
 (original)
+++ 
jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java
 Wed Jan 17 09:12:26 2007
@@ -24,8 +24,12 @@
 import junit.framework.TestCase;
 import java.io.ByteArrayOutputStream;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 
+import org.apache.poi.hslf.HSLFSlideShow;
+import org.apache.poi.hslf.usermodel.SlideShow;
+
 /**
  * Tests that ExHyperlink works properly.
  *
@@ -95,6 +99,46 @@
}

public void testRealFile() throws Exception {
-   // TODO
+   String dirname = System.getProperty("HSLF.testdata.path");
+   HSLFSlideShow hss = new HSLFSlideShow(dirname + 
"WithLinks.ppt");
+   SlideShow ss = new SlideShow(hss);
+   
+   // Get the document
+   Document doc = ss.getDocumentRecord();
+   // Get the ExObjList
+   RecordContainer exObjList = null;
+   for(int i=0; ihttp://jakarta.apache.org/poi/";, 
links[0].getLinkURL());
+   
+   assertEquals(2, links[1].getExHyperlinkAtom().getNumber());
+   assertEquals("http://slashdot.org/";, links[1].getLinkURL());
+   
+   assertEquals(3, links[2].getExHyperlinkAtom().getNumber());
+   assertEquals("http://jakarta.apache.org/poi/hssf/";, 
links[2].getLinkURL());
+   
+   assertEquals(4, links[3].getExHyperlinkAtom().getNumber());
+   assertEquals("http://jakarta.apache.org/hslf/";, 
links[3].getLinkURL());
+   
}
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



svn commit: r497079 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/ testcases/org/apache/poi/hslf/data/ testcases/org/apache/poi/hslf/record/

2007-01-17 Thread nick
Author: nick
Date: Wed Jan 17 08:59:45 2007
New Revision: 497079

URL: http://svn.apache.org/viewvc?view=rev&rev=497079
Log:
Add support for ExHyperlink and ExHyperlinkAtom

Added:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlinkAtom.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlinkAtom.java
Modified:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/WithLinks.ppt

Added: 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java?view=auto&rev=497079
==
--- 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java
 (added)
+++ 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java
 Wed Jan 17 08:59:45 2007
@@ -0,0 +1,148 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.poi.hslf.record;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.poi.util.LittleEndian;
+
+/**
+ * This class represents the data of a link in the document. 
+ * @author Nick Burch
+ */
+public class ExHyperlink extends RecordContainer {
+   private byte[] _header;
+   private static long _type = 4055;
+   
+   // Links to our more interesting children
+   private ExHyperlinkAtom linkAtom;
+   private CString linkDetailsA;
+   private CString linkDetailsB;
+   private Comment2000Atom commentAtom; 
+   
+   /** 
+* Returns the ExHyperlinkAtom of this link
+*/ 
+   public ExHyperlinkAtom getExHyperlinkAtom() { return linkAtom; }
+   
+   /**
+* Returns the URL of the link.
+* TODO: Figure out which of detailsA or detailsB is the
+*  one that always holds it 
+*/
+   public String getLinkURL() {
+   return linkDetailsA.getText();
+   }
+   
+   /**
+* Sets the URL of the link
+* TODO: Figure out if we should always set both
+*/
+   public void setLinkURL(String url) {
+   linkDetailsA.setText(url);
+   linkDetailsB.setText(url);
+   }
+   
+   /**
+* Get the link details (field A)
+*/
+   public String _getDetailsA() {
+   return linkDetailsA.getText();
+   }
+   /**
+* Get the link details (field B)
+*/
+   public String _getDetailsB() {
+   return linkDetailsB.getText();
+   }
+
+   /** 
+* Set things up, and find our more interesting children
+*/
+   protected ExHyperlink(byte[] source, int start, int len) {
+   // Grab the header
+   _header = new byte[8];
+   System.arraycopy(source,start,_header,0,8);
+
+   // Find our children
+   _children = Record.findChildRecords(source,start+8,len-8);
+   findInterestingChildren();
+   }
+
+   /**
+* Go through our child records, picking out the ones that are
+*  interesting, and saving those for use by the easy helper
+*  methods.
+*/ 
+   private void findInterestingChildren() {
+   // First child should be the ExHyperlinkAtom
+   if(_children[0] instanceof ExHyperlinkAtom) {
+   linkAtom = (ExHyperlinkAtom)_children[0];
+   } else {
+   throw new IllegalStateException("First child record 
wasn't a ExHyperlinkAtom, was of type " + _children[0].getRecordType());
+   }
+   
+   // Second child should be the first link details
+   if(_children[1] instanceof CString) {
+

svn commit: r497061 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/InteractiveInfo.java src/org/apache/poi/hslf/record/RecordTypes.java testcases/org/apache/poi/hslf/record/Tes

2007-01-17 Thread nick
Author: nick
Date: Wed Jan 17 08:17:46 2007
New Revision: 497061

URL: http://svn.apache.org/viewvc?view=rev&rev=497061
Log:
Support InteractiveInfo, the parent of InteractiveInfoAtom

Added:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfo.java
Modified:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java

Added: 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java?view=auto&rev=497061
==
--- 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java
 (added)
+++ 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfo.java
 Wed Jan 17 08:17:46 2007
@@ -0,0 +1,97 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.poi.hslf.record;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.poi.util.LittleEndian;
+
+/**
+ * This class represents the metadata of a link in a slide/notes/etc.
+ * It normally just holds a InteractiveInfoAtom, with the metadata
+ *  in it.
+ * @author Nick Burch
+ */
+public class InteractiveInfo extends RecordContainer {
+   private byte[] _header;
+   private static long _type = RecordTypes.InteractiveInfo.typeID;
+   
+   // Links to our more interesting children
+   private InteractiveInfoAtom infoAtom;
+   
+   /** 
+* Returns the InteractiveInfoAtom of this InteractiveInfo
+*/ 
+   public InteractiveInfoAtom getInteractiveInfoAtom() { return infoAtom; }
+   
+   /** 
+* Set things up, and find our more interesting children
+*/
+   protected InteractiveInfo(byte[] source, int start, int len) {
+   // Grab the header
+   _header = new byte[8];
+   System.arraycopy(source,start,_header,0,8);
+
+   // Find our children
+   _children = Record.findChildRecords(source,start+8,len-8);
+   findInterestingChildren();
+   }
+
+   /**
+* Go through our child records, picking out the ones that are
+*  interesting, and saving those for use by the easy helper
+*  methods.
+*/ 
+   private void findInterestingChildren() {
+   // First child should be the InteractiveInfoAtom
+   if(_children[0] instanceof InteractiveInfoAtom) {
+   infoAtom = (InteractiveInfoAtom)_children[0];
+   } else {
+   throw new IllegalStateException("First child record 
wasn't a InteractiveInfoAtom, was of type " + _children[0].getRecordType());
+   }
+   }
+   
+   /**
+* Create a new InteractiveInfo, with blank fields
+*/
+   public InteractiveInfo() {
+   _header = new byte[8];
+   _children = new Record[1];
+   
+   // Setup our header block
+   _header[0] = 0x0f; // We are a container record
+   LittleEndian.putShort(_header, 2, (short)_type);
+   
+   // Setup our child records
+   infoAtom = new InteractiveInfoAtom();
+   _children[0] = infoAtom;
+   }
+
+   /**
+* We are of type 4802
+*/
+   public long getRecordType() { return _type; }
+
+   /**
+* Write the contents of the record back, so it can be written
+*  to disk
+*/
+   public void writeOut(OutputStream out) throws IOException {
+   writeOut(_header[0],_header[1],_type,_children,out);
+   }
+}

Modified: 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java?view=diff&rev=497061&r1=497060&r2=497061
==
--- 
ja

svn commit: r497058 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/ testcases/org/apache/poi/hslf/data/ testcases/org/apache/poi/hslf/record/

2007-01-17 Thread nick
Author: nick
Date: Wed Jan 17 08:05:26 2007
New Revision: 497058

URL: http://svn.apache.org/viewvc?view=rev&rev=497058
Log:
Initial, basic support for InteractiveInfoAtom

Added:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfoAtom.java

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/WithLinks.ppt
   (with props)

jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfoAtom.java
Modified:

jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java

Added: 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfoAtom.java
URL: 
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfoAtom.java?view=auto&rev=497058
==
--- 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfoAtom.java
 (added)
+++ 
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/InteractiveInfoAtom.java
 Wed Jan 17 08:05:26 2007
@@ -0,0 +1,152 @@
+/* 
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+
+package org.apache.poi.hslf.record;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Date;
+
+import org.apache.poi.hslf.util.SystemTimeUtils;
+import org.apache.poi.util.LittleEndian;
+
+/**
+ * Tne atom that holds metadata on Links in the document.
+ * (The actual link is held Document.ExObjList.ExHyperlink)
+ *
+ * @author Nick Burch
+ */
+
+public class InteractiveInfoAtom extends RecordAtom
+{
+/**
+ * Record header.
+ */
+private byte[] _header;
+
+/**
+ * Record data.
+ */
+private byte[] _data;
+
+/**
+ * Constructs a brand new link related atom record.
+ */
+protected InteractiveInfoAtom() {
+_header = new byte[8];
+_data = new byte[16];
+
+LittleEndian.putShort(_header, 2, (short)getRecordType());
+LittleEndian.putInt(_header, 4, _data.length);
+
+// It is fine for the other values to be zero
+}
+
+/**
+ * Constructs the link related atom record from its
+ *  source data.
+ *
+ * @param source the source data as a byte array.
+ * @param start the start offset into the byte array.
+ * @param len the length of the slice in the byte array.
+ */
+protected InteractiveInfoAtom(byte[] source, int start, int len) {
+// Get the header.
+_header = new byte[8];
+System.arraycopy(source,start,_header,0,8);
+
+// Get the record data.
+_data = new byte[len-8];
+System.arraycopy(source,start+8,_data,0,len-8);
+
+// Must be at least 16 bytes long
+if(_data.length < 16) {
+   throw new IllegalArgumentException("The length of the data for 
a InteractiveInfoAtom must be at least 16 bytes, but was only " + _data.length);
+}
+
+// First 4 bytes - no idea, normally 0
+// Second 4 bytes - the id of the link (from 1 onwards)
+// Third 4 bytes - no idea, normally 4
+// Fourth 4 bytes - no idea, normally 8
+}
+
+/**
+ * Gets the link number. You will normally look the
+ *  ExHyperlink with this number to get the details.
+ * @return the link number
+ */
+public int getNumber() {
+return LittleEndian.getInt(_data,4);
+}
+
+/**
+ * Sets the link number
+ * @param number the link number.
+ */
+public void setNumber(int number) {
+LittleEndian.putInt(_data,4,number);
+}
+
+/**
+ * Get the first number - meaning unknown
+ */
+public int _getNumber1() { 
+return LittleEndian.getInt(_data,0);
+}
+protected void _setNumber1(int val) {
+   LittleEndian.putInt(_data, 0, val);
+}
+
+/**
+ * Get the third number - meaning unknown
+ */
+public int _getNumber3() { 
+return LittleEndian.getInt(_data,8);
+}
+protected void _setN