How to add short description in ATG Component? - atg

How to add short description for component property in ATG.
Ex: If we see loggingDebug property in a Nucleus componenet Short description will shown as True if debug log events should be generated. How to create such description for my property in component>

Simple Answer:
You cannot add a description for an individual property.
You can add a description for a component by specifying a $description in the .properties file
More Complex Answer:
For viewing in the dyn/admin screens, each Nucleus component is associated with an Admin Servlet. It is the Admin Servlet of the component that renders the admin screen (not a JSP or JHTML page).
For a given component, the admin interface determines the admin servlet to use for rendering the screen by querying the component.
ATG packages a number of admin servlets with the platform. The default one is ServiceAdminServlet and is associated with the GenericService. So anything that extends from GenericService - most of the components you write - gets an admin screen that is rendered by ServiceAdminServlet. There is a different one for the Repository class - which is why the admin screen for a repository component looks different to that for most other components.
You can implement your own admin interface for your components by implementing your own AdminServlet class, and overwriting the getAdminService() method (defined in the AdminableService interface) on your component to return an instance of your custom admin servlet.
However, GenericService already implements the interface, and provides a convenient extensible hook method createAdminServlet(), and it is preferable to extend ServiceAdminServlet than creating your own AdminServlet from scratch.
The ServiceAdminServlet class defines a printAdmin(...) method which you override to output the custom HTML needed.
Caveat:
In my original answer, I had missed out the More Complex section, because I think that it is far more effort for little gain. However, I have updated my answer to be more complete.
I have been working, very hands-on, with the ATG platform since 1998, and never once have I had reason to create my own admin interface.

I think what you need is create the MyComponentBeanInfo.java.
if you look inside the ATG_PATH\DAS\src\Java\atg\droplet, will see something like this: Component.java and your descriptor ComponentBeanInfo.java.
i have searched in oracle docs and i found this link:Oracle Docs: BeanInfo Example
inside in your componente will be:
paramDescriptors[0] = new ParamDescriptor("myProperty",
"this is my short description",
DynamoServlet.class,
false, true, outputDescriptors);
beanDescriptor = new BeanDescriptor(MyComponent.class);
beanDescriptor.setShortDescription("A custom servlet bean.");
beanDescriptor.setValue("paramDescriptors", paramDescriptors);
beanDescriptor.setValue("componentCategory", "Servlet Beans");

Related

How do I create AnyPoint Studio connector designer controls?

I am using DevKit to create a component for Anypoint Studio. I would like to create some complex configuration controls on the designer page but I can't figure out how to add those. I don't want the configuration to occur on the popup "Connector Configuration" dialog because that creates a global config and I need each component configured individually. Attached is a picture of the FTP designer page to show clearly what I'm talking about.
What do I need to implement in order to create these controls?
When I want to make properties like that, I make a method in the Connector class and annotate it with the #Processor Annotations e.g
#Processor(friendlyName="delete")
public List<String> deleteFiles(String hostName, String userName, String password, String path, String port){
}
The Downside of this is that you get an operation property in your connector but when you select an operation the params of that operation is shown. And you have to code it so that these are properties is overriding
those of the global configuration
Here is how the above code would look like when you use the connector
Hope this helps
Best regards
Jack

UI5 Component Metadata

