I have one module which needs to be linked, through the same link module, to several modules. What would be the fastest way to do that?
Right now, I'm linking manually each module and I need to select the target module and link module every time.
If you don't want to use DXL, you could use Link->Advanced->Link By Attribute.
You would create a (temporary?) attribute in the outgoing module which contains the ID(s) of the requirement(s) you want to link to. Perhaps you need to apply a filter depending on your needs. Then you start "Link By Attribute" for each Link Module and for each Destination Module. That should be way faster than linking each and every object by hand.
Related
In order to analyze and understand the behavior of the AdhocHost compound module, especially in the use of its signals, it has better to extract its simple modules from its complex module(s).
Does anyone have documentation of the break down of this complex module into simple modules?
In the AdhocHost compound module documentation, there is some details about the AdhocHost module.
Thanks
Open a simulation in Qtenv where an Adhoc host is present and explore its internals by double clicking various modules. Whenever you reach a point where you cannot go deeper, that's a simple module. You can do the same in the left side property inspector where you can display the components in a tree view.
I have 3 projects, (Ex. project1, project2, project3). Some parts of these projects are using just 1 Form (frmDetails) placed on a separate folder.
I want to Disable some details on my form depends on what project I open.
For example, I opened Project1 - all details on my form are displayed. Then when I opened project2 - I want "Age" and "Birthday" set Visible to false.
What functions that I need to this?
The easiest way to do that, is to make 3 separate copies of the form for 3 projects and modify them as needed.
If you wish, you could create a class from that form with minimal objects that appear in every project, and create 3 separate forms from that class per project.
Normally, after you build an executable, executable doesn't know from which project it was build. So you can't basically have one form behaving differently per project. However, per project you might add something that tells the project (be it a text, xml, Json, dbf ... file). So you could read that file's content in load or init of form and set form objects' visibility on\off if you want to do it with just a single form. It would make things harder and would be confusing but at the end it might sound 'nice' since it is only a single form. My suggestion, as said on top, create 3 separate copies per project. That way it is much easier to control them.
If you're using an application object, you can have a property of that object that identifies the project. However, I'd be more likely to do this in a more generic way that specifically looking at a single property.
You might use a set of logical properties that indicate options you can turn on and off, and then you can check those properties in your forms.
I'm making a leave management (HRM) website. I'm using codeignitor HMVC to build this. Following features are included in this site:
A table to display a summary of leaves.
A table for leave types like annual, MC, urgent, other...
I was thinking to create two modules for leave_summary and leave_types, but my friend told me it is useless.
According to HMVC architecture we are trying to create self contained modules for reusability. If I'm creating a different module for leave types, I should be able to reuse it and module itself needs to be self containing. But I can't use leave_types module anywhere else.
My friend asked me to put all the leave related stuff in one module called leave. This sounds strange to me as I found lots of examples people are trying to separate things out.
Do we only need to separate the modules which can be reused in the future (ex: login module, image_gallery module, profile module) and keep all others things inside a one module?
(according to the above example I have to keep everything related to leave in a one module
ex: leave_type, leave_requests, leave_summary will be placed inside the leave module)
What are the benefits I will get, if I separate the leave_type, leave_requests, leave_summary etc... into separate modules?
Will I be able to reuse them? If so How?
In HMVC model classes and other assets can be exchanged among the modules, so how can I call it a self-contained module or a separate entity as it is depending on another module?
(ex: I have to call leave_type module's model class inside the leave_summary module to show the leave type name in a table.)
I'm little lost here. Please help me to understand. Thanks a lot!
As i work lot of MVC projects. And I am agree with your friend.
May times this question arise when i used join that i have to choose in which one module i should go for write query. If you write in one model may next developer will write in another one model.
So according me it is best to keep same type of tables which are handling relation and using for same behavior use this approach like leave model, profile model etc.
My company is making a module for Magento to fit the needs of Brazilian business rules.
Sometimes we need to override core models to add funcionality, sometimes need to rewrite core models to change some functionality. We are in doubt wich is the best practices to do this changes. For example, when a module needs to modify some behavior that is owned by other model.
We know that the modified files need to be created under "local/mycompany/modules..." but we're running into a problem that I will describe below.
A simple example is: Our Customer model needs to add the postcode with the '99999-999' mask, with the '-' before the last three chars. That is ok, its done and working. But when we need to use this postcode to make calculations, wee need to remove the '-' char. That was made in our rewrited "Shipping/Rate/Request.php" model.
That is the point of our doubt. Which is best?
Do this rewrite inside new "Shipping" module in "local/mycompany/Shipping/Model/Rate/Request.php" or do this rewrite inside the "Customer" module directory structure?
We are confusing about the structure we need to decide.
Something important is that we won't distribute or sell the modules rewrited as separated modules.
I'll put some code here:
The postcode is received by our "Customer" module, with masks in input, done by Javascript.
This "Customer" module add more fields to customer database.
Here, I rewrite "Shipping/Rate/Request.php", inside the "Customer" module:
in config.xml of "Customers" module:
<shipping>
<rewrite>
<rate_request>Mycompany_Customer_Model_Shipping_Rate_Request</rate_request>
</rewrite>
</shipping>
Then the file "Mycompany/Customer/Model/Shipping/Rate/Request.php" contains the code to remove '-' char from postcode.
Our doubt is: In some cases, we need to rewrite the "Shipping/Rate/Request.php" again to modify other methods. Which is best?
Every rewrite is done inside the module that came from? Creating repeated files of the same class.
Use the same directory structure of Magento's core inside the "Mycompany" namespace and modify all that we need inside one file of each class? Like Magento's core?
I don't know if I could explain what I need.
Thanks!
It's best to keep the contents of a module within it's module folder.
If the extends you are talking about are part of a module's functionality than you should place them inside that module's folder. The path would then be local/mycompany/Mymodule/Model/Shipping/Rate/Request.php.
I would create this extra level in the dir structure to make it clearer that the rewritten Request.php comes form the Shipping module, but this is absolutely not a necessity.
The reason why this is a good practice is of course modularity. You will be much more able to add, remove and version modules that are contained within one folder. Think about the module's xml file in app/etc/modules and the config files in your module's directory. They describe what is in your module's directory and not all the rewrites that belong to it but are in different module folders.
Besides, if you have extended or rewritten the same model from multiple modules and you decide to remove or totally rewrite a module of your own, how will you know which files or parts of files will belong to it if they are scattered around the app dir.
For a more detailed view on how to create Magento modules please also have a look at http://www.magentocommerce.com/magento-connect/create_your_extension/
My VB6 product may or may not have an embedded resource included in the executable.
What VB6 code would determine whether a certain embedded resource exists?
It depends on the kind of resource. VB6 has three different LoadRes<type> functions, and the proper one to use depends on the resource type. For instance, to load an image resource you use LoadResPicture. (There are links to the other functions in the tree menu on the left side of the linked page.)
Call the appropriate function, and if it returns the proper resource it's there. Handle the error if it's not, and you should be set.
This article may help.