Reg StyledEditorKit.CutAction()....

I have a JTextPane where text formatting is done .There is need for CUT COPY & PASTE,and I obtain it from
StyledEditorKit.CutAction(),
StyledEditorKit.CopyAction()
StyledEditorKit.PasteAction()
The result is not to expectation and formating are lost when I do cut/copy and paste .
There is so many Docs and examples for Plain Text CUT/COPY/PASTE , but I havent find anything for Styles...
Any one have come across this?

...a rather cheap, rough, lazy and inefficient means of simple styled cut/copy/paste within the same JVM where a firm and informed grasp of element mechanics is lacking and a solid implementation of standard transfer APIs is subverted...
This is not recommended. For true transfer capability, HTML and RTF flavors, along with adequate translation algorithms to those formats, should be supported via the standard transfer APIs.
Assume: valid args, standard attributed paragraph parents with standard attributed character children, mono-thread access
public class DerivedD extends BaseB implements InterfaceI {
/*List of:
Parent->Paragraph element segment{start, end, span, text, attr},
Child->Character element segment{start, end, span, null, attr}, ...
private static ArrayList elemSegList;
/* Phony element storage item. */
//               ElemSeg
     private static final class ElemSeg {
          private static final int PARA = 1;
          private static final int CHAR = 2;
          private int
               type,
               start,
               end,
               span;
          private String text;
          private AttributeSet attr;
          private ElemSeg() {  }
/* selStart:selection Start selEnd:selection End*/
     // copy(DefaultStyledDocument, int, int)
     public static void copy(
DefaultStyledDocument doc, int selStart, int _selEnd) {
     elemSegList = new ArrayList();
     for (int i=_selStart; i<_selEnd;) {
          Element para = _doc.getParagraphElement(i);
          ElemSeg paraSeg = new ElemSeg();
          paraSeg.type = ElemSeg.PARA;
          int paraStart = para.getStartOffset();
          int paraEnd = Math.min(para.getEndOffset(), _selEnd);
          paraSeg.span = paraEnd-paraStart;
          paraSeg.attr = para.getAttributes();
          paraSeg.start = paraStart - _selStart;
          paraSeg.end = paraEnd - _selStart;
          try {
          paraSeg.text =
_doc.getText(paraStart, paraSeg.span);
          } catch (BadLocationException _ble) {
          System.out.println(_ble.getMessage());     
          return;
          elemSegList.add(paraSeg);
          for (int j=paraStart; j<paraEnd;) {
          Element char = doc.getCharacterElement(j);
          ElemSeg charSeg = new ElemSeg();
          charSeg.type = ElemSeg.CHAR;
          int charStart=j;
          int charEnd =
Math.min(paraEnd, _char.getEndOffset());
          charSeg.span = charEnd - charStart;
          charSeg.attr = _char.getAttributes();
          charSeg.start = charStart-_selStart;
          charSeg.end = charEnd-_selStart;
          elemSegList.add(charSeg);
          j=charEnd;
     i=paraEnd;
//               paste(DefaultStyledDocument, int)
     public static void paste(
DefaultStyledDocument doc, int selS) {
     int listSize = elemSegList.size();
     for (int i=0; i<listSize; i++) {
          ElemSeg elemSeg = (ElemSeg) elemSegList.get(i);
          if (elemSeg.type == ElemSeg.PARA) {
          try {
          _doc.insertString(
               elemSeg.start + _selS, elemSeg.text, null);
          } catch (BadLocationException _ble) {
          System.out.println(_ble.getMessage());
          return;
          _doc.setParagraphAttributes(
          elemSeg.start +
_selS, elemSeg.span, elemSeg.attr, true);
          } else if (elemSeg.type == ElemSeg.CHAR) {
               _doc.setCharacterAttributes(
               elemSeg.start +
               _selS, elemSeg.span, elemSeg.attr, false);
} // end: DerivedD
Although the example above could be further expanded for different subclasses of documents, the author, in no way, recommends any commercial implementation of it.

Similar Messages

  • Exception while writing textdocument()

    I am trying to write the document from a JTextPane like this way in jdk1.6
    FileOutputStream fstrm = new FileOutputStream(f);
    ObjectOutput ostrm = new ObjectOutputStream(fstrm);
    ostrm.writeObject(textPane.getDocument());but im facing some exception like this
    java.io.NotSerializableException: sun.awt.image.ToolkitImage
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
    :1509)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:14
    74)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
    a:1392)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
    :1509)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:14
    74)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
    a:1392)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
    :1509)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:14
    74)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
    a:1392)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
    :1509)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:14
    74)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
    a:1392)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
            at new_page$SaveAction.actionPerformed(new_page.java:809)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:19
    95)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:236)
            at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:2
    73)
            at java.awt.Component.processMouseEvent(Component.java:6038)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)please help me regarding this?
    best regards
    tanvir

    thnx pravinth
    im facing some extremely undesireble problems....
    look the incidents
    1) i wrote the in jdk1.5 and it was working properly i was happy then
    2) then i set my jdk path in JCreator to jdk1.6 and from then i am facing this error.
    3)Again i reset my jdk path to jdk1.5 but the exception is not gone
    i wrote a sample demo code with OutputObjectStream it works well
    but while in my main project code it is occuring the problem
    im quite gone to hell now
    i finished my project almost 94% but for it my whole project are in great trouble i really need serious help now
    import static java.awt.Color.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import static java.awt.event.InputEvent.*;
    import static java.awt.AWTEvent.*;
    import javax.swing.plaf.metal.*;
    import java.io.*;
    import java.net.InetAddress.*;
    import java.net.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import javax.swing.text.*;
    import javax.swing.undo.*;
    import javax.swing.event.*;
    import javax.swing.text.rtf.*;
    import java.util.*;
    import java.awt.event.*;
    import java.beans.*;
    public class new_page extends JInternalFrame
         JLabel splashLabel;
           JWindow splashScreen;
         JDesktopPane thedesktop;     
         String unicode="";
         String keyboardinput="";
         //JTextArea jta;
         JTextPane textPane;
         JInternalFrame ami;
         public boolean enable=true;
         public int layout=0;
         public JComboBox jtx;
         public boolean dead_key=false;
         public JComboBox jtx1;
         public JComboBox jtx2;     
         final String [] getFontsSize;
         final StyledEditorKit myeditor;
         public static String myfont_name="";
         public static int myfont_size=0;
         protected UndoAction undoAction;
        protected RedoAction redoAction;
        protected SaveAction saveAction;
        protected UndoManager undo = new UndoManager();     
         private FileAction LogInAction,LogOutAction,ExitAction,helpAction;   
         private JMenu FileMenu,ReportMenu,HelpMenu;
         private JMenuItem ItemUniversalReportAction,ItemIndividualReportAction;
         new_page(JDesktopPane thedesktop)
              this.thedesktop = thedesktop;          
              JMenuBar bar = new JMenuBar();
    //////////////////       FILE MENU ITEM      ////////////////////
              FileMenu = new JMenu("File");
              FileMenu.setMnemonic('F');
              LogInAction= new FileAction("Save",null);          
              LogOutAction= new FileAction("Font",null);          
              ExitAction=new FileAction("Print",null);
              helpAction=new FileAction("Help",null);
              undoAction = new UndoAction(KeyStroke.getKeyStroke('Z',CTRL_DOWN_MASK));
              redoAction = new RedoAction(KeyStroke.getKeyStroke('Y',CTRL_DOWN_MASK));
              saveAction = new SaveAction();
              //FileMenu.add(new JMenuItem(LogInAction));
              //FileMenu.add(new JMenuItem(LogOutAction));
              //FileMenu.addSeparator();
              //FileMenu.add(new JMenuItem(ExitAction));
              //FileMenu.addSeparator();
              LogInAction.putValue(Action.SMALL_ICON,new ImageIcon(getClass().getResource("resources/save1.GIF")));
              LogOutAction.putValue(Action.SMALL_ICON,new ImageIcon(getClass().getResource("resources/font1.GIF")));
              ExitAction.putValue(Action.SMALL_ICON,new ImageIcon(getClass().getResource("resources/print1.GIF")));
              helpAction.putValue(Action.SMALL_ICON,new ImageIcon(getClass().getResource("resources/help1.GIF")));
              //LogOutAction.putValue(Action.SMALL_ICON,new ImageIcon("a.gif"));
              bar.setBackground(Color.lightGray);
              bar.add(FileMenu);          
         //     bar.add(ReportMenu);          
              //bar.add(HelpMenu);
              //setJMenuBar(bar);
              JToolBar toolBar = new JToolBar();
              JButton loginbutton = new JButton(new ImageIcon(getClass().getResource("resources/save1.GIF")));          
              loginbutton.setBorder(null);
              loginbutton.setText(null);
              loginbutton.setToolTipText("Save");
              loginbutton.addActionListener(saveAction);
              JButton logout0button = new JButton(LogOutAction);          
              logout0button.setBorder(null);
              logout0button.setText(null);
              logout0button.setToolTipText("Save");
              JButton picbutton = new JButton(new ImageIcon(getClass().getResource("resources/pic.GIF")));          
              picbutton.setBorder(null);
              picbutton.setText(null);
              picbutton.addActionListener(
                                       new ActionListener()
                                            public void actionPerformed(ActionEvent e)
                                                 try{
                                                           JFileChooser files;
                                                            files = new JFileChooser();
                                                            //ExampleFileFilter ff = new ExampleFileFilter("jpg",)
                                                            ExampleFileFilter jpgFilter = new ExampleFileFilter("jpg", "");
                                                           ExampleFileFilter gifFilter = new ExampleFileFilter("jpeg", "");
                                                           ExampleFileFilter gif1Filter = new ExampleFileFilter("gif", "");
                                                           ExampleFileFilter bothFilter = new ExampleFileFilter(new String[] {"jpg", "jpeg","gif"}, "");
                                                           files.addChoosableFileFilter(jpgFilter);
                                                           files.addChoosableFileFilter(gifFilter);
                                                           files.addChoosableFileFilter(gif1Filter);
                                                           files.setAcceptAllFileFilterUsed(false);
                                                           files.addChoosableFileFilter(bothFilter);
                                                                int result=files.showOpenDialog(null);
                                                                if(result!=JFileChooser.APPROVE_OPTION)
                                                                     if(result!=JFileChooser.CANCEL_OPTION)
                                                                     JOptionPane.showMessageDialog(null,"Error Occured");
                                                                     return;
                                                                String s=files.getSelectedFile().getPath();
                                                                File f = files.getSelectedFile();                    
                                                 SimpleAttributeSet st = new SimpleAttributeSet();
                                                 StyleConstants.setIcon(st,new ImageIcon(s));
                                                 textPane.getDocument().insertString(textPane.getCaretPosition(),"sdf",st);
                                                 }catch(Exception er)
                                                      JOptionPane.showMessageDialog(null,"File can not be loaded.");
              picbutton.setToolTipText("Picture Insert");
              JButton undobutton = new JButton(new ImageIcon(getClass().getResource("resources/undo.GIF")));          
              undobutton.setBorder(null);
              undobutton.setText(null);
              undobutton.setToolTipText("Undo");
              undobutton.addActionListener(undoAction);
              JButton redobutton = new JButton(new ImageIcon(getClass().getResource("resources/redo.GIF")));          
              redobutton.setBorder(null);
              redobutton.setText(null);
              redobutton.setToolTipText("Redo");
              redobutton.addActionListener(redoAction);
              JButton logoutbutton = new JButton(new ImageIcon(getClass().getResource("resources/bold.GIF")));
              logoutbutton.setBorder(null);
              logoutbutton.setText(null);
              logoutbutton.setToolTipText("Bold");
              logoutbutton.addActionListener(new StyledEditorKit.BoldAction());     
              JButton logout1button = new JButton(new ImageIcon(getClass().getResource("resources/italic.GIF")));
              logout1button.setBorder(null);
              logout1button.setText(null);
              logout1button.setToolTipText("Italic");
              logout1button.addActionListener(new StyledEditorKit.ItalicAction());
              JButton logout2button = new JButton(new ImageIcon(getClass().getResource("resources/underline.GIF")));
              logout2button.setBorder(null);
              logout2button.setText(null);
              logout2button.setToolTipText("UnderLine");
              logout2button.addActionListener(new StyledEditorKit.UnderlineAction());
              JButton leftbutton = new JButton(new ImageIcon(getClass().getResource("resources/left.GIF")));          
              leftbutton.setBorder(null);
              leftbutton.setText(null);
              leftbutton.setToolTipText("Left");
              leftbutton.addActionListener(new StyledEditorKit.AlignmentAction("Left",0));
              JButton centerbutton = new JButton(new ImageIcon(getClass().getResource("resources/center.GIF")));          
              centerbutton.setBorder(null);
              centerbutton.setText(null);
              centerbutton.setToolTipText("Center");
              centerbutton.addActionListener(new StyledEditorKit.AlignmentAction("Center",1));
              JButton rightbutton = new JButton(new ImageIcon(getClass().getResource("resources/right.GIF")));          
              rightbutton.setBorder(null);
              rightbutton.setText(null);
              rightbutton.setToolTipText("Right");
              rightbutton.addActionListener(new StyledEditorKit.AlignmentAction("Right",2));
              JButton colorbutton = new JButton(new ImageIcon(getClass().getResource("resources/color.GIF")));          
              colorbutton.setBorder(null);
              colorbutton.setText(null);
              colorbutton.setToolTipText("Text Color");
              colorbutton.addActionListener(
                   new ActionListener()
                        public void actionPerformed(ActionEvent e)
                              Color co = Color.BLACK;
                              co = JColorChooser.showDialog(new_page.this,"Choose a Text Color to Apply",co);
                              if(co==null)
                                   co = Color.BLACK;
                             Action fontAction = new StyledEditorKit.ForegroundAction("color",co);
                             fontAction.actionPerformed(null);
              String sss[]={"sdfasdf","sdfsdf","sdfsdf"};
              jtx = new JComboBox(sss);
              jtx.setSize(20,15);          
              jtx.setToolTipText("Keyboard Selection");
              if(static_data.Instance().instance.supported_font!=null)
              jtx1 = new JComboBox(static_data.Instance().instance.supported_font);
              else
              jtx1 = new JComboBox();
              jtx1.setSize(15,10);
              jtx1.addActionListener(
                   new ActionListener()
                        public void actionPerformed(ActionEvent e)
                             JComboBox comboBox = (JComboBox)e.getSource();
                             String fontSize = comboBox.getSelectedItem().toString();
                             Action fontAction = new StyledEditorKit.FontFamilyAction("family", fontSize);
                             fontAction.actionPerformed(null);
              jtx1.setToolTipText("Font Selection");
              getFontsSize = new String[60];
              for(int i=0;i<60;i++)
                getFontsSize[i] = String.valueOf(i+1);
              jtx2 = new JComboBox(getFontsSize);
              jtx2.setSize(10,15);
              jtx2.addActionListener(
                   new ActionListener()
                        public void actionPerformed(ActionEvent e)
                             JComboBox comboBox = (JComboBox)e.getSource();
                             int fontSize = Integer.parseInt( comboBox.getSelectedItem().toString() );
                             Action fontAction = new StyledEditorKit.FontSizeAction("size", fontSize);
                             fontAction.actionPerformed(null);
              jtx2.setToolTipText("Font Size Selection");
              final JCheckBox myfont = new JCheckBox(":Default Bangla OTF Font");
              myfont.addActionListener(
                   new ActionListener()
                        public void actionPerformed(ActionEvent e)
                             if(myfont.isSelected())                         
                                  jtx1.setEnabled(false);
                                       Font font;                   
                                     try {
                                           font = Font.createFont(java.awt.Font.TRUETYPE_FONT, getClass().getResourceAsStream("font/SolaimanLipi.ttf"));
                                           font=font.deriveFont(Font.PLAIN,25);
                                              textPane.setFont(font);
                                              jtx2.setSelectedIndex(24);
                                     }catch(Exception ee){
                                          JOptionPane.showMessageDialog(null,"Default Can not be Set.Either File Corrupted or Lost");
                             else
                                  jtx1.setEnabled(true);
              myfont.setToolTipText("Default OTF Font Setting");
              JButton exitbutton = new JButton(ExitAction);          
              exitbutton.setBorder(null);
              exitbutton.setText(null);
              exitbutton.setToolTipText("Print");
              JButton helpbutton = new JButton(helpAction);          
              helpbutton.setBorder(null);
              helpbutton.setText(null);
              helpbutton.setToolTipText("Help");
              toolBar.add(loginbutton);
              toolBar.add(picbutton);                    
              toolBar.add(undobutton);
              toolBar.add(redobutton);
              toolBar.addSeparator();                    
              toolBar.add(logoutbutton);
              toolBar.add(logout1button);
              toolBar.add(logout2button);
              toolBar.addSeparator();                    
              toolBar.add(leftbutton);
              toolBar.add(centerbutton);
              toolBar.add(rightbutton);
              toolBar.addSeparator();
              toolBar.add(exitbutton);
              toolBar.add(helpbutton);
              toolBar.addSeparator();     
              //toolBar.addSeparator();
              //toolBar.add(MServerRunbutton);
              toolBar.setFloatable(true);
              toolBar.setRollover(true);
              //toolBar.setBorder(BorderFactory.createEtchedBorder(WHITE,LIGHT_GRAY));
              getContentPane().add(toolBar,BorderLayout.NORTH);
              JToolBar toolBar1 = new JToolBar();
              toolBar1.add(colorbutton);
              toolBar1.addSeparator();          
              toolBar1.add(myfont);
              toolBar1.add(jtx2);
              toolBar1.add(jtx1);
              toolBar1.addSeparator();          
              toolBar1.add(jtx);
              toolBar1.addSeparator();                    
              toolBar1.setOrientation(JToolBar.HORIZONTAL);
              getContentPane().add(toolBar1,BorderLayout.SOUTH);
             this.ami = this;     
             textPane = new JTextPane();//myserialeditor();
             textPane.setToolTipText("TB-Phonetic Layout(Ctrl+Alt+T)\nUnijoy Layout(Ctrl+Alt+R)\nEnglish Layout(Ctrl+Alt+Y)");
             textPane.addKeyListener(
                  new KeyAdapter()
                       public void keyPressed(KeyEvent e)                   
                            if(dead_key&&(e.getKeyCode()==KeyEvent.VK_BACK_SPACE ||e.getKeyCode()==KeyEvent.VK_DELETE))
                            dead_key=false;
                            if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_R)
                                  jtx.setSelectedIndex(1);
                                  return ;
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_T)
                                  jtx.setSelectedIndex(0);return ;
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_Y)
                                  jtx.setSelectedIndex(2);return ;
                            try{
                            if(jtx.getSelectedIndex()==1){
                            int iin=0;
                            if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_1)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F4",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_2)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F5",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_3)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F6",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_4)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F7",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_5)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F2",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_7)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09FA",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_0)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F8",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_E)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u0988",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_U)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u098A",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_I)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u0990",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_O)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u0994",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_A)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u098B",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_S)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u0989",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_D)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u0987",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_F)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u0986",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_G)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09CD",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_H)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F0",textPane.getCharacterAttributes());                                                       
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_X)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u0993",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_C)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u098F",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_V)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09F1",textPane.getCharacterAttributes());                              
                             else if (e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_PERIOD)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09BC",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_Q)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u098C",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_W)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09E1",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_I)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09BD",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_Z)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09E2",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_X)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09D7",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_C)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09E0",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_V)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09E3",textPane.getCharacterAttributes());                              
                             else if (e.isShiftDown() && e.isAltDown() && e.isControlDown() && e.getKeyCode()==KeyEvent.VK_B)
                                  textPane.getDocument().insertString(textPane.getDocument().getLength(),"\u09C4",textPane.getCharacterAttributes());                              
                             else iin=1;
                             if(iin==0)
                             dead_key=false;
                         }catch(Exception exp)
                              JOptionPane.showMessageDialog(null,"Typing Error");
             myeditor = new StyledEditorKit();
             textPane.setEditorKit(myeditor);
              AbstractDocument doc;
              textPane.setCaretPosition(0);
            textPane.setMargin(new Insets(5,5,5,5));
            StyledDocument styledDoc = textPane.getStyledDocument();
            if (styledDoc instanceof AbstractDocument) {
                doc = (AbstractDocument)styledDoc;
                doc.setDocumentFilter(new keyController(new_page.this));
                doc.addUndoableEditListener(new MyUndoableEditListener());
            } else {
                System.err.println("Text pane's document isn't an AbstractDocument!");
                System.exit(-1);
              JScrollPane jsp = new JScrollPane(textPane);          
              /*LineNumber list = new LineNumber(textPane);
              jsp.setRowHeaderView(list);
              numberingPanel = new NumberingPanel();
              numberingPanel.setPreferredSize(new Dimension(30,30));
              numberingPanel.setMaximumSize(new Dimension(30,30));
              numberingPanel.setMinimumSize(new Dimension(30,30));
              textPane = new JTextPane()          {
                   public void paint(Graphics g) {
                        super.paint(g);     
                        numberingPanel.repaint();
              //this.add(numberingPanel, BorderLayout.WEST);          
              getContentPane().add(jsp,BorderLayout.CENTER);
             textPane.setSelectedTextColor(Color.WHITE);
             textPane.setSelectionColor(Color.BLUE);
             addBindings();
                                           try{                                         
                                              Font font = Font.createFont(java.awt.Font.TRUETYPE_FONT, getClass().getResourceAsStream("font/SolaimanLipi.ttf"));
                                           font=font.deriveFont(Font.PLAIN,25);
                                              textPane.setFont(font);
                                              jtx2.setSelectedIndex(24);
                                              jtx1.setEnabled(false);
                                              myfont.setSelected(true);
                                              }catch(Exception e)
                                                   JOptionPane.showMessageDialog(null,"Error Occured while fixing the font");
          }//////////end of new_page(.....)
          NumberingPanel numberingPanel;
          class NumberingPanel extends JPanel {
              public void paint(Graphics g) {
                   super.paint(g);                              
                   g.setColor(Color.BLACK);
                   g.setFont(new Font("Arial",Font.PLAIN,12));
                   Element root = textPane.getDocument().getDefaultRootElement();
                  Rectangle r;
                   try {
                        r = textPane.modelToView(root.getStartOffset());
                        g.drawString(Integer.toString(1),0,(int)(r.getY()+12));                         
                   } catch (BadLocationException e1) {
                   int lines = root.getElementCount();
                   for (int i = 0; i < lines; i++) {
                        int offset = root.getElement(i).getEndOffset();
                        try {
                            r = textPane.modelToView(offset);
                             g.drawString(Integer.toString(i+2),0,(int)(r.getY()+12));
                        } catch (BadLocationException e) {
          protected class MyUndoableEditListener
                        implements UndoableEditListener {
            public void undoableEditHappened(UndoableEditEvent e) {
                //Remember the edit and update the menus.
                undo.addEdit(e.getEdit());
                undoAction.updateUndoState();
                redoAction.updateRedoState();
          class UndoAction extends AbstractAction {
            public UndoAction() {
                super("Undo");
                setEnabled(false);
            public UndoAction(KeyStroke keystroke)
                   super("Undo");
                setEnabled(false);               
                   if(keystroke!=null)
                   putValue(ACCELERATOR_KEY,keystroke);
            public void actionPerformed(ActionEvent e) {
                try {
                    undo.undo();
                } catch (CannotUndoException ex) {
                    System.out.println("Unable to undo: " + ex);
                    ex.printStackTrace();
                    Toolkit.getDefaultToolkit().beep();
                updateUndoState();
                redoAction.updateRedoState();
            protected void updateUndoState() {
                if (undo.canUndo()) {
                    setEnabled(true);
                    putValue(Action.NAME, undo.getUndoPresentationName());
                } else {
                    setEnabled(false);
                    putValue(Action.NAME, "Undo");
         class SaveAction extends AbstractAction{
         SaveAction() {
             //super(saveAction);
            public void actionPerformed(ActionEvent e) {
                 JFrame frame = new JFrame();
              FileDialog fileDialog = new FileDialog(frame);
             fileDialog.setMode(FileDialog.SAVE);
             fileDialog.show();
             String file = fileDialog.getFile();
             if (file == null) {
              return;
             String directory = fileDialog.getDirectory();
             File f = new File(directory, file);        
    int xx = JOptionPane.showInternalConfirmDialog(new_page.this,"Style Mode:  Can't able to access the file without the editor\n"+
                                                             "             All text styles and pictures will be allright\n"+
                                                             "Normal Mode: Can able to access the file without the editor with notepad or other applications\n"+
                                                             "             All text styles and pictures may be lost\n"+
                                                             "Do you want to save in Style Mode ?","Save Modes",JOptionPane.YES_NO_OPTION);
           try {
                if(xx==JOptionPane.YES_OPTION){
                  FileOutputStream fstrm = new FileOutputStream(f);
              ObjectOutputStream ostrm = new ObjectOutputStream(fstrm);
              ostrm.writeObject(textPane.getDocument());
              ostrm.flush();
                 JOptionPane.showMessageDialog(null,"Successfulyy Saved in Style Mode");
            } catch (Exception io) {
              io.printStackTrace();// should put in status panel
              JOptionPane.showMessageDialog(null,"Error Occured while saving");
              return;
         private void writeObject(ObjectOutputStream out) throws IOException {
            out.writeObject(getParent());
            out.writeObject(getName());
        class serial implements Serializable{       
             //java.io.NotSerializableException:
             //ToolkitImage
             serial()
             public void writedata(File f,JTextPane textPane)
             try{
                  *FileOutputStream fstrm = new FileOutputStream(f);*
    *               ObjectOutput ostrm = new ObjectOutputStream(fstrm);               *
    *               ostrm.writeObject(textPane.getDocument());*
    *               ostrm.flush();*
                   }catch(Exception ee)
                        ee.printStackTrace();
        class RedoAction extends AbstractAction {
            public RedoAction() {
                super("Redo");
                setEnabled(false);
            public RedoAction(KeyStroke keystroke)
                   super("Redo");
                setEnabled(false);
                   if(keystroke!=null)
                   putValue(ACCELERATOR_KEY,keystroke);
            public void actionPerformed(ActionEvent e) {
                try {
                    undo.redo();
                } catch (CannotRedoException ex) {
                    System.out.println("Unable to redo: " + ex);
                    ex.printStackTrace();
                    Toolkit.getDefaultToolkit().beep();
                updateRedoState();
                undoAction.updateUndoState();
            protected void updateRedoState() {
                if (undo.canRedo()) {
                    setEnabled(true);
                    putValue(Action.NAME, undo.getRedoPresentationName());
                } else {
                    setEnabled(false);
                    putValue(Action.NAME, "Redo");
          //Add a couple of emacs key bindings for navigation.
        protected void addBindings() {
            InputMap inputMap = textPane.getInputMap();
            //Ctrl-b to go backward one character
            KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK);
            inputMap.put(key, StyledEditorKit.copyAction);
            //Ctrl-f to go forward one character
            key = KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK);
            inputMap.put(key, StyledEditorKit.cutAction);
            //Ctrl-p to go up one line
            key = KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK);
            inputMap.put(key, StyledEditorKit.pasteAction);
            key = KeyStroke.getKeyStroke(KeyEvent.VK_HOME, Event.CTRL_MASK);
            inputMap.put(key, StyledEditorKit.beginAction);
            key = KeyStroke.getKeyStroke(KeyEvent.VK_END, Event.CTRL_MASK);
            inputMap.put(key, StyledEditorKit.endAction);
            key = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, Event.CTRL_MASK);
            inputMap.put(key, StyledEditorKit.pageUpAction);
            key = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, Event.CTRL_MASK);
            inputMap.put(key, StyledEditorKit.pageDownAction);
            key = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, Event.CTRL_MASK & Event.ALT_MASK);
            inputMap.put(key, StyledEditorKit.deletePrevCharAction);
          void save()
               //save_page t1 = new save_page(this,thedesktop,textPane,null);
          static public boolean round = true;
          void font()
               round = true;
               new font_page(this,thedesktop,textPane);
               new StyledEditorKit.FontFamilyAction("SolaimanLipi","SolaimanLipi");
               JOptionPane.showMessageDialog(null,myfont_name+" n:"+myfont_size);
       /////////////class definition for file action
       class FileAction extends AbstractAction
              private String name;
              FileAction(String name)
                   super(name);
                   this.name=name;
              FileAction(String name,KeyStroke keystroke)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Mail can't send email from 123-reg accounts

    Hi all,
    I've got an issue with Mac Mail can’t send email from 123-reg accounts.
    I know there is a lot of articles on simular matters and some I have tried out with no luck, others are just speaking a whole other language.
    Any help would be greatly recived, here's my situation below:
    Running a iMac 2.8GHz Intel Core i5 on OS X 10.8.3
    I’m using 3 accounts on Macs Mail client, one is my iCloud account that is working fine and the other two are my 123-reg accounts that I use for business purposes. I’ve been working like this for a couple of years now and about 6 months ago I upgrade my operating system from Snow Leopard to Mountain Lion.
    2 or 3 months ago I randomly got a problem where I was unable to send any emails from my 123-reg account, I could only receive emails. I checked my settings and they were all correct and unchanged so I attempted to delete them and recreate the account but with no such luck.
    I then decided to check if it was a problem at 123-regs end and attempted to log into web mail. This worked and was able to both send and receive emails so eliminated that possibility.
    I also have these accounts set up on my iPhone, so checked if there was any issues and everything was working fine. I then checked my iphone details and made sure the same was on my desktop and still no such luck.
    I’ve tried out some of the articles I’ve found on here (the ones written in plain English) still no results. I’m not very IT illiterate and just wondered if anyone else has got any ideas, whether there is something specific with 123-reg accounts and Mac Mail?
    Many thanks.

    Thanks
    I just had another hunt around looking at posts and discovered that it was because I recently changed to BT Infinity and they had a block on.
    I didn't even think to question the ISP.
    https://discussions.apple.com/message/21173608#21173608

  • Reg: Message and BPM

    Hi
    I'm having a scenario where i use a JDBC adapter to extract data from a DB. As a result of the query say, 10 rows are returned as message to XI server. I have a transformation (BPM) set and the receiver(target system) is a file. When i open the file to see its contents i can see only the first record been transfered. The mapping part used for the transformation node is having IF condition. But all the fetched records satisfies the conditions in the mapping.
    Pls let me know the corrective step.
    reg: Prabhu

    Hi,
    1)Check the input XML i.e all 10 records are coming into XI . This you can check in SXMB_MONI
    2) Then you can test the mapping in the integration Reposiotry .. So now you can get if any mapping problem. For this , check is the occurence of target strcuture is 1..n or 0.n
    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
    3) If mapping is correct , then check the RWB->Message Monitoring->Message Display Tool and check the payload.
    4) If this is correct, then check the File COntent Conversion of the Receiver File Adapter.
    Hope this helps,
    Regards,
    Moorthy

  • Animated GIF in a StyledEditorKit?

    Im trying to figure out how to add support for animated gifs to the StyledEditorKit. This must be possible somehow since the HTMLEditorKit supports animated gifs.
    My problem is that I can't quite figure out where to start. I have tried just creating an ImageObserver that tells the component to repaint every time a new frame is loaded, but that didn't seem to do anything.
    I think I have to create a new View and create my own ViewFactory to generate it, but how can I let the component know that it has to redraw a particular view?
    Dave

    whooo :( you mean making a customized button ?
    like : public class MyButton extends AbstractButton{
       public void paintComponents(Graphics g){
          ...//img1 - wait 15ms - img2 - wait15ms - img3 - etc
    }that would be a solution, but i was pretty sure it would be possible to do more simple, and that i only forgot a very small thing to make it work...

  • Reg: How to Stop Polling of JDBC Adapter without Scheduling the adapter

    Dear Gurus,
    Here I am having one requirement. My clients wants to send data from JDBC adapter (ORcale System table) to R3 system via RFC.
    His Requirement::
    1. He is not telling the time of data flow from Oracle server so that based on that we can schedule the adapter in the Communication Channel monitoring (Availablitiy Time Planning) or Else we can Schedule by deciding the setting of the polling interval time.
    2. He is telling that When ever he waants to send the data he will place one dummy file in the File Adapter FTP location so that it will became an Indication for u to poll the jdbc adapter and to transfer the data to R3.
    3. Untill he keeps the file or gives indication he doesn;t want to communicate with Oracle server due to some security and it s a most important data base he doesn't want to disturb that Oracle Server as so many business are running  on that.....
    We Proposed::
    1. Atleast you need to tell the scheduling time or poll interval time so that we can schedule our adapter.
    but he s not accepting for this
    2. Atleast U need to give access for Data base to enter one more extra field like STATUS CODE so that we will add one number and we keep on Update in the Update table and based on that Update table statement it will poll.
    but he s not even accepting for this
    3. Finally we prposed that to create another table in the Oracle SYstem as Dulplicate Table which is similar to Standard Orginal table when ever he wants to pick the data please keep that data in this Duplicate TABle so that JDBC adapter will pick the data from thsi TABLE instead of picking the data from that standard table so that it will not effect any standard table data in the table.
    but he s not even accepting for this
    We have done some R & D:::
    1. WE approached even through BPM and via switch conditions is one scenario
       FILE RECEIVE >SWITCH CONDITION> RECEIVE AND SEND or else EXIT
    2. Using correlation in anotehr scenario means correlating File adapter and JDBC and based on one dynamica value it will goes to SEND STEP ( RECE IVE --> RECEIVE --> SEND STEPS )
    Even though we know this...concept that...we jsut tried::
    In BPM we can control the flow in XI 3.0 but we cannot Stop the Polling of JDBC adapter at backend because one the data comes from FILE adapter it will keep on HOLD untill it receives the JDBC from Oracle then based on the condition or Correlation it will goes futher SEND step means after that file adapter is picking file or not ...what ever it may be JDBC will polls at backend and brings that data to BPM"
    Hence sugest me How to Stop Polling of JDBC Adapter without Scheduling the adapter or else using STATUS CODE Update statements in JDBC Tables 
    Regards:
    Amar Srinivas Eli

    Hi! All,
    Finally I decided to do the scenario in two steps:
    1: FILE REQ --> JDBC REQ -->JDBC RES --> FILE RECV
    2: FILE RECV --> RFC
    But I am getting issue while doing first scenario
    Desgn :
    I have created 2 Synchronous interfaces :
    1) FILE 2 JDBC REQ
    In this a) out put message is FILE  Req
              b) Input msage:; FILE RES
    2} JDBC2FILE RECV
            a) Output mesage;; JDBC REQ
            b) Input Msge :: JDBC Response
    Mappings:
    1) File REQ-->JDBC REQ
    2) JDBC RES-->FILE RES
    Interface mappings:
    1: FILE 2 JDBC REQ--> JDBC 2 FLE RECV
    CONFIGURATION ::
    1: One Seder File CC
    2: Two reciever CC's one is for JDBC RECEIVER and other s FILE RECEIVER
    3; One Sender Agreement
    4: 2 Recver agreements
    5: One Interface Determination and
    6: One RECCV Determination
    My Question;;
    1. First let confirm whether my development steps are right or not ?
    2: Another thing s I am not sure reg Configuration Steps means
    whetehr one interface determination and one Receiver Determinations are required or not as these are synchronous Interfaces
    3: main Issue is::::
    If my scenario s FILE2RFC2FILE then I will get RFC response automatically but here issue is this is JDBC
    My reqquirement is By sending one Field from fILE to JDBC REQ it needs to send entire TAbLE records as a Response to file as XML
    without having Sender JDBC how can I send the JDBC Res to FILE and If that is the case then again JDBC adapter is polling which is contradict to the client requuirement which i explained above.
    pleas suggest me the Detailed steps mainly Colloboration agreements and logical routings and
    also explain in detail if i can  go for BPM
    Also give cleear blogs but before giving make sure that it contains detailed screen shots because aIready gone thorugh
    Scenario File-JDBC-RFC
    File<-->JDBC Sync coomunication.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/file-rfc-file(Without+BPM)
    /people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough
    Regards::
    Amar Srinivas Eli

  • Excise Reg at Depot

    Hi all,
    We have Excise REg no for Plant. But plant does not have Excise reg no.
    Material is shipped to Depot with excise invoice. What is the procedure at depot for GR.
    Do i need to capture the excise invoice?. From Depot, there is no excise invoice generated for customers.
    thanks.

    Hi,
    Refer following link;
    [J95 - Sales at Depot|http://help.sap.com/bp_bblibrary/500/HTML/J95_SaleDepot_EN_IN.htm]

  • How to set reg.cgi for VideoPhoneLabs

    i start with stratus .i try set it to work with my dedicated apache server and sql but have no clue how to do it or where to put this file on my server.
    i realy have probleme with reg.cgi
    for now i did www/cgi-bin/reg.cgi and in the xml i set my websiteurl = "http://88..../cgi-bin/"
    also how to complete reg.cgi for have it to talk with my db ?
    here the reg.cgi file.
    help please ...
    #! /usr/bin/python --
    reg.cgi by Michael Thornburgh.
    This file is in the public domain.
    IMPORTANT: This script is for illustrative purposes only. It does
    not have user authentication or other access control measures that
    a real production service would have.
    This script should be placed in the cgi-bin location according to
    your web server installation. The database is an SQLite3 database.
    Edit the location of the database in variable "dbFile".
    Create it with the following schema:
    .schema
    CREATE TABLE registrations (
        m_username VARCHAR COLLATE NOCASE,
        m_identity VARCHAR,
        m_updatetime DATETIME,
        PRIMARY KEY (m_username)
    CREATE INDEX registrations_updatetime ON registrations (m_updatetime ASC);
    # CHANGE THIS
    dbFile = '.../registrations.db'
    import cgi
    import sqlite3
    import xml.sax.saxutils
    query = cgi.parse()
    db = sqlite3.connect(dbFile)
    user = query.get('username', [None])[0]
    identity = query.get('identity', [None])[0]
    friends = query.get('friends', [])
    print 'Content-type: text/plain\n\n<?xml version="1.0" encoding="utf-8"?>\n<result>'
    if user:
        try:
            c = db.cursor()
            c.execute("insert or replace into registrations values (?, ?, datetime('now'))", (user, identity))
            print '\t<update>true</update>'
        except:
            print '\t<update>false</update>'
    for f in friends:
        print "\t<friend>\n\t\t<user>%s</user>" % (xml.sax.saxutils.escape(f), )
        c = db.cursor()
        c.execute("select m_username, m_identity from registrations where m_username = ? and m_updatetime > datetime('now', '-1 hour')", (f, ))
        for result in c.fetchall():
            eachIdent = result[1]
            if not eachIdent:
                eachIdent = ""
            print "\t\t<identity>%s</identity>" % (xml.sax.saxutils.escape(eachIdent), )
            if f != result[0]:
                print "\t\t<registered>%s</registered>" % (xml.sax.saxutils.escape(result[0]), )
        print "\t</friend>"
    db.commit()
    print "</result>"

    Persistent binding is effectively provided by STMS (MPxIO) - is there anything in particular you're wanting to do that STMS doesn't provide?

  • I bought an itunes gift card in a different country than my account is reg to, can i use it??

    my acc is reg in ireland, i am currently in new zealand and bought a gift card, i cant work out how to use it, help!

    You can't.
    They are country specific.
    You could get a New Zealand address, then get a credit card that is billed to that address, then set up an account in New Zealand, and as long as you are inside the Borders of New Zealand, then you could redeem the card.

  • How to execute a .reg file in a task sequence using MDT 2013

    Hi,
    Im trying to add a couple of desktop icons to my custom images during deployment using MDT 2013. I have a .reg file with all commands inside it but I am struggling to get these to work. the .reg file is located on my deployment server and is in a shared
    folder which everyone has full read\write access to, I was wondering if someone could help?
    The commands inside the .reg file are:
    reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f
    reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f
    reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 0 /f
    reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 0 /f
    Thanks

    That's not a *.reg file. that's a set of commands used in a *.cmd file.
    Keith Garner - Principal Consultant [owner] -
    http://DeploymentLive.com

  • Since my last firefox update, I have been unable to type an email - the text box does not appear when I press 'reply' , or press 'compose'. The email provider is '123-reg.co.uk. I have been using both firefox and the provider ['webfusion Ltd/webmail123] s

    Hello. Since my last firefox update, I have been unable to type an email - the box within which one would usually type does not appear when I press 'reply' to a received email, or press 'compose'. The email provider is '123-reg.co.uk. I have been using both firefox and the provider ['webfusion Ltd/webmail123] successfully for well over a year. The provider says it is a browser problem. I can still add an attachment to the email header, which successfully can be sent, but the recipient gets my standard email 'signature' with font messages and the attachment. Can anyone help? My email addresses are [email protected] [this is the one with the issue] and [email protected] in English
    == today

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • Error while compiling : Couldn't allocate output reg for contraint '{ax}'!

    Hey all,
    I'm trying to use an encryption library with Flash using Alchemy (PolarSSL)
    I don't have any experience with compiling C and stuff (I've programmed in C# and Flash before) and I get an error when trying to compile my test program. I get :
    Couldn't allocate output reg for contraint '{ax}'!
    Does anyone know why I am getting this error? I managed to compile only the MD5 part of the library in flash and it all worked, that happens only when I try to put more classes from PolarSSL into my library.
    Thank you

    Hey all,
    I'm trying to use an encryption library with Flash using Alchemy (PolarSSL)
    I don't have any experience with compiling C and stuff (I've programmed in C# and Flash before) and I get an error when trying to compile my test program. I get :
    Couldn't allocate output reg for contraint '{ax}'!
    Does anyone know why I am getting this error? I managed to compile only the MD5 part of the library in flash and it all worked, that happens only when I try to put more classes from PolarSSL into my library.
    Thank you

  • Reg XML generation from java objects using SAX 2.0

    i'm using java 1.6 and i've imported following class to generate XML from java objects
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    the following class has been imple her to create a Xml file and tag elements ,
    OutputFormat of = new OutputFormat("XML", "iso-8859-1", true);
    XMLSerializer serializer = new XMLSerializer(fos, of);
    ContentHandler hd = serializer.asContentHandler();
    hd.startDocument();
    everything works fine but i'm getting warrnin reg the serializer and outputformat
    warring is:
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    HOW CAN I AVOID DS WARRING PLZ HELP REG DS
    thanks ,
    with regards,
    Rajesh.S

    I've been having the same problem. Here is what i found:
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476630]
    Hope that helps (or at least helps you feel better).

  • CDs I burn from my itunes 10 on my macbook with snow lepard will not play in the regular cd player.  How do I burn Cds that will pay in a reg old cd player?

    CDs I burn from my itunes 10 on my macbook with snow lepard will not play in the regular cd player.  How do I burn Cds that will pay in a reg old cd player?

    When the computer was new, I had the same issue I have now.  It was new and I could not burn to play on a reg cd player. Today, I can not burn to play on a reg cd player. Inbetween, I could not burn to play on a reg cd player.  I keep giving up and then trying months later.
           I have recently made the cds that play on the computer.  I have also tried in the last month to make a dvd copy, it played.  I have gone to people's homes and tried the cd's burned in my computer. They are not recognized.  This last round I have only used the cd-r but have tried many others in the past. I am running out of money to keep buying different brands, kinds, etc.  I figured it must be my lac of knowledge and am trying to get some new here. 
    Sincerely,
    Paul

  • Reg: Item ok check box in MIGO

    Hi All,
        Could some one tel how / wer to make the item check in MIGO as mandatory in item tab .. In standard the it would be mandatory in detail data but while doing subcontracting the user is allowed to remove the check(tick mark ) in item column for the child material and it is allowing to post the document.
    hope it is clear ....
    if not i shall better clarity further
    reg
    AV

    That means if you select it then it will be considered and of deselect then deleted that is nothing but Iten OK indicator only.
    Input means optional entry that means it is up to user whether he wants to select indicator or not and required means user has to select it.
    If it doesn't work then use t.code:SHD0 & proceed by entering MIGO Transaction Code.
    Here activate Item OK indicator and make it display so user will not be able to change it in MIGO
    Also you can use function in MIGO, click in menu Settings > Default Values
    Here activate "Propose the Ok Function in Future", Item OK will get defaulted in MIGO everytime, user has not to activate it during MIGO.

Maybe you are looking for