Not able to call form in AEM6 - forms

I have copied the Forms from the /libs/foundation/components/form to /apps/mywebsite/components/form, I made some changes to the copied form files but still the default form is getting called.
Could you let me know or provide some documentation for the forms.
Thanks in advance

The problem is that you moved things to:
/apps/mywebsite/components/form
Instead, you need to copy them to:
/apps/foundation/components/form
apps overrides libs ONLY if the path is otherwise the same
so:
/apps/something/something/somethingelse
will override:
/libs/something/something/somethingelse
if ANY part of that path is different, that overlay won't work.
In addition, if something calls a component/resource/whatever under /libs using the fully qualified name (e.g. actually including /libs/ at the beginning) then it will still use that. But this is rare.
Let me know if you have more issues.
BTW, you can change this search approach (apps before libs) in the resource resolver settings in OSGI. It comes this way by default but can be changed.

If you didn't want to overrride but extend the foundation forms, you need to make sure that you copied everything or have the inheritance to foundation right. Most important is the cq:editConfig/cq:formParameters, where you need to have sling:resourceSuperType="foundation/components/form/defaults/field". If you use a cq:template instead, you need to set the supertype parameter there.
Then you would have to use your components on the page instead of the foundation ones.

Related

How to specify SonarQube rule description as a markdown/html resource file instead of using annotation?

I have my custom rule, let's say with AEM-1 key. So, as it is done here, I make my AEM-1.html resource file with some simple html content and it does not get's picked up by SonarQube 5.1. It refuses to start, because no description is provided for the rule.
I tried different packages names, tried to look for convention in source code etc. What's missing? Is there any documentation on that?
The naming convention is org/sonar/l10n/{plugin key}_{language}/rules/{repository key}/{rule key}.html.
It was documented in http://docs.sonarqube.org/display/DEV/Internationalization at the time rule descriptions supported localization. That's not the case anymore since version 4.2, but these HTML bundles are still supported.
The correct way since version 4.3 is to use the low-level API org.sonar.api.server.rule.RulesDefinition. It allows you to implement any kind over layer over it (xml, json, annotations, ...).

What is the difference between runtime headers and springboard headers?

What I know so far is that the runtime headers are inside the framework folder, and that you must class-dump your idevice to find the springboard headers. But what is the difference? I am working on a tweak and I don't know what headers to use, so this is confusing me a bit. For instance, if you want to add an object to the statusbar, what headers should I use?
You are correct, you will need to class-dump the SpringBoard headers or use an already dumped set such as this one:
https://github.com/Fr0stDev/SpringBoard-iOS5-Headers
As for which header to use, that usually involves doing some digging around. I'd suggest starting with SBStatusManager.h
I haven't tried to do this (add item to the status bar), but you also might want to look here for UIStatusBarServer. This class is not part of Springboard, per se, but appears to be part of the UIKit framework. It appears to have a method to addStatusBarItem. If I had to guess based on its name, it might be a framework service that listens for clients to add things to the status bar, which is what you want to do.

How to get request properties in routeStartup plugin method?

I'm developing a multilanguage application, and use routes with translated segments. For multilingual support I created special Multilingual plugin.
To use translated segments I need set translator for Zend_Controller_Router_Route before routes init. So only possible place for this in my plugin is routeStartup method, but there is one problem here - for determine right locale I need to use properties of request (Zend_Controller_Request_Abstract), like module, controller and action names, but they are not defined yet here in routeStartup method. They are already defined, for example, in routeShutdown - but I can't set translator for route there, because it have to be done before routes init.
So what can I do:
can I get request properties somehow in routeStartup
or can I re-setup translator later in routeShutdown
P.S: there is a question with exactly the same problem Zend_Controller_Router_Route: Could not find a translator, but proposed answers is not the option for me, because I can't just retrieve language code from url with Regex, I have much more complicated code to define right language code.
Thanks.
What about putting your code in preDispatch? That's what I personally do when I need to check if the person is logged in. Maybe you can move your code there too?

zend framework under document root in subdir

I developed a application with Zend Framework and now I want to be able to place the app in an subdirectory of a Documentroot.
e.g. http://www.example.com/myapp/
I read quite a lot of Docu how this could work, but all in all these solutions don´t fit my needs. Is there a trivial way to do the subdir thing, without adding the concrete path to any file which generates the pages.
There are some examples in the net, where a basePath is set in the application enviroment and so there is a method call bevor each "form" creation which prepends the path before the link.
$form->setAction($this->_request->getBaseUrl() . $this->_helper->url('sign'));
This was from: http://johnmee.com/2008/11/zend-framework-quickstart-tutorial-deploy-to-a-subdirectory-instead-of-web-root/
But this is only works for small examples, I have tons of forms, tons of views and tons of scripts. I can´t belive this (lets call it hack :) ) is the only solution to do this.
Any ideas?
You don't have to do anything special. See my tutorial at http://akrabat.com/Zend-framework-tutorial which is developed entirely within a sub-directory.
As they say on the web page:
I’m told this last issue has been
lodged has a defect and not necessary
from releases “1.7″ and beyond. The
helper->url will henceforth prepend
the baseUrl to its result.
So you should be fine. Do you actually use the $form->setAction() method on every form already? Because if you use it in combination with the url helper, the baseUrl will already be included.

How do I get my Objects to work in ASP.NET MVC2

I'm rather new to MVC2 (never been in MCV1) though I'm a WebForms developer for some years now...
in my MCV 2 start project I created a App_Code folder that I would put my Business Classes on it, I also add 2 References to 2 DLLs used for the API I'm about to use.
But I don't get Intellisense on the referenced objects
What am I doing wrong?
alt text http://www.balexandre.com/temp/2010-07-28_1343.png
Is this so much different from the WebForms part?
Added
Even if I put the Object in Models instead App_Code (where I normally put all code in WebForms) I still don't get the normal intelisense, so... it just tells me that something is wrong ... dang! MVC is hard! I probably should do this in WebForms...
alt text http://www.balexandre.com/temp/2010-07-28_1509.png
This has nothing to do with MVC2, and everything to do with you're doing it wrong. I can tell that its a possibility, as you're using App_Code (I mean, who does that?). I'd definitely suggest backing up and reading some MVC tutorials, as it IS much different (although not in the way you're asking about).
I'm not exactly sure WHAT you're doing wrong, however. It might bethat PerceptiveMCAPI is internal to the assembly, it might be because there is a bug in VS, it might be that you haven't imported the correct namespace... it could be a number of different things.
I'd do the following: 1) load the assembly in reflector and make sure you have the namespace and type name and that it is public 2) use the fully qualified name of the type 3) compile, check all errors and 4) restart VS.
If all else fails, Connect.
See the Models directory -- that's where your model classes would go, assuming the class is a view model class. Having said that, it should be able to pick up and provide intellisense for whatever references you add. App_Code isn't really intended for a Web Application project (the type used by MVC) where the code is compiled statically, but rather for a WebSite where the code is compiled dynamically at runtime. It could be the "special" nature of the directory that is causing the problem because it doesn't fit the project type. You might try simply creating a different directory (if Models isn't appropriate) and not use the special App_Code directory for your code. A separate class library project with a project reference in the web application would be another alternative and is the one I usually use for non-viewmodel/controller code.