Reading & writting code for XML doc

I need help with writting a java code that will read the XML dopcument below & output it as given below. thanks.
<?xml version="1.0"?>
<!-- Employee expenses by department. -->
<firm>
<!-- Hmmm, suspicious. -->
<dept name="Accounting">
<emp name="Boswell" amt="437.46" />
<emp name="Austen" amt="124.07" />
<emp name="Johnson" amt="184.19" />
<emp name="Boswell" amt="423.99" />
<emp name="Keats" amt="321.14" />
</dept>
<!-- Why so much travel and always to Russia in summer? -->
<dept name="Finance">
<emp name="Tolstoi" amt="224.46" />
<emp name="Turgenev" amt="532.11" />
<emp name="Tolstoi" amt="149.08" />
<emp name="Gogal" amt="643.26" />
<emp name="Tolstoi" amt="265.91" />
</dept>
<!-- Marketing, smarketing -->
<dept name="Marketing">
<emp name="Mishima" amt="754.18" />
<emp name="Kawabata" amt="398.07" />
<emp name="Kawabata" amt="398.07" />
</dept>
<!-- High pay, high stress: deserve to travel -->
<dept name="Technology">
<emp name="Hesse" amt="156.44" />
<emp name="Handke" amt="174.21" />
<emp name="Hesse" amt="365.21" />
<emp name="Hesse" amt="452.33" />
</dept>
</firm>
OUTPUT:
Accounting
Austen --> $124.07
Bosworth --> $861.45
Johnson --> $184.19
Keats --> $321.14
Finance
Gogal --> $643.26
Tolstoi --> $639.45
Turgenev --> $532.11
Marketing
Kawabata --> $796.14
Mishima --> $754.18
Technology
Handke --> $174.21
Hesse --> $973.98
----------------------------------------------------

