To access the classes of CPP in qml.

I have set up to access the classes of PCB in qml in two ways: -.

1. create an attached object and the id of the class of CPP special and then access via the id.

2. fix the CPP on the qml class before pushing the page using the setContextProperty.

I wanted to know exactly when to use these two methods. There a difference in terms of scope and memory. Please explain.

Great Question!

Local objects:

Attached to objects, or who inherit from classes of cascades, is the simplest way to expose c ++ objects that relate to user interface elements. This is what you use if you want this object to BELONG to this context qml. It is created by the qml context when createObject is called (your qml file is loaded) and destroyed with the user interface objects. You can create many of these objects, anywhere you need. However, if you want to expose global properties, it is probably not a good approach.

The only time you would use objects attached to global stuff is if you expose a singleton class to allow qml set locations to manage signals (OrientationHandler is an example of that, without an OrientationHandler object, that you have nothing to connect).

Global objects:

Context properties can be considered global variables for a particular context, but with inheritance: context properties are passed to the contexts of the child. These objects are the PROPERTY of c ++, must be created before the creation of the object (createObject is called) and must remain valid for the lifetime of any context, they are placed in, but then destroyed is no longer necessary.

The disadvantage of context properties changing them can be expensive. If you set a context property after the createObject call (that is to say an object exists that was created from this context), then all links in javascript in this context will be re-evaluated. However, you can mitigate this issue by exposing an object that contains the value as a property, so that links to branch on change of signals well if necessary.

Inheritance is where shine context properties. There is a context root, which is in this context of default parent for new contexts. If you set a context property of the root context, it is available everywhere in any document qml. Here is an example of how do:

QmlDocument::defaultDeclarativeEngine()->rootContext()->setContextProperty("app", myApp);

Note: when I speak of createObject, I'm talking about QDeclarativeContext::createObject. It is called internally by QmlDocument::createRootObject.

For more information on the Qml contexts, see http://qt-project.org/doc/qt-4.8/qdeclarativecontext.html

For more information about the inner workings of qtdeclarative, see http://qt-project.org/doc/qt-4.8/qdeclarativeengine.html and http://qt-project.org/doc/qt-4.8/qdeclarativecomponent.html

http://Qt-project.org/doc/Qt-4.8/qtbinding.html is still relevant as well

Tags: BlackBerry Developers