I'm looking for a document with the possible metadata property names and config parameters for a component.
There are many documents on the internet with such definition. The question is how I know if the name of a property/parameter setting is a valid name.
metadata : {
name : "XXXXX",
version : "1.0",
includes : [],
dependencies : {
libs : ["sap.m", "sap.ui.layout"],
components : []
},
rootView : "XXXXX",
config : {
resourceName : "i18n",
resourceBundle : "XXXX",
serviceConfig : {
name : "main",
serviceUrl : "XXXXX",
}
}
There is a document available here which describes all possible metadata. Since there is no real assistance during design-time, you have to have a look in the API to check the possible values. If you want to extend it with your own properties/parameters, just make sure that the name is not too generic since the Component can be extended with each new version of UI5.
The approach of defining component metadata in the component itself has been superseded by an approach using a manifest file. You will find all available properties in the documentation .
The Component class extends the ManagedObject class and provides specific metadata for components. The UIComponent class provides additional metadata for the configuration of user interfaces or the navigation between views.
The metadata defined in component.js is common for faceless components and UI components. The following parameters are available:
abstract: Specifies if your component class is an abstract class that serves as a base for other components
version: Version of your component; this parameter belongs to the design-time metadata and is currently not used; it may be used in the future in the design-time repository
includes: Array of strings containing the paths to CSS and JavaScript resources for your component; will be added to the header of the HTML page and loaded by the browser. The resources will be resolved relative to the location of Component.js.
dependencies: Used to specify all external dependencies, such as libraries or components. Like the includes for resources that are added to the application’s HTML, the dependencies are loaded by SAPUI5 core before the component is initialized. Everything that is referenced here can be used in your component code right from the start. Specify here external dependences such as libraries or components, that will be loaded by SAPUI5 core in the initialization phase of your Component and can be used after it.
libs: Path to the libraries that should be loaded by SAPUI5 core to be used in your component
components: Full path to the components that should be loaded by SAPUI5 core to be used in your component
ui5version: Minimum version of SAP UI5 that the component requires; it helps to be ensure that the features of SAPUI5 runtime used in this component are available. As SAPUI5 currently does not enforce the use of the correct version, it is only used for information purposes.
properties: Defined for components in the same way as for a control or view
library: Specify the library the component belongs to
config: Static configuration; specify the name-value pairs that you need in the component
customizing: Customizing for components and views, see Extending SAPUI5 Applications
sap.ui.viewExtensions: Used for providing custom view content in a specified extension point in the standard application
sap.ui.viewModifications: Used for overriding control properties in the standard application
sap.ui.viewReplacements: Used for replacing a standard view with a custom view
sap.ui.controllerExtensions: Used for replacing a standard controller with a custom controller
for more Information go to the url:
https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/0187ea5e2eff4166b0453b9dcc8fc64f.html
Well, from the code you could check if the property exist with the get(Property Name) method that all elementes have.
Otherwise all the properties ad hoc are in this url that Tim Gerlach shared for you before.
If it is a regular development approach, you should ideally look at the API of the component class.
If you are using metadata driven approach for development and you might generate the required code then you should fetch details from metadata information provided by the class or read it from .js file. ".js" will be helpful if you are not using SAPUI5 runtime.
Hope, this helps.
.........
Good Luck
Final answer has to be by looking through the source code as nothing else, even the API documentation, will be able to be 100% accurate against the consuming source.
As mentioned in the documentation, the definition of Component's metadata has largely moved to a separate file named manifest.json (aka. Application Descriptor).
With the introduction of the descriptor for applications, components, and libraries, we recommend to migrate the component metadata to the descriptor. [...] For more information, see Descriptor for Applications, Components, and Libraries.
Besides just looking at the list of available parameters in the doc, the closest "assistance" you could get is the Descriptor Editor from Web IDE.
The Descriptor Editor provides available choices, placeholder suggestions, and input validation.

Joomla! 2.5+: Abuse a system plugin to create an URI addressable view

As it is fairly simple to create frontend views into the content area using Joomla!'s component infrastructure and a menu item, I wonder if it is not possible to abuse a system plugin to achive the same goal. Reason: keep the code slim (A plugin can consist only of two files.)
Suppose having mydomain.com/myuri, the system plugin should catch myuri, than override the content by a special content using onAfterRender.
My approach is to set some class variable within the derived plugin class to true, if the URI was hit. How can this be done, and which onEvent should be used?

How do I get a view part instance in an Eclipse e4 application?

I'm trying to get the instance of a view part in an Eclipse e4 application but I can't find the PlatformUI class. Has the name changed since Eclipse 3 or is it located in a different package?
When looking at Eclipse e4 Parts:
bugs like 371405 can be instructive:
org.eclipse.ui.presentations
This API no longer works in 4.2, and we never intend to make it work.
It is incompatible with the pluggable rendering story in 4.2. Decisions that could once be made by the presentation extensions are now up to the renderer.
Affected API that needs deprecation:
Entire API package: org.eclipse.ui.presentations
Extension point:org.eclipse.ui.presentationFactories
org.eclipse.ui.IWorkbenchPreferenceConstants#PRESENTATION_FACTORY_ID
org.eclipse.ui.IWorkbenchWindowConfigurer#getPresentationFactory
org.eclipse.ui.IWorkbenchWindowConfigurer#setPresentationFactory
The rest of the Tutorial explains how to declare "parts" (editors or views)
The OP August Karlstrom mentions:
This used to work:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("‌​some view");
Using a singleton like PlatformUI is a bad practice and one of the reason of the introduction, in e4, of Context. See this presentation on Context.
Paul Webster (IBM Eclipse Platform team member) comments:
In Eclipse4 you would use org.eclipse.e4.ui.workbench.modeling.EPartService.findPart(String) to find an MPart by ID.
The MPart contains the injected part in its object property.
As the page Workbench_Services details:
In e4, the notion of a workbench page will not be present.
The part service API will essentially be a merge of the existing 3.x IPartService and WorkbenchPage interfaces.
Note that this isn't ideal, as bug 372488 illustrates (following this thread):
An MPart for an MPartDescriptor is created with EPartService.createPart(descriptor_id), where descriptor_id is the identifier of the MPartDescriptor.
This part can be found again with EPartService.findPart(descriptor_id) -- if there is only one.
The problem is, that one may need do create more than one MPart for one MPartDescriptor.
An editor may be one example: one may want to edit different instances of one and the same kind.
The creation of more than one MPart for a given MPartDescriptor is possible, but there is no convenient method to find these parts.
EPartService.findPart(descriptor_id) will return the first MPart created for a particular MPartDescriptor, even if there is more than one.
So there are three problems, for a given MPartDescriptor:
EPartService.findPart(id) does not tell that there is more than one MPart.
There is no convenient way to get all MParts for this descriptor.
There is no API-way to get the particular MPart for given descriptor and "content" or "reference".
Currently the way to go is using EPartService.getParts() which unfortunately
returns all MParts, not only those corresponding to one particular
MPartDescriptor.
Then one would need to check, whether there is one MPart for the particular MPartDescriptor having a particular "content".
So something is missing that will find an MPart for a given MPartDescriptor
with particular "content" or "reference".
Just have the same question. After found this thread and tried with:
MPart mPart = epartService.findPart("MyPart");
MyPart myPart = (MyPart)mPart.getObject();
then I got my view part.

How can I extend/configure other plone addons preferences Configlets?

I have a third-party addon installed and now I have to extend this Configlet with a boolean Field, how can I do this?
Further I have to use results of a function from this addon?
Thanks in advance.
You can either try
1) Override form via a custom layer registered by your add-on and create new Form class, extending the orignal, which has the same name, but is registered against this layer. Thus, the form class will come from your add-on when your add-on and it's browserlayer is installed.
http://collective-docs.readthedocs.org/en/latest/views/layers.html
Layers are view-specific, so it is the view you are trying to override. Depending on the orignal c.simplesocial architecture it is not sure what kind of view - form relationship is in place.
2) monkey-patch the orignal form class
http://collective-docs.readthedocs.org/en/latest/misc/monkeypatch.html