/* INTERFACE */
import java.util.*;
import java.util.regex.*;
abstract public interface XMLInterface {
abstract public void parse(String file_name);
abstract public String getStartTag(String item);
abstract public String getEndTag(String item);
abstract public Map getAttributes(String item);
abstract public int getXMLType(String item);
public static final String start_tagSA =
"<[\\s]*[\\w]+[\\s]*>";
public static final String end_tagSA =
"</[\\s]*[\\w]+[\\s]*>";
public static final String pi =
"<\\?[\\W\\w\\s]*\\?>";
public static final String comment =
"<!--[\\s]*[\\W\\w]+[\\s]*-->";
public static final String elementSA =
"<[\\s]*[\\w\\W]+[\\s]*[]?>";
public static final String attribute =
"[:\\w]+[\\s]*=[\\s]*([\\'|\"])[\\w\\d\\.$\\s]+\\1";
public static final int XML_BAD_TYPE = 0;
public static final int XML_COMMENT = -1;
public static final int XML_ELEMENT = -2;
public static final int XML_PI = -3;
public static final int XML_START_TAG = -4;
public static final int XML_END_TAG = -5;
/* IMPLIMENTATION */
import java.io.*;
import java.util.*;
import java.util.regex.*;
public class ParserXML implements XMLInterface {
public void parse(String file_name) {
readFile(file_name);
compile_patterns();
Iterator it = records.iterator();
while (it.hasNext()) {
String next = (String) it.next();
int type = getXMLType(next = next.trim());
switch (type) {
case XMLInterface.XML_START_TAG:
System.out.println("Start tag: " + next);
String tag = getStartTag(next);
if (tag != null)
System.out.println("\tTag is " + tag);
break;
case XMLInterface.XML_END_TAG:
System.out.println("End tag: " + next);
break;
case XMLInterface.XML_ELEMENT:
System.out.println("Element: " + next);
Map m = getAttributes(next);
if (m != null) {
Set s = m.keySet();
Iterator iter = s.iterator();
while (iter.hasNext()) {
Object key = iter.next();
System.out.println("\tAttribute: " + key + " = " + m.get(key));
break;
case XMLInterface.XML_COMMENT:
System.out.println("Comment: " + next);
break;
case XMLInterface.XML_PI:
System.out.println("Processing instruction: " + next);
break;
default:
System.out.println("Bad XML type: " + next);
break;
public int getXMLType(String item) {
Matcher m = null;
m = start_tagSA.matcher(item);
if (m.matches()) return XMLInterface.XML_START_TAG;
m = end_tagSA.matcher(item);
if (m.matches()) return XMLInterface.XML_END_TAG;
m = elementSA.matcher(item);
if (m.matches()) return XMLInterface.XML_ELEMENT;
m = comment.matcher(item);
if (m.matches()) return XMLInterface.XML_COMMENT;
m = pi.matcher(item);
if (m.matches()) return XMLInterface.XML_PI;
return XMLInterface.XML_BAD_TYPE;
public String getStartTag(String item) {
Matcher m = start_tagSA.matcher(item);
if (m.find())
return m.group();
else
return null;
public String getEndTag(String item) {
return null;
public Map getAttributes(String item) {
Matcher m = attribute.matcher(item);
if (!m.find()) return null;
m.reset();
Map attributes = new HashMap();
int n = 0;
while (m.find(n)) {
String[ ] key_value = m.group().split("=");
attributes.put(key_value[0].trim(), key_value[1].trim());
n = m.end();
return attributes;
private void readFile(String filename) {
records = new ArrayList();
try {
BufferedReader input = new BufferedReader(new FileReader(filename));
String record = null;
while ((record = input.readLine()) != null)
records.add(record);
input.close();
catch(Exception e) {
e.printStackTrace();
System.exit(-1);
private void dump() {
Iterator it = records.iterator();
while (it.hasNext())
System.out.println(it.next());
private void compile_patterns() {
elementSA = Pattern.compile(XMLInterface.elementSA);
comment = Pattern.compile(XMLInterface.comment);
pi = Pattern.compile(XMLInterface.pi);
start_tagSA = Pattern.compile(XMLInterface.start_tagSA);
end_tagSA = Pattern.compile(XMLInterface.end_tagSA);
attribute = Pattern.compile(XMLInterface.attribute);
private List records;
private Pattern elementSA;
private Pattern comment;
private Pattern pi;
private Pattern start_tagSA;
private Pattern end_tagSA;
private Pattern attribute;
/* DRIVER */
class ParseDriver {
public static void main(String[ ] args) {
if (args.length < 1) {
System.out.println("ParseDriver <filename>");
return;
ParserXML parser = new ParserXML();
parser.parse(args[0]);

Similar Messages

  • Write code for this its urgent

    hi its a alv bills of material report plz write code for this
    Develop a report to high light the bom and/or master receipes fall into the constrained planning horizon those are not ready for porduction
    this report will identity the items with a bom with a status other that 03(ready for production) and/or master receips witha a status other than 04(released). the items will be reveiwed in predefined horizon.
    within a few weeks of entering the 18 th week constrained planning horizon.
    for this report take bom tables stko,stpo,mast.
    in sel-scren take mrp controller, plant, divison.
    send immedialtly

    Brother this is not the correct way to ask.
    In your words you are commanding...
    But we have to request the EXPERTS.
    WE are in learning stage dont order or command.
    Just request them in another way...... then only u get the required reply....
    With regards,
    Prasad.

  • Write code for authentication of username and password using struts

    write code for authentication of username and password using session using struts with jdbc connection..

    write code for authentication of username and
    password using session using struts with jdbc
    connection..and please, allow me to spoon feed you!

  • Need help to write code for 'Print" button......!

    Hi all,
    I am working in oracle forms 6i.I am creating forms for ordering product/quantity(Entering quantity/product details). In my form i have "Print button" to print the quantity details which is in multi-record block(database item).Please help me of how to write code for print button. If u had any source code please post it.
    Please help asap......!
    Thanks
    regards,
    jame

    You haven't got an answer or a reply because this question is asked so many times.
    Why don't you search the forum to find them?

  • How to write code for page up and page down buttons on alv screen?

    Hi,
    Page up and page down buttons are not working in general alv report. Thease buttons are in disable mode. But is stnd. transactions (tcode : fbl5n)  these are enabled and working properly, but we can't debug this with /h
    How to write code for page up and page down buttons on alv screen?

    Poonam,
    On doing the screen debugging it took me over to    Include LSTXWFCC ,kindly check the below code.
    module cc_display.
      fcode = sy-ucomm(4).
      case sy-ucomm(4).
        when 'P--'.
          perform cc_firstpage.
        when 'P-'.
          perform cc_prevpage.
        when 'P+'.
          perform cc_nextpage.
        when 'P++'.
          perform cc_lastpage.
        when 'EX--'.
          perform cc_firstcopy.
        when 'EX-'.
          perform cc_prevcopy.
        when 'EX+'.
          perform cc_nextcopy.
        when 'EX++'.
          perform cc_lastcopy.
    I guess it can give you some lead.
    K.Kiran.

  • How  to write code for font family using swing?

    how to write code for font family using swing?
    i tried this code.but i got only font styles.but i need font family.observ this code
    import java.awt.*;
    import java.awt.event.*;
    public class fontSelect extends java.awt.Dialog implements AdjustmentListener, ItemListener, TextListener, ActionListener {
    public Font selectedFont; //to get result
    public boolean isSelected = false;
    public Color selectedBackground, selectedForeground;
         public fontSelect(Frame parent, boolean modal) {
              super(parent, modal);
         String fntName[] = getToolkit().getFontList();
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] names = ge.getAvailableFontFamilyNames();
              //{{INIT_CONTROLS
              setLayout(null);
              setVisible(false);
    //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setSize(insets().left + insets().right + 380,insets().top + insets().bottom + 282);
              setBackground(java.awt.Color.lightGray);
    fontList = new java.awt.Choice();
              //fontList = new java.awt.List(0,false);
              add(fontList);
              fontList.setBounds(insets().left +25,insets().top + 50,137,144);
              //label1 = new java.awt.Label("Example:-");
              //label1.setBounds(insets().left + 220,insets().top + 36,84,30);
              //add(label1);
              exampleText = new java.awt.TextField();
              //exampleText.setText("sample string ");
              //exampleText.setBounds(insets().left + 40,insets().top + 50,84,21);
              //add(exampleText);
              label2 = new java.awt.Label("Font Family:-");
              label2.setBounds(insets().left + 25,insets().top + 30,70,19);
              add(label2);
              isBold = new java.awt.Checkbox("Bold");
              isBold.setBounds(insets().left + 320,insets().top + 90,60,18);
              isBold.setFont(new Font("Times New Roman", Font.BOLD, 12));
              add(isBold);
              isItalic = new java.awt.Checkbox("Italic");
              isItalic.setBounds(insets().left + 250,insets().top + 90,48,17);
              isItalic.setFont(new Font("Times New Roman", Font.ITALIC, 12));
              add(isItalic);
              showFont = new java.awt.Label("samplestring ",Label.CENTER);
              showFont.setBounds(insets().left + 240,insets().top +50,120,30);
              showFont.setBackground(java.awt.Color.white);
              add(showFont);
    label11 = new java.awt.Label("Size:-");
              label11.setBounds(insets().left + 290,insets().top + 120,70,19);
              add(label11);
              fontSize = new java.awt.Choice();
    add(fontSize);
              //label11 = new java.awt.Label("Example string");
              fontSize.setBounds(insets().left + 290,insets().top + 140,60,23);
              fontSize.setBackground(java.awt.Color.white);
              btnSelect = new java.awt.Button();
              btnSelect.setLabel("Select");
              btnSelect.setBounds(insets().left + 280,insets().top + 190,87,24);
              add(btnSelect);
              btnCancel = new java.awt.Button();
              btnCancel.setLabel("Cancel");
              btnCancel.setBounds(insets().left + 280,insets().top + 230,91,24);
              add(btnCancel);
              label3 = new java.awt.Label("Background:-");
              label3.setBounds(insets().left + 24,insets().top + 90,94,18);
              add(label3);
              rBackground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,255,0,0,255);
              rBackground.setBounds(insets().left + 24,insets().top +110 ,197,21);
              add(rBackground);
              gBackground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,255,0,0,255);
              gBackground.setBounds(insets().left + 24,insets().top + 135,197,21);
              add(gBackground);
              bBackground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,255,0,0,255);
              bBackground.setBounds(insets().left + 24,insets().top + 160,197,21);
              add(bBackground);
              label4 = new java.awt.Label("R");
              label4.setBounds(insets().left + 12,insets().top + 110,12,18);
              label4.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label4.setForeground(java.awt.Color.red);
              add(label4);
              label5 = new java.awt.Label("G");
              label5.setBounds(insets().left + 12,insets().top + 135,12,18);
              label5.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label5.setForeground(new Color(-16744448));
              add(label5);
              label6 = new java.awt.Label("B");
              label6.setBounds(insets().left + 12,insets().top + 160,12,18);
              label6.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label6.setForeground(java.awt.Color.blue);
              add(label6);
              rBackValue = new java.awt.Label("255");
              rBackValue.setBounds(insets().left + 225,insets().top + 110,24,12);
              rBackValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              rBackValue.setForeground(java.awt.Color.red);
              add(rBackValue);
              gBackValue = new java.awt.Label("255");
              gBackValue.setBounds(insets().left + 225,insets().top + 135,24,12);
              gBackValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              gBackValue.setForeground(new Color(-16744384));
              add(gBackValue);
              bBackValue = new java.awt.Label("255");
              bBackValue.setBounds(insets().left + 225,insets().top + 160,24,12);
              bBackValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              bBackValue.setForeground(java.awt.Color.blue);
              add(bBackValue);
              label7 = new java.awt.Label("Foreground:-");
              label7.setBounds(insets().left + 20,insets().top + 185,94,18);
              add(label7);
              rForeground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,0,0,0,255);
              rForeground.setBounds(insets().left + 20,insets().top + 205,197,21);
              add(rForeground);
              gForeground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,0,0,0,255);
              gForeground.setBounds(insets().left + 20,insets().top + 230,197,21);
              add(gForeground);
              bForeground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,0,0,0,255);
              bForeground.setBounds(insets().left + 20,insets().top + 255,197,21);
              add(bForeground);
              label8 = new java.awt.Label("R");
              label8.setBounds(insets().left + 10,insets().top + 205,12,18);
              label8.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label8.setForeground(java.awt.Color.red);
              add(label8);
              label9 = new java.awt.Label("G");
              label9.setBounds(insets().left + 10,insets().top + 230,12,18);
              label9.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label9.setForeground(new Color(-16744448));
              add(label9);
              label10 = new java.awt.Label("B");
              label10.setBounds(insets().left + 10,insets().top + 255,12,18);
              label10.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label10.setForeground(java.awt.Color.blue);
              add(label10);
              rForeValue = new java.awt.Label("255");
              rForeValue.setBounds(insets().left + 220,insets().top + 205,24,12);
              rForeValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              rForeValue.setForeground(java.awt.Color.red);
              add(rForeValue);
              gForeValue = new java.awt.Label("255");
              gForeValue.setBounds(insets().left + 220,insets().top + 230,24,12);
              gForeValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              gForeValue.setForeground(new Color(-16744384));
              add(gForeValue);
              bForeValue = new java.awt.Label("255");
              bForeValue.setBounds(insets().left + 220,insets().top + 255,24,12);
              bForeValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              bForeValue.setForeground(java.awt.Color.blue);
              add(bForeValue);
              setTitle("Choosing font");
              //{{REGISTER_LISTENERS
              exampleText.addTextListener(this);
              btnSelect.addActionListener(this);
              btnCancel.addActionListener(this);
              isBold.addItemListener(this);
              fontList.addItemListener(this);
              isItalic.addItemListener(this);
              fontSize.addItemListener(this);
              rBackground.addAdjustmentListener(this);
              gBackground.addAdjustmentListener(this);
              bBackground.addAdjustmentListener(this);
              rForeground.addAdjustmentListener(this);
              gForeground.addAdjustmentListener(this);
              bForeground.addAdjustmentListener(this);
    for (int i = 0; i < (int)fntName.length; i++)
    fontList.addItem(fntName);
              showFont.setFont(new Font(fntName[0], Font.PLAIN, 12));
    // GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    //String[] names = ge.getAvailableFontFamilyNames();
    for ( int i=0; i<names.length; i++ )
    System.out.println( names[i] );
              selectedBackground = showFont.getBackground();
              selectedForeground = showFont.getForeground();
              int i = 8;
              do {
                   fontSize.addItem(""+i);
                   if (i<=30) i+=2;
                   else if (i<=70) i+=4;
                   else i+=8;
              } while (i<150);
              try {
                   fontSize.select(2);
              } catch (IllegalArgumentException e) { }
         //{{DECLARE_CONTROLS
         //java.awt.List fontList;
    java.awt.Label label11;
         java.awt.Label label1;
         java.awt.TextField exampleText;
         java.awt.Label label2;
         java.awt.Checkbox isBold;
         java.awt.Checkbox isItalic;
         java.awt.Label showFont;
         java.awt.Choice fontSize;
    java.awt.Choice fontList;
         java.awt.Button btnSelect;
         java.awt.Button btnCancel;
         java.awt.Label label3;
         java.awt.Scrollbar rBackground;
         java.awt.Scrollbar gBackground;
         java.awt.Scrollbar bBackground;
         java.awt.Label label4;
         java.awt.Label label5;
         java.awt.Label label6;
         java.awt.Label rBackValue;
         java.awt.Label gBackValue;
         java.awt.Label bBackValue;
         java.awt.Label label7;
         java.awt.Scrollbar rForeground;
         java.awt.Scrollbar gForeground;
         java.awt.Scrollbar bForeground;
         java.awt.Label label8;
         java.awt.Label label9;
         java.awt.Label label10;
         java.awt.Label rForeValue;
         java.awt.Label gForeValue;
         java.awt.Label bForeValue;
    private Font constructFont() {
    int l;
    try {
    l = Integer.parseInt(fontSize.getSelectedItem());
    } catch (NumberFormatException e) {l = 12;}
    selectedFont = new Font(fontList.getItem(fontList.getSelectedIndex()>=0?fontList.getSelectedIndex():0 ), (isBold.getState()?Font.BOLD:0)+(isItalic.getState()?Font.ITALIC:0), l);
    selectedBackground = new Color(rBackground.getValue(), gBackground.getValue(), bBackground.getValue());
    selectedForeground = new Color(rForeground.getValue(), gForeground.getValue(), bForeground.getValue());
    return (selectedFont);
         public void textValueChanged(java.awt.event.TextEvent event) {
              Object object = event.getSource();
              if (object == exampleText) showFont.setText(exampleText.getText());
         public void actionPerformed(java.awt.event.ActionEvent event) {
              Object object = event.getSource();
              if (object == btnSelect) {
    isSelected = true;
    selectedFont = constructFont();
         dispose();
    } else if (object == btnCancel) {
         selectedFont = null;
    selectedBackground = null;
    selectedForeground = null;
    dispose();
         public void itemStateChanged(java.awt.event.ItemEvent event) {
              Object object = event.getSource();
              if (object == isBold) showFont.setFont(constructFont());
              else if (object == fontList) showFont.setFont(constructFont());
              else if (object == isItalic) showFont.setFont(constructFont());
              else if (object == fontSize) showFont.setFont(constructFont());
         public void adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
              Object object = event.getSource();
    constructFont();
    showFont.setBackground(new Color(rBackground.getValue(), gBackground.getValue(), bBackground.getValue()));
    showFont.setForeground(new Color(rForeground.getValue(), gForeground.getValue(), bForeground.getValue()));
    if (object == rBackground) rBackValue.setText(""+rBackground.getValue());
              else if (object == gBackground) gBackValue.setText(""+gBackground.getValue());
              else if (object == bBackground) bBackValue.setText(""+bBackground.getValue());
              else if (object == rForeground) rForeValue.setText(""+rForeground.getValue());
              else if (object == gForeground) gForeValue.setText(""+gForeground.getValue());
              else if (object == bForeground) bForeValue.setText(""+bForeground.getValue());

    Okay, that's better. It would have been nice if the code was formatted, and if there was about 20% of that code. (Your example could have been just one JLabel and nothing else, for example.)
    Anyway, now that you've posted that code, what is your question about it? I see you are calling a "getAvailableFontFamilyNames" method; do you have a question about that? If so, what is the question?

  • How to write code for save file directory?

    how to write code for save file directory?

    how to find usa timezone code using java swing?
    i have some code help me
    public class ItsInitializer {
    private static boolean s_initialized = false;
    private ItsInitializer() {
    public static synchronized void initialize() {
    if (!s_initialized) {
    // Modifies default time zone, disables Daylight Saving Time.
    TimeZone l_defaultTimeZone = TimeZone.getDefault();
    int l_rawOffset = l_defaultTimeZone.getRawOffset();
    String l_id = l_defaultTimeZone.getID();
    SimpleTimeZone l_simpleTimeZone = new SimpleTimeZone(l_rawOffset,
    l_id,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0);
    TimeZone.setDefault(l_simpleTimeZone);
    s_initialized = true;
    2.
    long timeMillis = ...;
    long time = timeMillis / 1000;
    String seconds = Integer.toString((int)(time % 60));
    String minutes = Integer.toString((int)((time % 3600) / 60));
    String hours = Integer.toString((int)(time / 3600));
    for (int i = 0; i < 2; i++) {
         if (seconds.length() < 2) {
              seconds = "0" + seconds;
         if (minutes.length() < 2) {
              minutes = "0" + minutes;
         if (hours.length() < 2) {
              hours = "0" + hours;
    3.
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    5.import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    [ November 23, 2005: Mess
    private Locale locale = Locale.US;
    private static final String[] tzStrings = {
    "America/New_York",
    "America/Chicago",
    "America/Denver",
    "America/Los_Angeles",
    Date now = new Date();
    for ( TimeZone z : zones) {
    DateFormat df = new SimpleDateFormat("K:mm a,z", locale);
    df.setTimeZone(z);
    String result = df.format(now);
    System.out.println(result);
    String date="05/19/2008 04:30 AM (EST)";
                   SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm aaa (z)");
                   TimeZone.setDefault(TimeZone.getTimeZone("PST"));
                   long millis = sdf.parse(date).getTime();
                   sdf.setTimeZone(TimeZone.getDefault());
                   System.out.println(sdf.format(new Date(millis)));
    [ November 23, 2005: Mes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to create files with read/write privileges for everyone?

    I have two iMacs 7,1 (one with Snow Leopard and the other with Mountain Lion) in a local area wireless network.
    I have shared the "documents" folder in the Snow Leopard iMac in order to have files available to the other iMac. The folder has read/write privileges for everyone.
    When I create a new file in the shared "Documents" folder (for example a new Open office document, or a Keynote presentation) this file is by default "read/write" for the Administrator but only "read" for all the other users, so when I try to open it from the other iMac, I am informed that the file is "read only".
    I can obviously change the privileges of the file in the information window, but I have to do on a file per file basis and this takes too long.
    Is it possible to change settings in order to create files which are always "read/write" for everyone?
    And, secondly, since I have several existing files whose privileges I should manually change one by one, is it possible to make global changes of their privileges?
    Thanks in advance
    Best regards

    couple of different changes - 1st, if you want to share folders, doing your whole documents folder is not the best way.  Since both your computers can handle AidDrop, that's what I would recommend - http://osxdaily.com/2011/11/14/how-to-use-airdrop-in-mac-os-x/ - as it create an instant Ad-Hoc network between the two computers and then let's it done. 
    A second possibility that may not be what you're looking for, is to use google drive or some similay cloud sharing app to sync the documents back and forth.  both of these solutions will transfer the files well, but the airdrop may be simplest

  • File transport does not have read/write privileges for receive location???

    Hi all.
    I try to read an EDI-file from a file location.
    In configured the receive location but when I enable it I get an error message in the log saying:
    File transport does not have read/write privileges for receive location "Location"  (Event ID: 7183)
    The location is correct (I used the browse option) and the folder is shared with all users (full access for everybody).
    How can I get rid of this error

    There can be many reasons for this error. First of all try the KB article http://support.microsoft.com/kb/888498 . Then try the solution on this link http://bluebiztalk.blogspot.com/2008/05/file-transport-does-not-have-readwrite.htmlAbdul Rafay
    http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps

  • How to change the permission of a folder of a website hosted on Microsoft Azure. I would like to know how to enable read write permission for this folder

    How to change the permission of a folder of a website hosted on Microsoft Azure. I would like to know how to enable read write permission for this folder
    Regards,
    John

    Hi,
    Please try to setting Folder Permissions on Web Publish, and then deploy it with Web Deploy, as far as I know, if we do that, Web Deploy will use the SetAcl operation to change permissions. Please have a look at the article below.
    #http://sedodream.com/2011/11/08/settingfolderpermissionsonwebpublish.aspx
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I'm looking for the read/write speeds for my Mac's.

    I'm looking for read/write speeds for my Macs, but I can't find consistent data. Does anyone know the speeds or know where I can look? I have three computers:
    iMac late 2013 Fusion/3TB i7
    iMac late 2009 1TB i7
    Macbook Air 256GB i5
    Thanks,

    I think the feature is called Voice Over, and I think it's now compatible with Reader:
    http://support.apple.com/kb/HT3598?viewlocale=en_US&locale=en_US

  • How to write code  for totals and subtotals in alv programing?

    how to write code  for totals and subtotals in alv programing?

    hi,
    1. <u><b>TOTAL.</b></u>
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
    2. <u><b>How do I add subtotals</b></u>
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    Regards
    Anver

  • T-codes for accrual doc creation and posting

    Hi,
    Anyone knows the T-codes for accrual doc creation and posting?
    Thanks,
    CW

    Hi,
    Try with T Codes:
    FBS1 - Enter Accrual/Deferral Document
    F.81 - Reverse Accrual/Deferral Document
    Thanks
    Chandra

  • Could not obtain a maintenance-read + write-Lock for DBQueue/QStream/jobID

    Hi All,
    Does anyone know what does this error mean?
    com.sap.b1i.xcellerator.XcelleratorException:
    XCE001 Nested exception: com.sap.b1i.xcellerator.RejectedException:
    XCE061 Could not obtain a maintenance-read + write-Lock for DBQueue/QStream/jobID Q.INB_IQ_INTQ_ASYN_QS.0010000000
    Regards
    Szymon

    You see that's the thing, I'm not using it for a picture camera. The camera prob wouldnt read the card anyway. I'm using it as a storage device for my Nintendo Wii, I have files that I put on there to use as channels for my Wii Home Screen.

  • Can't open unlocked file I have read & write privileges for

    My nephew emailed me an RTF (created using iWork Pages on a Mac running 10.5.8). When I try to open it, I get "The document “x.rtf” could not be opened. You do not have appropriate access privileges."
    Get Info shows the file isn't locked, plus:
    You have custom access
    dp (Me)  Read & Write
    (unknown) Read only
    everyone Read only
    His parents use Parental Controls, so I thought I might be encountering an ACL problem. But the Terminal command "chmod -a# 0 x.rtf" yields "No ACL present".
    I tried changing the privileges for "everyone" to Read & Write but -- as I expected -- it makes no difference. (OSX won't let me change the privileges for "unknown.")
    For that matter, he attached 2 other files as well -- they behave the same ways.
    It's useless to try fixing the problem on his end unless I can provide his parents with super-simple step-by-step directions, so I'd prefer to fix it myself if possible, but I'm stumped as to what's wrong.

    According to http://www.freebsd.org/doc/handbook/permissions.html, in the case of directories, the execute bit controls whether they may be traversed. So it's normal for this bit to be set for a directory.
    To clarify where I'm at now: ls -l for the directory containing the file shows
    drwxrwxrwx   9 dp  dp         306 Jun 17 20:33 x.rtf
    and CDing to the file itself shows
    drwxrwxrwx  3 dp  dp    102 Jun 15 17:17 Contents
    -rw-rw-rw-  1 dp  dp  10156 Apr 17 22:45 H4835.jpg
    drwxrwxrwx  3 dp  dp    102 Jun 15 17:17 QuickLook
    -rw-rw-rw-  1 dp  dp   8363 Jun 15 17:17 imgres.jpg
    -rw-rw-rw-  1 dp  dp  31077 Jun 15 17:17 index.xml.gz
    -rw-rw-rw-  1 dp  dp  47231 Apr 17 19:01 macbookair.jpg
    -rw-rw-rw-  1 dp  dp  36191 Apr 17 21:14 unknown.jpg
    Get Info still says I have "custom access" to the RTF. Get Info for each file and directory (and their contents) it contains, however, says "You can read and write." I've searched the web and our KB but find very little about exactly what "custom access" means. As near as I can tell, it should mean it has an ACL, but as I reported earlier, that's apparently not so.

Maybe you are looking for

  • Can you download more than one app at a time?

    Basically, can I purchase two apps for OS X, both large downloads, and leave it overnight trusting both to be ready when I come back to the machine? Will they download one at a time, or concurrently? Thanks

  • Can't activate iCloud for iWorks on iPad 1

    I've trouble to get the usage of iCloud activated within the iWorks Suite on my iPad 1. In comparison to other devices (e.g. the iPad of a coworker) I'm missing the Documents & Data section within the iCloud settings on the iPad. Settings of Keynote,

  • How to subdivide 1 large TABLE based on the output of a VIEW

    I am searching for a decent method / example code to subdivide a large table (into a global temp table (GTT) for further processing) based on a list of numeric/alphanumeric which is the resultset from a view. I am groping with the following strategy

  • TS3212 I cannot open itunes

    Hi - I have a problem in that when I try to open itunes (which I have enjoyed for over 6 years) I now get a microsoft windows message saying itunes has stopped working (it does not open at all in other words) and then it looks for a solution, cannot

  • Iphoto cannot find original photo

    I cannot open photo files in iphoto from pictures I have imported the photos several years ago.  I'm just sick...these are old family pictures I want to use.  iPhoto can't find the original...what the heck...it's popping up for me to see I just can't