Similar Questions

  • How to access the class of an Actionscript object

    Hello

    I'm trying to access the class of an Actionscript object as the Java method getClass().

    example:

    I have this class with a method "myMethod(clazz:Class)".

    public class Class2
    {
         ... 
         public function myMethod(clazz:Class):void
         {
           ...
         }
    }
    

    This other class:

    public class Class1
    {
        var class2:Class2 = new Class2()
    
        public function otherMethod(obj:Object):void
        {
              class2.myMethod(obj.????);
        }
     }
    

    Perhaps is it not possible?

    Thank you

    vdelbart

    There is no native to retrieve method class of an object, but this utility function should work for you:

    import flash.utils. *.
    import flash.system.ApplicationDomain;

    function getClass(o:*, appDomain:ApplicationDomain=null): Class
    {
    If (o == null | is a class o) {return o ;}

    result: var class = null;

    Try
    {
    var cName:String = flash.utils.getQualifiedClassName (o);
     
    If (appDomain! = null)
    {
    try {}
    result = appDomain.getDefinition (cName) class;
    }
    catch (err2) {result = null ;}
    }
    If (result is nothing)
    {
    Result = flash.utils.getDefinitionByName (cName) class;
    }
     
    }
    catch (Err) {result = null ;}
    Finally {}
    return the result;
    }

  • Accessing the context property of main.qml to a custom list in a file item separate qml

    Hi all

    Sorry if this is already covered somewhere.

    I currently have an application with a list view in my main.qml.  I put a context property for my class app c ++ to be "app" in my main.qml.  My list uses a custom list item that is defined in a file separate qml.  The custom list item has a popup menu.  In this context menu, I want to call Q_INVOKABLE functions that are part of my class from the main application in C++.  What is the best way to be able to do?  Should I just set the context property on my file qml of list item custom like I do with my main.qml or is there a better way?

    Thank you

    I think that this has been repeated several times, but as it is not really intuitive:
    a listitemcomponent lies in a different context, it cannot access the context property of the qml file.
    You can use the reference to the listview to reach outside, see https://developer.blackberry.com/cascades/reference/bb__cascades__listview.html ListItem.view

  • Access the class from the loaded module

    I have this in the main application and I the public variable test in the module. The problem is that I don't know how to access it properly.

    public

    var fontsModule:IModuleInfo;

    public var FontsClass: Class;

    public

    function initApp(evt:FlexEvent):Sub

    {

    fontsModule = ModuleManager.getModule ("modules/fontsBG.swf");

    fontsModule.addEventListener (ModuleEvent.READY, fontsLoaded);

    () fontsModule.load

    new ApplicationDomain (ApplicationDomain.currentDomain), null , null , moduleFactory);

    }

    public function fontsLoaded(evt:ModuleEvent):Sub

    {

    FontsClass = fontsModule.factory.create)

    as Class;

              trace ()' HERE: "(+ FontsClass.test);". "

    }

    If I replace the class with the name of the 'FontsBG' class actions script in this example, everything would work, but the main swf file size goes from 100 to nearly 400 kbs when the fontsBG.swf file is 67 kbs. So I'm certainly not doing it right.

    So the question is: what is the correct way of loading the modules and using their properties and functions - through the class or interface and how it's done? Please set up a small code example so I can get the concept of base as well as the readers of this thread.

    Thank you!!!

    (3) again, you will need to use a shared interface or a common base class.

    Most people put the UI widgets in a module and they all extends UIComponent

    You can reference them as UIComponents.  If they need to access other

    Properties and methods, they define an interface.

    (1) my guess is that the button does not know what a module with embedded

    fonts loaded and don't refresh to use.  Normally, you would

    wrap styles in the module with the fonts, and then set styleonce

    the module is loaded.  In this case, you specify MyriadPro as the

    CSS font family and he would set via setStyle once the module is loaded.

  • To access the class fields in another package (reflection)

    Hello

    Given that I have not found a section named "Reflection" in the forums, I guessed that this would be the place to post my question.

    I'm trying to implement a function called setField (field, value) in my classes using reflection. I have included this function in a base class so that its child classes could also use this feature.

    The base class looks like:
    public class Base {
    
        private Integer x;
    
        public void setField( String fieldName, Object value) {
            Class cls = this.getClass();
            
            while (cls.getSuperclass() != null) {
                System.out.println(cls.getName());
                
                try {
                    Field field = cls.getDeclaredField(fieldName);
                    field.set(this, value);
                    break;
                } catch (IllegalArgumentException ex) {
                    Logger.getLogger(JPT.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    Logger.getLogger(JPT.class.getName()).log(Level.SEVERE, null, ex);
                } catch (NoSuchFieldException ex) {
                    Logger.getLogger(JPT.class.getName()).log(Level.SEVERE, null, ex);
                } catch (SecurityException ex) {
                    Logger.getLogger(JPT.class.getName()).log(Level.SEVERE, null, ex);
                }
                
                // if field not found in this class, check the superclass
                cls = cls.getSuperclass();
            }
        }
        
        public Integer getX() {
            return x;
        }
    
        public void setX(Integer x) {
            this.x = x;
        }
    }
    And then I have a class of the child:
    public class Child extends Base {
    
        protected Integer y;
    
        public Integer getY() {
            return y;
        }
    
        public void setY(Integer y) {
            this.y = y;
        }
    }
    So, basically, I need to get the type of features to work, i.e. to change a field in the child's class using the function available from the following base class:
    Child child = new Child();
    
    child.setField("y", new Integer(20));
    
    System.out.println(child.getY());
    This works when the base so the child classes are in the same package, but when they are on different packages, I get an error that looks like:
    java.lang.IllegalAccessException: Class teletutor.core.test1.Base can not access a member of class teletutor.core.test2.Child with modifiers "protected"
         at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:95)
         at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:261)
         at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:253)
         at java.lang.reflect.Field.doSecurityCheck(Field.java:983)
         at java.lang.reflect.Field.getFieldAccessor(Field.java:927)
         at java.lang.reflect.Field.set(Field.java:680)
         at teletutor.core.test1.Base.setField(JPT.java:27)
    I hope that I have identified my problem. Please suggest how I can get the desired effect.

    Thanks in advance.
    field.setAccessible(true);
    
  • To access the properties of QML context through several QML files

    It seems so basic, but I don't see how well...

    I put a 'WebAPI' context property to access my class that makes HTTP requests etc. WebAPI works very well main.qml, but when I try and use it in the included LargeThumbItem.qml I get:

    "LargeThumbItem.qml:37: ReferenceError: can't find variable: WebAPI.

    How to set a context property that is available for * all * my QML files? What is the best practice for this?

    hand. QML

    {

    ...

    {ListItemComponent}

    type: 'point '.

    LargeThumbItem {

    }

    }

    ....

    }

    LargeThumbItem.qml

    {

    ....

    WebAPI.getImagePath (...)

    ...

    }

    I do the usual configuration...

    QmlDocument * qml = QmlDocument::create("asset:///main.qml").parent(this);

    QML-> setContextProperty ("WebAPI", m_pWebAPI);

    I tried calling qml-> documentContext()-> setContextProperty(), but it did not work. Is there a global context that I can put all documents will inherit? (the API documentation seems to suggest there is).

    This problem is related to what is described here and the solution is the same. The problem is that the ListItemComponents have a different context and lifecylce due to the fact that they are cached in and out as the scrolls of the ListView (see here for details).

    I solved it by adding a dynamic property on the global object of 'Qt' for example in onCreationCompleted() or anywhere where the senses in main.qml. In my case, I chose to pass a string, because I don't know if the global property to the instance around WebAPI is a good idea.

    Qt.homeListBaseURL = WebAPI.getImagePath ("TitleImagePathPrefix", "170 x 240")

    Then in LargeThumbItem.qml for example

    {WebImageView}

    ...

    URL: Qt.homeListBaseURL + ListItemData.ContentId + '.jpg '.

    ...

    }

  • Can not access the context in QML property

    So I have an arraydatamodel in the CPP file, I use qml-> setContextProperty (...) to set it up to allow QML to access, the strangest part is, no matter if I put it in navigationPane Page or a container, it keeps saying can't find not variable, but in the same QML in ListView, they can access it without a problem. The other weird part, it is an another QML is able to access it in the tag of the page, the same model.

    By default of the Jun 02 9000 REVIEWS asset:///main.qml:24 09:12:59.416 com.example.IntervalTimer1.testDev_ervalTimer1a7a2c2e2.427733134: ReferenceError: can't find variable: eventsModel
    By default of the Jun 02 9000 REVIEWS asset:///main.qml:110 09:12:59.416 com.example.IntervalTimer1.testDev_ervalTimer1a7a2c2e2.427733134: ReferenceError: can't find variable: eventsModel

    Here is my code

    import bb.cascades 1.0
    
    NavigationPane {
        id: navigationPane
        backButtonsVisible: false
        // Javascript definition
        function udpateTotalTimeLabel() {
            console.log("In updateTotalTimeLabel function");
            var totalHour = 0, totalMinute = 0, totalSecond = 0;
            // To debug javascript object print function
            var print = function(o) {
                var str = '';
    
                for (var p in o) {
                    if (typeof o[p] == 'string') {
                        str += p + ': ' + o[p] + '; 
    '; } else { str += p + ': {
    ' + print(o[p]) + '}'; } } return str; } console.log("EventsModel: " + eventsModel.size()); for (var i = 0; i < eventsModel.size(); i ++) { var currentEvent = eventsModel.data([ i ]); console.log("EventsEvent: " + currentEvent["EventName"]); totalHour += currentEvent["EventHour"]; totalMinute += currentEvent["EventMinute"]; totalSecond += currentEvent["EventSecond"]; } if (totalHour < 10) totalHour = "0" + totalHour; if (totalMinute < 10) totalMinute = "0" + totalMinute; if (totalSecond < 10) totalSecond = "0" + totalSecond; totalTimeLabel.text = totalHour + ":" + totalMinute + ":" + totalSecond; } function onDataReady() { console.log("Received DataReady signal"); navigationPane.udpateTotalTimeLabel(); newEventSheet.close(); } Page { id: root titleBar: TitleBar { title: "Interval Timer" } ..... onCreationCompleted: { navigationPane.udpateTotalTimeLabel(); console.log("No of EventsModel: " + eventsModel.size()); console.log("In sheet creationCompleted"); mainObj.dataReady.connect(navigationPane.onDataReady); } }

    In the PRC

    // Default empty project template
    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    #include "CountdownTimer.hpp"
    
    using namespace bb::cascades;
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app)
    : QObject(app)
    {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // Initialize the Array Data Model for holding events
        this->eventsModel = new ArrayDataModel();
        // For Testing only
        QVariantMap event;
        event["EventName"] = "Event1";
        event["EventHour"] = "00";
        event["EventMinute"] = "01";
        event["EventSecond"] = "02";
        this->eventsModel->append(event);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
    
        // Registering the QTimer type to QML
        qmlRegisterType("TimerLibrary", 1, 0, "CountdownTimer");
    
        // Setting the access for QML to member variable
        qml->setContextProperty("eventsModel",this->eventsModel);
        qml->setContextProperty("mainObj",this);
    
        // set created root object as a scene
        app->setScene(root);
    }
    
    .....
    
    void ApplicationUI::refreshData()
    {
        emit dataReady();
    }
    

    Thank you.

    The fixed.

    You must call setContextProperty before calling createRootObject.

  • to access the data of the children with the static accessor of parent class

    I'm new to LVOOP. I'm trying to create accessors of data in the parent (static) class and use them in the child's class. I don't need them to be dynamic becase the accessors are identical for child and parent. Is it possible to access the data of a class without creating an accessor for each class?

    It is the dynamic method that I created that finally works. Once I found the VI "call Parent Method.vi' everything has worked.

    So now I created all my data as static accessors and my methods are dynamic (assuming that they do).

    Thanks for all the help.

  • To access the elements of a cluster of LV-class

    Elements of a cluster are also accessible using nodes property. Therefore, it is possible to write a generic function to get the "content" (e.g. labels, variant values) of the clusters.

    But it's not possible for a "class pole", even, it is used in a class method. The property is not available here.

    How can I programmatic read items (attributes ' ") of a class (-cluster)?

    For example, I like to read the labels of all the elements / attributes in a class.

    Any idea?

    You can access the items in the class, but this approach is somehow "hackmac" and so I would not recommend you to do. However, it seems to be possible...

    In the attached approach, exchange of with the name of your control that contains the data of the class.

    hope this helps,

    Norbert

  • (Question LVOOP) How one access the data of another class in another class?

    Hello-

    Ass title suggests, how do I access another class (or is it class?) data from another (different) class?  I will attach a picture showing where my problem is...

    I was told this:

    http://zone.NI.com/reference/en-XX/help/371361H-01/lvhowto/setting_scope_classes/

    May contain some helful info, but I can still understand how to unbundle Renault of classes inside the component class data (as seen in the attached photo).

    I think there could be something simple I'm missing here when it comes LVOOP or OBJECT-oriented programming in general... If any of you are willing to help me, it would be much appreciated!

    Thank you!

    -pat

    Personal data are always private, you can never set public. Unbundle cluster function can be used only on the thread of class when he is in the class. If you need to access private data, you must create accessors.

    It of simple, just the class right click and select new, VI for access data members. He invites you to a dialog box to fill you with what you want to create, elements of data and if you want them available through property nodes (recommended). Once completed, this will generate the Afterward screw., you can use in any other VI. The nice thing about making them nodes of property is that you can plop down a property node and it thread class, and all the created accessor functions will appear in the list.

  • to access the variables in a page in another page qml

    Hey gang,

    I've been watching some of the other problems autour to access the variables from one page on another page qml qml, and I can't get this to work.

    I have a page, main.qml with a NavigationPane.  The NavPane has a Page and some containers.

    I have a property defined in the NavigationPane like this:

    NavigationPane {
        id: mainNav
        backButtonsVisible: true
        property int customInt: 2
    
        onCustomInt: {
            console.log("  -------------> App: customInt");
        }
    

    I have a ComponentDefinition for next page, called SettingsPage.qml.  In the settings, I have two drop-down lists and a slider.

    Page {
        actionBarAutoHideBehavior: ActionBarAutoHideBehavior.HideOnScroll
        id: pgSettings
    
        ScrollView {
            id: pageScroller
            scrollViewProperties.initialScalingMethod: ScalingMethod.AspectFit
            Container {
                topPadding: 25
                bottomPadding: 25
                rightPadding: 25
                leftPadding: 25
                Label {
                    text: "Settings"
                    textStyle.fontSize: FontSize.XLarge
                }
            Container {
                id: dropDown1
                topPadding: 25
                bottomPadding: 25
                rightPadding: 25
                leftPadding: 25
                DropDown {
                       id: ddOption1
                       title: "Option 1"
                       verticalAlignment: VerticalAlignment.Center
                       horizontalAlignment: HorizontalAlignment.Center
                      Option {id: o1o1; text: "One"; }
                      Option {id: o1o2; text: "Two"; }
                      Option {id: o1o3; text: "Three"; selected: true; }
                      Option {id: o1o4; text: "Four"; }
    
                    onSelectedIndexChanged: {
    
                        switch (selectedIndex){
                            case 0:
                                //
                                console.log(" -->App: Option 1 Selector, On");
                                customInt = 0;
                                break;
                            case 1:
                                //
                                console.log(" -->App: Option 1 Selector, Off");
                                customInt = 1;;
                                break;
                            case 2:
                                //
                                console.log(" -->App: Option 1 Selector, Top (default)");
                                customInt = 2;
                                break;
                            case 3:
                                //
                                console.log(" -->App: Option 1 Selector, Bottom");
                                customInt = 3;
                                break;
                        }
                    }
                }
            } }
    

    I look forward to the the statement will change the level property NavPane, called customInt, but it doesn't.

    the output of the console shows that the ' App: Option 1 selector "gets selected in the dropdown list selected index changes, but the onCustomInt() funtion slot never gets called.

    I tried "mainNav.customInt = X" too, but the parameters cannot solve the mainNav.  I get "unknown symbol 'mainNav'" error with alittle bulb.

    what I am doing wrong?

    When you call the second page, SettingsPage.qml, set it as an object.

    Don't do the following:

    attachedObjects: [
    
        ComponentDefinition {
            id: settingsPageDefinition
            source: "SettingsPage.qml"
        }
    ]
    

    Follow these steps:

    attachedObjects: [
        // Definition of the second Page, used to dynamically create the Page above.
        ComponentDefinition {
            id: settingsPageDefinition
            Settingspage{
    
            }
        }
    ]
    

    Then the second page main navigation page in the IDE.  I had the same problem with a multi-page application, I created.

  • Cannot access the template page links in the bean class

    Hi all

    I use JDEV 12 c.

    I have a model in which I have 2 languages English and Hindi.

    Change language (when), I have re - run LOV queries for the respective language.

    so I added links method in model pagedef and try to access the same thing in the bean model class.

    When I have access to, I get Nullpointer Exception, who says the OperationBinding, does not exist in pagedef.

    is there a any restriction I can't access model pagedef in the bean class.

    Please suggest on this.

    Thank you

    Vieira

    https://blogs.Oracle.com/jdevotnharvest/entry/how_to_invoke_adf_bindings

  • CRMI: Class AdfConnectionFacade to access the connections of the AAU

    Hello

    Jdev: 11.1.1.7

    WebCenter and UCM: 11.1.1.8

    I am trying to interact with the AAU via API CRMI. According to the use CRMI to access the content - 11 g Release 1 (11.1.1), server

    When I use the AdfConnectionFacade class to access the University Complutense of MADRID "Main connection" thanks to connections.xml (following these instructions), the connection test always fails. I have deployed the app to a managed to webcenter stand-alone server as well. The code is as follows:

            SecurityContext sctx = ADFContext.getCurrent().getSecurityContext();
            this.userName = sctx.getUserName();
            
            IdcContext idcCtx = new IdcContext(userName);
    
    
            IdcClientManager idcClientManager = null;
            IdcClient<IdcClientConfig, Protocol, Connection> idcClient=null;
            DataBinder reqBinder = null;
            
            try {
                idcClientManager = new IdcClientManager();
                
                AdfConnectionFacade acf = new AdfConnectionFacade("localUCMConn");
                boolean ok = acf.testConnection(userName).isSuccess();
                if(!ok){
                    System.out.println(acf.testConnection(userName).getMessage());
                    throw new IdcClientException (acf.testConnection(userName).getMessage());
                }
    

    And the acf.testConnection fails with the following message:

    IdcClientExceptionweblogic: Failed: IdcService='<NONE>', cause='oracle.vcr.jam.JamRepository cannot be cast to oracle.stellent.ridc.convenience.adf.connection.RidcConnection'
    

    I can surely use a db based property or a text file to find the coordinates of connection socket Complutense University of MADRID, but, in this way, I think it will be more configurable from the Console of EM.

    Yet, can someone enlighten me on which is the standard approach to access the connection details and also, how to set up the connection details in the EM console, because I saw no connection of type "Content Server" in the list.

    PS: Announced this request here, as it seems more than one ADF and webcenter linked to a UCM/RIDC one query.

    Thank you

    Vyas.

    Hi Vyas,

    I don't know if RIDC façade class is the right path to follow because of the entry of the next development team:

    The RIDC based (oracle.stellent.ridc.convenience.adf.connection.RidcConnection) connection seems to be associated with the obsolete RIDC connection management code that was created previously,http://docs.oracle.com/cd/E23943_01/doc.1111/e10807/c23_ridc.htm#sthref1487

    This older technology did not meet code of connection appropriate ADF patterns and does not support MDS for customizations after deployment.

    The client should try to avoid using this older connection RIDC management framework code.

    Thank you

    Srinath

  • SE atg.servlet.pagecompile.PageCompileException: cannot load the class: _dasadmin_3__UTF_s8._index Exception while accessing the dynamo Server merch

    Hi Experts,

    I am getting error while accessing the dynamo of merch, next server

    18:10:17, 334 ERROR [STDERR] java.lang.UnsupportedClassVersionError: _dasadmin_3__UTF_s8/_index: version unsupported major.minor 51.0

    18:10:17, 335 ERROR [STDERR] at java.lang.ClassLoader.defineClass1 (Native Method)

    18:10:17, 335 ERROR [STDERR] at java.lang.ClassLoader.defineClassCond (unknown Source)

    18:10:17, 335 ERROR [STDERR] at java.lang.ClassLoader.defineClass (unknown Source)

    18:10:17, 335 ERROR [STDERR] at atg.servlet.pagecompile.ReusableClassLoader.findClass(ReusableClassLoader.java:330)

    18:10:17, 335 ERROR [STDERR] at atg.servlet.pagecompile.ReusableClassLoader.findClass(ReusableClassLoader.java:286)

    18:10:17, 335 ERROR [STDERR] at java.lang.ClassLoader.loadClass (unknown Source)

    18:10:17, 335 ERROR [STDERR] at atg.servlet.pagecompile.ReusableClassLoader.loadClass(ReusableClassLoader.java:602)

    18:10:17, 335 ERROR [STDERR] at java.lang.ClassLoader.loadClass (unknown Source)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pagecompile.PageProcessor.loadClass(PageProcessor.java:2704)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pagecompile.PageProcessor.loadClass(PageProcessor.java:2605)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pagecompile.PageProcessor.compilePageClass(PageProcessor.java:2479)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pagecompile.PageProcessor.getPageInfo(PageProcessor.java:1787)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pagecompile.jsp12.Jsp12PageProcessor.getPageInfo(Jsp12PageProcessor.java:324)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.minimal.MinimalServletContainer.compileServlet(MinimalServletContainer.java:153)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pagecompile.PageCompileServlet.service(PageCompileServlet.java:303)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.DynamoServlet.service(DynamoServlet.java:148)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:160)

    18:10:17, 336 ERROR [STDERR] at atg.droplet.DropletEventServlet.service(DropletEventServlet.java:657)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:267)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pipeline.DispatcherPipelineServletImpl.service(DispatcherPipelineServletImpl.java:253)

    18:10:17, 336 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.MimeTyperPipelineServlet.service(MimeTyperPipelineServlet.java:228)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.FileFinderPipelineServlet.service(FileFinderPipelineServlet.java:729)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.DispatcherPipelineServletImpl.service(DispatcherPipelineServletImpl.java:275)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.ServletPathPipelineServlet.service(ServletPathPipelineServlet.java:208)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 337 ERROR [STDERR] at atg.security.ExpiredPasswordAdminServlet.service(ExpiredPasswordAdminServlet.java:312)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.BasicAuthenticationPipelineServlet.service(BasicAuthenticationPipelineServlet.java:513)

    18:10:17, 337 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 338 ERROR [STDERR] at atg.servlet.pipeline.DynamoPipelineServlet.service(DynamoPipelineServlet.java:491)

    18:10:17, 338 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 338 ERROR [STDERR] at atg.dtm.TransactionPipelineServlet.service(TransactionPipelineServlet.java:249)

    18:10:17, 338 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

    18:10:17, 338 ERROR [STDERR] at atg.servlet.pipeline.HeadPipelineServlet.passRequest(HeadPipelineServlet.java:1271)

    18:10:17, 338 ERROR [STDERR] at atg.servlet.pipeline.HeadPipelineServlet.service(HeadPipelineServlet.java:952)

    18:10:17, 338 ERROR [STDERR] at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:272)

    18:10:17, 338 ERROR [STDERR] at atg.nucleus.servlet.NucleusProxyServlet.service(NucleusProxyServlet.java:237)

    18:10:17, 338 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    18:10:17, 338 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    18:10:17, 338 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    18:10:17, 338 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

    18:10:17, 338 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    18:10:17, 339 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    18:10:17, 339 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

    18:10:17, 339 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    18:10:17, 339 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

    18:10:17, 339 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

    18:10:17, 339 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

    18:10:17, 339 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

    18:10:17, 339 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    18:10:17, 339 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    18:10:17, 339 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

    18:10:17, 339 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    18:10:17, 339 ERROR [STDERR] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)

    18:10:17, 340 ERROR [STDERR] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)

    18:10:17, 340 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

    18:10:17, 340 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

    18:10:17, 340 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$ Http11ConnectionHandler.process (Http11Protocol.java:599)

    18:10:17, 340 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$ Worker.run (JIoEndpoint.java:451)

    18:10:17, 340 ERROR [STDERR] at java.lang.Thread.run (unknown Source)

    18:10:17, 340 ERROR [PageCompileServlet] page compilation error: index.jhtml: could not load class: _dasadmin_3__UTF_s8._index

    atg.servlet.pagecompile.PageCompileException: could not load class: _dasadmin_3__UTF_s8._index

    Can you please suggest me to fix this problem.

    Thank you and best regards,

    Murali

    Check which version of the JDK bin directory is in the path as 'javac' would be executed to compile the jhtml pages used in dyn/admin. There is a/atg/dynamo/servlet/pagecompile/ExtendedJhtmlPageProcessor of core component which has a string of compileCommand property whose value is specified as something like "javac - classpath {1} d {2} {0}". In fact, this same chain of command is used to compile pages with jhtml javac. Placeholder for the entrance of this is source file {0}, {1} for classpath and {2} is for the default destination directory, \home\pagebuild. In the first post, you mentioned this error:

    18:10:17, 334 ERROR [STDERR] java.lang.UnsupportedClassVersionError: _dasadmin_3__UTF_s8/_index: version unsupported major.minor 51.0

    This means that the major version number of your class file for the jhtml compiled of dyn/admin page 51, which means it is compiled with the java compiler JDK7 and so it can work very well with an interpreter of java7 unless you specify the java version of target when compiling as 'javac - target 1.6'. Looks like you have JDK7 and JDK6 on your machine and the JDK7 javac is coming to the system path. You can check the default version in the path by running "javac-version" on the command prompt. Change your path if necessary so that "javac-version" will give you the 1.6 version that you use. Also, make sure that ATGJRE is the version of java-oriented correct in \home\localconfig\dasEnv.bat: .sh

    It will be useful.

  • Access the current instance of request module in a java class in the model

    Hi all
    I'm trying to implement the custom story types in our application, (ModifiedById), I can read the user name of the security context, but not the username.
    I have a view object, say UserInfoVO which contains the logged in users info.
    I know, I can create a new instance of the application at the bean module and using security context information, I can go get the user ID.
                ApplicationModule am =
                      Configuration.createRootApplicationModule(amDef, config);
                    ViewObject vo = am.findViewObject("UserInfoVO1"); // view criteria applied by default
                    vo.setNamedWhereClauseParam("bUserName", user); // user from security context
                    vo.executeQuery();
    I'm trying to access the current instance of the Application module in my java class customized, that is used to return the attribute history ModifiedById.
    //referring the blog
    
    http://jobinesh.blogspot.in/2011/02/creating-custom-history-types.html
    It is, how do I access the current instance of ApplicationModule in a class as * "HistoryAwareEntityImpl" * located in project template. ?

    any help will be appreciated.

    Kind regards
    Rognard

    OK, in this case, you get the transaction of db of the base class object and this object allows you to search the module of the application

    public final DBTransaction getDBTransaction();
    ...
    DBTransaction:
    public ApplicationModule findApplicationModule(java.lang.String amName)
    

    or if you get the application root module

    public ApplicationModule getRootApplicationModule()
    

    Timo

Maybe you are looking for