-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should ApexUML package classes show in the list? #7
Comments
I thought i had it only showing up for Apex classes in the packaging org, not ones from packages installed, is it show up classes for packaged classes installed? If so, need to review the SOQL where class in the selector. |
Yeah, I have v1.5 installed in an org that is clean. There are only a few classes and ApexUML is the only installed package. I can see the ApexUML packaged classes on the left sidebar. I can also select them to the canvas. The second Ajax call to determine relationships fails though (because the code body for those classes cannot be seen). |
Hmmm that's odd, i did some tests with the SOQL query on ApexClass re: BodyLenght in an org with a managed package in and it returned -1, so i figured this would suffice. Trouble with NamespacePrefix (as per v1.4) is it ment that the tool could not be used in managed packages. I'm thinking a more relaiable way would be to provide some kind of custom setting to say, select all none namespaced classes plus ones in this namespace, what do you think? |
Yeah, I see what you are talking about with "body length" of -1. I ran the following query using SOQLX in my org where I am seeing the issue: select Id, NamespacePrefix, Name, ApiVersion, Status, IsValid, BodyCrc, Body, LengthWithoutComments, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp from ApexClass ....and I see the managed packaged classes from ApexUML. It would appear that the "-1" is not a real number but rather some sort of "User Interface-ish" type illusion. The same is true for the BodyCrc value. For the moment, I don't see a way around this. Let me think about it some more. |
So, here is a thought. We could change the ApexClassesSelector.selectAllVisible() method to first query for all ApexClasses and then loop through the result set in the following manner. list theClasses = [select Id, NamespacePrefix, Name, ApiVersion, Status, IsValid, BodyCrc, Body, LengthWithoutComments, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp from ApexClass]; list theClassesThatAreVisible = new list(); for (ApexClass aClass : theClasses) While the solution is a tad kludgy, it is the only answer that I can think of for the moment. Thoughts? |
Sounds good, it's encapsulated at least and does not require end user config, go for it. Will sort you packaging org access as well btw |
Adjusted selectAllVisible() method to query for all classes and then filter out those where the LengthWithoutComments is '-1'. This should filter out managed package classes but still allow classes in the default namespace that are attached to a package visible
@afawcett - I am seeing that the ApexUML package classes show in the list of classes available? IMO, this should not be the case. I can't think of a use case where we would want that to appear.
Thoughts?
using ApexUML v1.5
The text was updated successfully, but these errors were encountered: