cancel
Showing results for 
Search instead for 
Did you mean: 

NodeBrowser does not work properly

mohammed_amr
Champ in-the-making
Champ in-the-making
Hi,

I have a new content model called organization, and i create a new folder called organizations. once i create a new organization under organizations folder and then shutdown the alfresco server and start-up it again, i notice that both of search engine "Search Service" or "Node Browser" cannot find my new nodes which are built upon new content model.

Now, i navigate the organizations folder, and after that i use both of search engines "Search Service" and "Node Browser" and i notice that both of them is work properly.

What is the reason cause my problem ? is there any parameter must be set in the search parameters ? is there a bug ?

System Info:
Version: Community - v3.4.0 (d 3370)
Installed Schema   4113
Installed Version   3.4.0 (d 3370)

All of your replies are highly appreciated.

Mohammed Amr
Senior System Developer
Digital Series Co.
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
What does [sic] "notice that both of them is work properly."  mean?  What do you think is wrong with the node browser?

The node browser in Explorer does work correctly and you should be able to rely on it, the chief architect is fond of saying "the node browser never lies"     Its  far more likely there is an error with your data rather than there being something wrong with the Node Browser.

I suspect you have several things going on here, however from what you have posted its not clear what the problem or problems are.

mohammed_amr
Champ in-the-making
Champ in-the-making
let's talk,

I create a new content model with type organization such as this


<type name="sec:organization">
         <title>Organization</title>
         <parent>cm:content</parent>
         <properties>
            <property name="sec:organizationId">
               <title>Organization ID</title>
               <type>d:int</type>
            </property>
            <property name="sec:organizationName">
               <title>Organization Name</title>
               <type>d:text</type>
            </property>
            <property name="sec:organizationDescription">
               <title>Organization Description</title>
               <type>d:text</type>
            </property>            
            <property name="sec:rootPosition">
               <title>Root Position</title>
               <type>d:noderef</type>
            </property>
         </properties>
      </type>   

And i create a folder under dictionary called organizations, and i create a dialog called "organization creation dialog".

Within the previous dialog i write a code to create the organization after gathering the information from the user and the code to create an organization split into two parts:

Constants Definition:


   public static final String DIGITAL_SERIES_SECURITY_MODEL_NAMESPACE_STRING = "www.ds.alfresco.security.extension.com";
   public static final String DIGITAL_SERIES_SECURITY_MODEL_NAMEPSACE_PREFIX_STRING = "sec";
         public static final QName TYPE_SEC_ORGANIZATION = QName.createQName(DIGITAL_SERIES_SECURITY_MODEL_NAMESPACE_STRING, TYPE_SEC_ORGANIZATION_STRING);


- one of them once the user click on the create organization and it is like this


      public final RetryingTransactionCallback<String> CreateOrganizationCallback
               = new RetryingTransactionCallback<String>() {
         public String execute() throws Throwable {
            // Acquire organization folder
            Node organizationsFolder = new Node(NodeUtil
                  .acquireOrganizationsFolder(searchService));
            // current organization created
            currentOrganization = new Node(
                  nodeService.createNode(
                              organizationsFolder.getNodeRef(),
                              ContentModel.ASSOC_CONTAINS,
                              QName.createQName(
                                          Constants.DIGITAL_SERIES_SECURITY_MODEL_NAMEPSACE_PREFIX_STRING,
                                          Constants.TYPE_SEC_ORGANIZATION_STRING),
                              Constants.SecurityModelQNames.TYPE_SEC_ORGANIZATION,
                              new HashMap<QName,Serializable>()).getChildRef());
            return "";
         }
      };

- and the second part will be invoked once the user click on finish


      public final RetryingTransactionCallback<String> CreateOrganizationCallback = new RetryingTransactionCallback<String>() {
         public String execute() throws Throwable {
            
            // PREPARE ORGANIZATION SEQUENCE ID
            Node organizationSeq = new Node(SequenceUtil.prepareSequence(
                  SequenceUtil.ORGANIZATION_SEQUENCE_NODE_NAME_STRING,
                  nodeService, searchService));
            
            // LOCK ORGANIZATION SEQUENCE
            if(!organizationSeq.isLocked()){
               lockService.lock(organizationSeq.getNodeRef(), LockType.NODE_LOCK);
               // GET THE NEXT SEQUENCE
               SequenceUtil.addCurrentSequence(organizationSeq.getNodeRef(), nodeService);
            }
   
            // PREPARE ORGANIZATION PROPERTIES
            Map<QName, Serializable> orgProps = new HashMap<QName, Serializable>();
            
            // UPDATE ORGANIZATION SEQUENCE ID
            orgProps.put(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_ID,
                        SequenceUtil.getCurrentSequence(
                              organizationSeq.getNodeRef(), nodeService));
            // UPDATE ORGANIZATION/CONTENT NAME PROPERTY
            orgProps.put(ContentModel.PROP_NAME,
                  NodeUtil.extractNodeProperty(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_NAME,
                        currentOrganization).toString() +
                  "_"+orgProps.get(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_ID));   
            // UPDATE ORGANIZATION NAME PROPERTY
            orgProps.put(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_NAME,
                  NodeUtil.extractNodeProperty(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_NAME,
                        currentOrganization).toString());
            // UPDATE ORGANIZATION DESCRIPTION
            orgProps.put(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_DESCRIPTION,
                  NodeUtil.extractNodeProperty(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_DESCRIPTION,
                        currentOrganization).toString());
            // UPDATE THE PROPERTIES TO AN ORGANIZATION NODE
            nodeService.setProperties(currentOrganization.getNodeRef(), orgProps);
            // UNLOCK
            lockService.unlock(organizationSeq.getNodeRef());
            
            return "";
         }
      };

Now, if i create an organization and search on it by node browser using
TYPE:"secSmiley Surprisedrganization", the node browser will find all nodes from type organization, and once i shutdown the alfresco server and startup it again and use the same keyword for search the node browser does not find the nodes absolutely.

- if there is a wrong code - and that might happen sure - can you tell me what is the wrong in this case ?
- if there is no wrong code - and that might happen sure - lets we talk about something parameter i will use to update alfresco indices.

Thanks for you and special thanks for your chief architect  :wink: 
Mohammed Amr
Senior System Developer 
Digital Series Co.

mohammed_amr
Champ in-the-making
Champ in-the-making
Dears,

I tried to use the built-in alfresco functionality to add a new content from my custom model, and unfortunately the same problem is seeing. and this is the following scenario.

- go to the dictionary folder
- create an organizations folder
- navigate to organizations folder
- create content from type organization
- shutdown the alfresco server
- startup the alfresco server
- go to the node browser and try using lucene search by typing TYPE:"secSmiley Surprisedrganization" or TYPE:"{MUURI}organization" to see that there is no nodes.
// Exception
  don't enter the company_home folder, because once you enter the company_home all things will work fine.

// Notice
The output of my functionality is corresponding to alfresco node browser functionality.

Thanks for your help and support.

Can you please give me a care to solve my problem cause i'm trying to complete what i start to do and still i'm pending to solve the problem.

Till now i'm talking about new custom model, and i'm trying to see the alfresco model if the same problem is found or not.

But it seems that the problem is not found when i create a new content from create content action and select the type content.

mohammed_amr
Champ in-the-making
Champ in-the-making
Hi all,

I'm facing a real problem here and there is no one to answer me or even consider my post.

Please give me any feedback i have an alfresco without customization except i have a new custom model, so i need an answer because major functionality depends on it.

Thanks