/** * Set up the transformer so that it can build a feeder Wing document and * merge it into the main document * * FIXME: Update document: - this method must be called to initialize the * framework. It must be called after the component's setup has been called * and the implementing object setup. * */ public void setupWing() throws WingException { this.wingContext = new WingContext(); this.wingContext.setLogger(this.getLogger()); this.wingContext.setComponentName(this.getComponentName()); this.wingContext.setObjectManager(this.getObjectManager()); feederDocument = this.createWingDocument(wingContext); this.stack = new Stack<WingMergeableElement>(); }
/** * Generate a specialized name based on the callers name. This is typically * used in situations where two namespaces are being merged together so that * each namespace is prepended with the current scope's name. * * @param name * A locally unique name that distinguished this element from * among it's siblings. */ public String generateName(String name) { return combine(componentName, name); }
/** * Receive notification of the end of a document. */ public void endDocument() throws SAXException { wingContext.dispose(); super.endDocument(); }
/** * Translate this element and all contained elements into SAX events. The * events should be routed to the contentHandler found in the WingContext. * * @param contentHandler * (Required) The registered contentHandler where SAX events * should be routed too. * @param lexicalHandler * (Required) The registered lexicalHandler where lexical * events (such as CDATA, DTD, etc) should be routed too. * @param namespaces * (Required) SAX Helper class to keep track of namespaces able * to determine the correct prefix for a given namespace URI. */ public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler, NamespaceSupport namespaces) throws SAXException { AttributeMap attributes = new AttributeMap(); if (this.name != null) { attributes.put(A_NAME, name); attributes.put(A_ID, context.generateID(E_HEAD, name)); } startElement(contentHandler, namespaces, E_HEAD, attributes); super.toSAX(contentHandler, lexicalHandler, namespaces); endElement(contentHandler, namespaces, E_HEAD); } }
/** * Construct a new RepositoryMeta * * @param context * (Required) The context this element is contained in, such as * where to route SAX events and what i18n catalogue to use. */ protected RepositoryMeta(WingContext context) throws WingException { super(context); ObjectManager objectManager = context.getObjectManager(); if (!(objectManager == null)) { this.repositories = objectManager.getAllManagedRepositories(); } }
attributes.put(A_ID, context.generateID(E_PARA, name));
ObjectManager objectManager = context.getObjectManager();
attributes.put(A_ID, context.generateID(E_LABEL, name));
/** * Generate a unique id with a sub name. Like the other form of generateID * this will append another sub-name. This is typically used for when * duplicate names are used but further identification is needed for * globally unique names. * * @param application * The application of this element, typically this is the element * type that is being identified. Such as p, div, table, field, * etc... * @param name * A locally unique name that distinguished this element from * among its siblings. * @param subName * An additional name to the original name to further identify it * in cases when just the name alone does not accomplish this. * @return */ public String generateID(String application, String name, String subName) { return combine(componentName, application, name, subName); }
attributes.put(A_ID, context.generateID(E_ITEM, name));
/** * Generate a unique id based upon the locally unique name and the * application. * * The format of the unique id typically is: * * <componentName> dot <application> dot <unique name> * * typically the componentName is the Java class path of the Wing component. * * @param application * The application of this element, typically this is the element * type that is being identified. Such as p, div, table, field, * etc... * @param name * A locally unique name that distinguished this element from * among its siblings. * @return A globally unique identifier. */ public String generateID(String application, String name) { return combine(componentName, application, name); }
attributes.put(A_ID, context.generateID(E_XREF, name));
attributes.put(A_ID, context.generateID(E_ROW, name));
attributes.put(A_ID, this.context.generateID(E_LIST, this.name)); if (this.type != null)
attributes.put(A_ID, context.generateID(E_CELL, name));
attributes.put(A_ID, context.generateID(E_TABLE, name)); attributes.put(A_ROWS, rows); attributes.put(A_COLS, cols);
attributes.put(A_ID, context.generateID(E_REFERENCE_SET, name));
divAttributes.put(A_ID, context.generateID(E_DIVISION, name)); if (interactive)
attributes.put(A_ID, this.context.generateID(E_FIELD, this.name)); attributes.put(A_FIELD_TYPE, this.type); if (this.disabled)