Package org.w3c.jigsaw.admin

Examples of org.w3c.jigsaw.admin.RemoteResource


    public void notifyExpander(TreeBrowser browser, TreeNode nd) {
  if(tl != null) {
      tl.focusChanged((RemoteResourceWrapper)nd.getItem());
  }
  RemoteResourceWrapper rrw = null;
  RemoteResource rr = null;
  boolean ic = false;
  boolean authorized;

  rrw = (RemoteResourceWrapper)nd.getItem();
  if(rrw == null)
      return;
  rr = rrw.getResource();
  try {
      ic = rr.isContainer();
  } catch(Exception ex) {
      ex.printStackTrace();
  }
  if(ic) {
      String names[] = null;
      setCursor(Frame.WAIT_CURSOR);
      authorized = false;
      while(!authorized) {
    authorized = true;
    try {
        names = rr.enumerateResourceIdentifiers();
    } catch (RemoteAccessException ex) {
        if( ex.getMessage().equals("Unauthorized")) {
      authorized = false;
        } else {
          names = new String[0];
          errorPopup("RemoteAccessException", ex);
          ex.printStackTrace();
        }
    } finally {
        if(!authorized) {
      popupDialog("admin");
        }
    }
      }
      Sorter.sortStringArray(names, true);
      if (debug)
    System.out.println("Found "+names.length+" identifiers");
            for(int i = 0; i <names.length; i++) {
    boolean nic = false;
    RemoteResourceWrapper nrrw = getResources(rrw, names[i]);
    RemoteResource nrr = nrrw.getResource();
    try {
        nic = nrr.isContainer();
    } catch(Exception ex) {
        ex.printStackTrace();
    }
    if(nic) {
        browser.insert(nd, nrrw, this, names[i], diricon);
View Full Code Here


    public void initialize(RemoteResourceWrapper w, Attribute a,  Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      String v = null;
      // FIXME
      v = (String) r.getValue(a.getName());
    
      if(v == null)
    if(a.getDefault() != null)
        v = a.getDefault().toString();
      if ( v != null ) {
View Full Code Here

    public void initialize(RemoteResourceWrapper w, Attribute a,  Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      String v = null;
      // FIXME
      v = (String) r.getValue(a.getName());
    
      if(v == null)
    if(a.getDefault() != null)
        v = a.getDefault().toString();
      if ( v != null ) {
View Full Code Here

     */
    protected void addResource(String identifier, String classname,
             RemoteResourceWrapper rrwf, TreePath fpath)
  throws RemoteAccessException
    {
  RemoteResource rc =
      rrwf.getResource().registerResource(identifier, classname);
  RemoteResourceWrapper nrrw =
      new RemoteResourceWrapper(rrwf, rc);
  RemoteResourceWrapperNode parent =
      (RemoteResourceWrapperNode)fpath.getLastPathComponent();
View Full Code Here

     * @exception RemoteAccessException if a Remote Error occurs
     */
    protected void reindexResource(RemoteResourceWrapper rrw, boolean rec)
  throws RemoteAccessException
    {
  RemoteResource rr = rrw.getResource();
  if (rr.isContainer()) {
      rr.reindex(rec);
  } else {
      JOptionPane.
    showMessageDialog(this,
          rr.getValue("identifier")+
          " is not a container.",
          "Error",
          JOptionPane.ERROR_MESSAGE);
  }
    }
View Full Code Here

  String selected = combo.getText();
  if(selected != null)
      if (selected.length() > 0) {
    boolean authorized = false;
    boolean ok = true;
    RemoteResource newFrame = null;
    while (!authorized) {
        try {
      authorized = true;
      newFrame = rrw.getResource().registerFrame( null,
                    selected );
View Full Code Here

      initialized = true;
  else {
      widget.removeAll();
  }
 
  RemoteResource rr;
  this.prop = pr;
  this.rrw = rrw;
  this.root_rrw = rrw;
  rr = rrw.getResource();

  if(rr.isFramed()) {
      widget.setLayout(new BorderLayout());
      // Create the Add Frame panel
      initAddPanel(prop);
      // add the frames
      initFrames();
View Full Code Here

  throws RemoteAccessException
    {
  if(initialized)
      return;

  RemoteResource rr;
  AttributeDescription b[] = null;
  String s[] = null;
  int nbn = 0;
  boolean authorized;
 

  this.rrw = (RemoteResourceWrapper)r;
  rr = rrw.getResource();
  authorized = false;
  while(!authorized) {
      try {
    authorized = true;
    b = rr.getAttributes();
      } catch (RemoteAccessException ex) {
    if(ex.getMessage().equals("Unauthorized")) {
        authorized = false;
    } else {
        throw ex;
    }
      } finally {
    if(!authorized) {
        rrw.getServerBrowser().popupPasswdDialog("admin");
    }
      }
  }
  // we select only the editable Attributes.
  for(int i=0; i<b.length; i++)
      if(b[i] == null)
    nbn++;
      else
    if(!b[i].getAttribute().checkFlag(Attribute.EDITABLE))
        nbn++;
  a  = new AttributeDescription[b.length-nbn];
  ae = new AttributeEditor[a.length];
  int j = 0;
  for(int i=0; i<b.length; i++) {
      if(b[i] != null &&
         b[i].getAttribute().checkFlag(Attribute.EDITABLE)) {
    a[j++] = b[i];
      }
  }

  // add all the attribute editors

  JLabel l;
  GridBagLayout gbl = new GridBagLayout();
  GridBagConstraints gbc = new GridBagConstraints();
  JPanel p = new JPanel(gbl);
  gbc.fill = GridBagConstraints.HORIZONTAL;
  gbc.weightx = 0;
  gbc.weighty = 0;
  gbc.insets = Utilities.insets4;
  for(int i = 0 ; i < a.length ; i++) {
      if(a[i] != null) {
    PropertyManager pm = PropertyManager.getPropertyManager();
    Properties attrProps =
        pm.getAttributeProperties(rrw, a[i].getAttribute());
    String labelText = (String) attrProps.get("label");
    if ( labelText == null )
        labelText = a[i].getName();
    l = new JLabel(labelText, JLabel.RIGHT);
    ae[i] = AttributeEditorFactory.getEditor(rrw,
               a[i].getAttribute());
    authorized = false;
    while(!authorized) {
        try {
      authorized = true;
      ae[i].initialize(rrw, a[i].getAttribute(),
           a[i].getValue(), attrProps);
        } catch (RemoteAccessException ex) {
      if(ex.getMessage().equals("Unauthorized")) {
          authorized = false;
      } else {
          throw ex;
      }
        } finally {
      if(!authorized) {
          rrw.getServerBrowser().popupPasswdDialog("admin");
      }
        }
    }
    gbc.gridwidth = 1;
    gbl.setConstraints(l, gbc);
    p.add(l);
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbl.setConstraints(ae[i].getComponent(), gbc);
    p.add(ae[i].getComponent());
      }
  }

  JScrollPane pwidget = new JScrollPane(p);
  //pwidget.add(p);
  widget.add("Center", pwidget);
  // Now add the reset/commit button bar

  JPanel  toolpane= new JPanel(new BorderLayout());
  JButton commitb = new JButton(COMMIT_L);
  JButton resetb  = new JButton(RESET_L);

  commitb.addMouseListener(ma);
  resetb.addMouseListener(ma);

  commitb.addActionListener(al);
  resetb.addActionListener(al);

  message = new JLabel("", JLabel.CENTER);
  message.setForeground(Color.white);
  message.setBackground(Color.gray);

  JPanel pmsg = new JPanel(new BorderLayout());
  pmsg.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
  pmsg.add("Center", message);

  toolpane.add("West", commitb);
  toolpane.add("Center", pmsg);
  toolpane.add("East", resetb);

  widget.add("South", toolpane);
  // add information about the class of the resource edited

  String classes[] = {""};
  try {
      classes = rr.getClassHierarchy();
  } catch (RemoteAccessException ex) {
      // big trouble but it may be temporary and this information
      // is not vital, so just warn
      ex.printStackTrace();
  }
View Full Code Here

    public void initialize(RemoteResourceWrapper w, Attribute a,  Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      String v = null;
      // FIXME
      v = (String) r.getValue(a.getName());
    
      if(v == null)
    if(a.getDefault() != null)
        v = a.getDefault().toString();
      if ( v != null ) {
View Full Code Here

    /**
     * Load the children of this node.
     */
    protected synchronized void loadChildren() {
  RemoteResource frames[] = null;

  children = new Vector();

  try {
      if (rrw.getResource().isFramed())
View Full Code Here

TOP

Related Classes of org.w3c.jigsaw.admin.RemoteResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.